From 0000000b2668a43404efec58a5c98044c24b06dd Mon Sep 17 00:00:00 2001 From: Hanaasagi Date: Wed, 24 Nov 2021 21:53:14 +0800 Subject: [PATCH] feat(redshift): add redshift for color temperature. --- bspwm/bspwmrc | 9 ++++++++ redshift/redshift.conf | 51 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 redshift/redshift.conf diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc index aae3f9c..6b8d60a 100644 --- a/bspwm/bspwmrc +++ b/bspwm/bspwmrc @@ -40,6 +40,15 @@ xautolock -time 10 -locker 'lock' -corners ---- -cornersize 30 & hsetroot -fill $WALLPAPER_PATH # battery checker sh $HOME/.local/bin/check-battery.sh & +# start redshift +if pgrep -x redshift > /dev/null +then + pid=$(pidof redshift) + kill $pid + # we need to wait redshift shutdown, otherwise color temperature is wrong. + while kill -0 $pid 2>/dev/null; do sleep 0.01; done +fi +redshift & # ############################################################################## # # WINDOW RULES # diff --git a/redshift/redshift.conf b/redshift/redshift.conf new file mode 100644 index 000000000..130e6e8 --- /dev/null +++ b/redshift/redshift.conf @@ -0,0 +1,51 @@ +[redshift] +; Daytime temperature +temp-day=5800 + +; Night temperature +temp-night=5000 + +; Disable or enable fading between color temperatures when Redshift starts or stops +fade=0 + +; Set the screen brightness. Default is 1.0. +brightness=1.0 + +; Screen brightness at daytime +brightness-day=0.9 + +; Screen brightness at night +brightness-night=0.7 + +; Gamma adjustment to apply (day and night) +gamma=0.9 + +; Set the location-provider: 'geoclue2', 'manual' +; type 'redshift -l list' to see possible values. +; The location provider settings are in a different section. +location-provider=manual + +; Set the adjustment-method: 'randr', 'vidmode' +; type 'redshift -m list' to see all possible values. +; 'randr' is the preferred method, 'vidmode' is an older API. +; but works in some cases when 'randr' does not. +; The adjustment method settings are in a different section. +adjustment-method=randr + +; Configuration of the location-provider: +; type 'redshift -l PROVIDER:help' to see the settings. +; ex: 'redshift -l manual:help' +; Keep in mind that longitudes west of Greenwich (e.g. the Americas) +; are negative numbers. +[manual] +lat=35.0116 +lon=135.7681 + +; Configuration of the adjustment-method +; type 'redshift -m METHOD:help' to see the settings. +; ex: 'redshift -m randr:help' +; In this example, randr is configured to adjust only screen 0. +; Note that the numbering starts from 0, so this is actually the first screen. +; If this option is not specified, Redshift will try to adjust _all_ screens. +[randr] +screen=0