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

run hooks on startup/exit, enable/disable #335

Closed
ghost opened this issue Apr 18, 2016 · 6 comments
Closed

run hooks on startup/exit, enable/disable #335

ghost opened this issue Apr 18, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2016

currently, hooks are only executed when the period changes, eg transition>night, etc.
it would be nice if the hooks are also executed when redshift starts

Example use case:

  • the brightness hook sets brightness to 10% at night, this setting is stored
  • laptop shuts down
  • next day during day time, laptop starts, redshift starts, but brightness is still set to 10%, because no hook was executed on startup of redshift

If hooks are executed at startup, redshift does not know about the previous period, so 'none' would be an acceptable value.

@infernix
Copy link

infernix commented Dec 2, 2016

In addition to startup, a hook when enabling/disabling (SIGUSR1) and a hook at exit would also be great. This way the display brightness hooks I'm using can be accurately correlated with the redshift of the screen.

@jonls
Copy link
Owner

jonls commented Jan 8, 2017

Thanks, those are great suggestions! I would definitely merge a pull request with these additions.

@danielkza
Copy link

Hooks seem to run correctly for me, transitioning from "none" to "night" or "daytime" immediately when I start redshift.

@jonls
Copy link
Owner

jonls commented Oct 12, 2017

It seems that Redshift correctly runs hooks on start and exit. The only thing not implemented is the hook when enabling/disabling as suggested by @infernix.

@jonls jonls changed the title run hooks on startup run hooks on startup/exit, enable/disable Oct 12, 2017
@mwstobo
Copy link
Contributor

mwstobo commented Oct 30, 2017

I can take a quick look at this one. When redshift is disabled, should the hooks be called with a new "Disabled" state, or should be just use the existing None state? I feel like it would be nice to have the semantic difference between the two, for maximum flexibility.

@infernix
Copy link

@mwstobo None is fine i think. None signifies redshift is not doing anything, which is the case both when exiting and when it's disabled. I can't come up with a use case where you'd want to do something different between exiting redfish and disabling redfish.

@jonls jonls closed this as completed in a4d89c7 Dec 13, 2017
jonls added a commit that referenced this issue Dec 13, 2017
Fix #335: Set period to none when disabled
peterhoeg pushed a commit to peterhoeg/redshift that referenced this issue Jan 2, 2018
This allows for hooks to be run when redshift is disabled
@yannickperrenet yannickperrenet mentioned this issue Nov 6, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants