From 57ac64041a03e270988896d6b80851592eb87997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Fri, 28 Feb 2020 21:31:45 +0100 Subject: [PATCH] Enhance redshift configuration --- autostart.sh | 7 ++-- dotfiles.yml | 2 ++ i3/scripts/presentation-mode | 4 +-- redshift/redshift.conf | 68 ++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 redshift/redshift.conf diff --git a/autostart.sh b/autostart.sh index ef1cf88..c2af295 100755 --- a/autostart.sh +++ b/autostart.sh @@ -89,10 +89,6 @@ schedule() { } -# redshift settings -redshift_lat_long="49.5:11" -redshift_colortemp="6000:4000" - # wallpaper config wallpaper="$LIBDIR/wallpaper/current" @@ -139,7 +135,8 @@ run nm-applet nm-applet run pasystray pasystray -run redshift redshift-gtk -b 1 -l "$redshift_lat_long" -t "$redshift_colortemp" +# redshift unit already exists +run redshift_user redshift-gtk -c ~/.config/redshift.conf if [[ "${MACHINE_HAS_KEEPASSX}" == "true" ]] ; then run keepassx keepassx --keyfile ~/.secret/main.key ~/.secret/main.kdbx diff --git a/dotfiles.yml b/dotfiles.yml index bb0fa81..d51a483 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -44,3 +44,5 @@ dotfiles: to: .zshrc.d - from: dunst/dunstrc to: .config/dunstrc + - from: redshift/redshift.conf + to: .config/redshift.conf diff --git a/i3/scripts/presentation-mode b/i3/scripts/presentation-mode index c41b735..f010095 100755 --- a/i3/scripts/presentation-mode +++ b/i3/scripts/presentation-mode @@ -10,14 +10,14 @@ is_on() { switch_on() { touch "${_status_file}" systemctl --user --no-block kill --signal SIGUSR1 dunst_user - systemctl --user --no-block stop redshift + systemctl --user --no-block stop redshift_user systemctl --user --no-block stop spotify } switch_off() { rm -f "${_status_file}" systemctl --user --no-block kill --signal SIGUSR2 dunst_user - "$_autostart" redshift spotify + "$_autostart" redshift_user spotify } diff --git a/redshift/redshift.conf b/redshift/redshift.conf new file mode 100644 index 0000000..0f67707 --- /dev/null +++ b/redshift/redshift.conf @@ -0,0 +1,68 @@ +[redshift] +temp-day=6000 +temp-night=4000 + +; Disable the smooth fade between temperatures when Redshift starts and stops. +; 0 will cause an immediate change between screen temperatures. +; 1 will gradually apply the new screen temperature over a couple of seconds. +fade=0 + +; Solar elevation thresholds. +; By default, Redshift will use the current elevation of the sun to determine +; whether it is daytime, night or in transition (dawn/dusk). When the sun is +; above the degrees specified with elevation-high it is considered daytime and +; below elevation-low it is considered night. +;elevation-high=3 +;elevation-low=-6 + +; Custom dawn/dusk intervals. +; Instead of using the solar elevation, the time intervals of dawn and dusk +; can be specified manually. The times must be specified as HH:MM in 24-hour +; format. +;dawn-time=6:00-7:45 +;dusk-time=18:35-20:15 + +; Set the screen brightness. Default is 1.0. +brightness=1.0 +; It is also possible to use different settings for day and night +; since version 1.8. +;brightness-day=0.7 +;brightness-night=0.4 +; Set the screen gamma (for all colors, or each color channel +; individually) +; gamma=0.8 +;gamma=0.8:0.7:0.8 +; This can also be set individually for day and night since +; version 1.10. +;gamma-day=0.8:0.7:0.8 +;gamma-night=0.6 + +; 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=49.5 +lon=11 + +; 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