Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brightnessctl: Add service to store screen brightness #12974

Closed

Conversation

mamins1376
Copy link
Contributor

Thought it would be nice to have this in the original package.

@mamins1376 mamins1376 changed the title Add brightnessctl service to {,re}store screen brightness brightnessctl: Add service to store screen brightness Jul 10, 2019
@CameronNemo
Copy link
Contributor

There are valid arguments against expanding the use of oneshot runit services using pause. Please consider using rc.local and rc.shutdown for these use cases.

@abenson
Copy link
Contributor

abenson commented Jul 11, 2019

There are valid arguments against expanding the use of oneshot runit services using pause.

I've considered we need a /etc/oneshot directory type thing for packages that need a oneshot, and similarly enable them in something like /var/oneshot. Or something. I'm not sure what's best.

@mamins1376
Copy link
Contributor Author

@CameronNemo: Originally I was using the solution you mentioned. Then I saw alsa-util's and found that pretty clever, with the added bonus of having the store and restore in one directory.

Is there any doc's indicating the downsides? Why this is not applied to ALSA?

@CameronNemo
Copy link
Contributor

Lots of services like alsa, iptables, ufw, etc used the mechanism you have here. At first glance it is fairly clever, but it is weak for a couple reasons:

  • no way to tell if or when the task has actually completed
  • two useless processes hanging around (memory and clutter concerns)

Indeed having the boot/shutdown task in the same place is a nice quality of this mechanism. Hopefully we can maintain that while solving the above problems. It will require additions to void-runit.

@mamins1376
Copy link
Contributor Author

Based on @abenson's suggestion; /etc/rc.local:

for f in /var/oneshot/*/start; do
    [ -x $f ] && $f;
done

And a similar one with /var/oneshot/*/stop; So that packages can add their own hooks and even do some sort of dependency satisfaction through number prefixes.
This is kind of borrowed from /etc/X11/xinit/xinitrc.

@Anachron
Copy link
Contributor

How is the progress here? @abenson

@mamins1376 mamins1376 closed this Nov 5, 2020
@mamins1376 mamins1376 deleted the brightnessctl-runit-store branch November 5, 2020 12:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants