Inverts and/or lowers the color temperature of the screen(s) on a schedule, for a more pleasant experience at night
Usage:
-- make a windowfilterDisable for redshift: VLC, Photos and screensaver/login window will disable color adjustment and inversion
local wfRedshift=hs.window.filter.new({VLC={focused=true},Photos={focused=true},loginwindow={visible=true,allowRoles='*'}},'wf-redshift')
-- start redshift: 2800K + inverted from 21 to 7, very long transition duration (19->23 and 5->9)
hs.redshift.start(2800,'21:00','7:00','4h',true,wfRedshift)
-- allow manual control of inverted colors
hs.hotkey.bind(HYPER,'f1','Invert',hs.redshift.toggleInvert)
Note:
hs.redshift
will see significant future development.Signature | hs.redshift.COLORRAMP |
---|---|
Type | Variable |
Description | A table holding the gamma values for given color temperatures; each key must be a color temperature number in K (useful values are between |
Notes |
|
Source | extensions/redshift/redshift.lua line 342 |
Signature | hs.redshift.invertSubscribe([id,]fn) |
---|---|
Type | Function |
Description | Subscribes a callback to be notified when the color inversion status changes |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/redshift/redshift.lua line 107 |
Signature | hs.redshift.invertUnsubscribe(id) |
---|---|
Type | Function |
Description | Unsubscribes a previously subscribed color inversion change callback |
Parameters |
|
Returns |
|
Source | extensions/redshift/redshift.lua line 128 |
Signature | hs.redshift.isInverted() -> string or false |
---|---|
Type | Function |
Description | Checks if the colors are currently inverted |
Parameters |
|
Returns |
|
Source | extensions/redshift/redshift.lua line 144 |
Signature | hs.redshift.requestInvert(id,v) |
---|---|
Type | Function |
Description | Sets or clears a request for color inversion |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/redshift/redshift.lua line 161 |
Signature | hs.redshift.start(colorTemp,nightStart,nightEnd[,transition[,invertAtNight[,windowfilterDisable[,dayColorTemp]]]]) |
---|---|
Type | Function |
Description | Sets the schedule and (re)starts the module |
Parameters |
|
Returns |
|
Source | extensions/redshift/redshift.lua line 273 |
Signature | hs.redshift.stop() |
---|---|
Type | Function |
Description | Stops the module and disables color adjustment and color inversion |
Parameters |
|
Returns |
|
Source | extensions/redshift/redshift.lua line 243 |
Signature | hs.redshift.toggle([v]) |
---|---|
Type | Function |
Description | Sets or clears the user override for color temperature adjustment. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/redshift/redshift.lua line 218 |
Signature | hs.redshift.toggleInvert([v]) |
---|---|
Type | Function |
Description | Sets or clears the user override for color inversion. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/redshift/redshift.lua line 195 |