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/init.lua |
| 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/init.lua |
| Signature | hs.redshift.invertUnsubscribe(id) |
|---|---|
| Type | Function |
| Description | Unsubscribes a previously subscribed color inversion change callback |
| Parameters |
|
| Returns |
|
| Source | extensions/redshift/init.lua |
| Signature | hs.redshift.isInverted() -> string or false |
|---|---|
| Type | Function |
| Description | Checks if the colors are currently inverted |
| Parameters |
|
| Returns |
|
| Source | extensions/redshift/init.lua |
| Signature | hs.redshift.requestInvert(id,v) |
|---|---|
| Type | Function |
| Description | Sets or clears a request for color inversion |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/redshift/init.lua |
| 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/init.lua |
| Signature | hs.redshift.stop() |
|---|---|
| Type | Function |
| Description | Stops the module and disables color adjustment and color inversion |
| Parameters |
|
| Returns |
|
| Source | extensions/redshift/init.lua |
| Signature | hs.redshift.toggle([v]) |
|---|---|
| Type | Function |
| Description | Sets or clears the user override for color temperature adjustment. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/redshift/init.lua |
| Signature | hs.redshift.toggleInvert([v]) |
|---|---|
| Type | Function |
| Description | Sets or clears the user override for color inversion. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/redshift/init.lua |