From 5cdacc9abb10223a84b9a318a3136989763dfe7a Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 13 Jul 2019 04:30:18 +0200 Subject: [PATCH] [ADD] Redshift configuration The Redshift package on Arch doesn't seem to add a service file anywhere so we have to add one ourselves in our configuration directory. Geoclue doesn't seem to want to play nice with Redshift right now, so I used the manual setting to add Paris' coordinates. --- i3/.config/i3/config | 2 + install.sh | 5 ++ redshift/.config/redshift/redshift.conf | 74 +++++++++++++++++++ .../default.target.wants/redshift-gtk.service | 1 + .../.config/systemd/user/redshift-gtk.service | 11 +++ .../.config/systemd/user/redshift.service | 12 +++ 6 files changed, 105 insertions(+) create mode 100644 redshift/.config/redshift/redshift.conf create mode 120000 redshift/.config/systemd/user/default.target.wants/redshift-gtk.service create mode 100644 redshift/.config/systemd/user/redshift-gtk.service create mode 100644 redshift/.config/systemd/user/redshift.service diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 06bff96..137aa24 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -217,6 +217,8 @@ bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # Auto start system tray applets exec --no-startup-id blueman-applet exec --no-startup-id nm-applet +exec --no-startup-id /usr/lib/geoclue-2.0/demos/agent +exec --no-startup-id redshift-gtk # Set the wallpaper exec --no-startup-id feh --bg-fill ~/Pictures/wallpapers/starry-night-tree.png diff --git a/install.sh b/install.sh index 45d419e..b3238a6 100755 --- a/install.sh +++ b/install.sh @@ -8,11 +8,16 @@ stow -t ~ git stow -t ~ i3 stow -t ~ i3blocks stow -t ~ ranger +stow -t ~ redshift stow -t ~ termite stow -t ~ tridactyl stow -t ~ vim stow -t ~ zsh +# Our Redshift services needs to be symlined +systemctl --user enable redshift +systemctl --user enable redshift-gtk + if ! [ -e ~/scripts ]; then # Only create the symlink when the directory doesn't exist mkdir ~/scripts diff --git a/redshift/.config/redshift/redshift.conf b/redshift/.config/redshift/redshift.conf new file mode 100644 index 0000000..96c9513 --- /dev/null +++ b/redshift/.config/redshift/redshift.conf @@ -0,0 +1,74 @@ +; Global settings for redshift +[redshift] +; Set the day and night screen temperatures +temp-day=5700 +temp-night=2500 + +; 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=1 + +; 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=0.9 +; 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. +; FIXME: geoclue doesn't want to cooperate on my machine +location-provider=geoclue2 + +; 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] +; Paris coordinates +lat=48.853 +lon=2.349 + +; 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 + +; vim: ft=dosini cms=;%s diff --git a/redshift/.config/systemd/user/default.target.wants/redshift-gtk.service b/redshift/.config/systemd/user/default.target.wants/redshift-gtk.service new file mode 120000 index 0000000..c4041e9 --- /dev/null +++ b/redshift/.config/systemd/user/default.target.wants/redshift-gtk.service @@ -0,0 +1 @@ +/home/ambroisie/.config/systemd/user/redshift-gtk.service \ No newline at end of file diff --git a/redshift/.config/systemd/user/redshift-gtk.service b/redshift/.config/systemd/user/redshift-gtk.service new file mode 100644 index 0000000..4675ccf --- /dev/null +++ b/redshift/.config/systemd/user/redshift-gtk.service @@ -0,0 +1,11 @@ +[Unit] +Description=Redshift display colour temperature adjustment (GUI) +Documentation=http://jonls.dk/redshift/ +After=display-manager.service + +[Service] +ExecStart=@bindir@/redshift-gtk +Restart=always + +[Install] +WantedBy=default.target diff --git a/redshift/.config/systemd/user/redshift.service b/redshift/.config/systemd/user/redshift.service new file mode 100644 index 0000000..d90e217 --- /dev/null +++ b/redshift/.config/systemd/user/redshift.service @@ -0,0 +1,12 @@ +[unit] +description=redshift display colour temperature adjustment +documentation=http://jonls.dk/redshift/ +after=display-manager.service + +[service] +environment=display=:0 +execstart=/usr/bin/redshift +restart=always + +[install] +wantedby=default.target