From 549d1f2848255b54428d83a8b8e69d05bf994265 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Fri, 8 Oct 2021 12:27:46 +0200 Subject: [PATCH] config/redshift: update --- .config/redshift.conf | 6 ------ .config/redshift/hooks/brightness.sh | 31 ++++++++++++++++++++++++++++ .config/redshift/redshift.conf | 6 ++++++ 3 files changed, 37 insertions(+), 6 deletions(-) delete mode 100644 .config/redshift.conf create mode 100755 .config/redshift/hooks/brightness.sh create mode 100644 .config/redshift/redshift.conf diff --git a/.config/redshift.conf b/.config/redshift.conf deleted file mode 100644 index af78a16..0000000 --- a/.config/redshift.conf +++ /dev/null @@ -1,6 +0,0 @@ -[redshift] -temp-day=6400 -temp-night=3400 -brightness-day=1.0 -brightness-night=0.7 -transition=1 diff --git a/.config/redshift/hooks/brightness.sh b/.config/redshift/hooks/brightness.sh new file mode 100755 index 0000000..370b6d9 --- /dev/null +++ b/.config/redshift/hooks/brightness.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# Set brightness via xbrightness when redshift status changes +# https://wiki.archlinux.org/title/Redshift#Use_real_screen_brightness + +# Set brightness values for each status. +# Range from 1 to 100 is valid +brightness_day=100 +brightness_transition=90 +brightness_night=80 +# Set fps for smoooooth transition +fps=1000 +# Adjust this grep to filter only the backlights you want to adjust +backlights=($(xbacklight -list | grep ddcci*)) + +set_brightness() { + xbacklight -set $1 -fps $fps & +} + +if [ "$1" = period-changed ]; then + case $3 in + night) + set_brightness $brightness_night + ;; + transition) + set_brightness $brightness_transition + ;; + daytime) + set_brightness $brightness_day + ;; + esac +fi diff --git a/.config/redshift/redshift.conf b/.config/redshift/redshift.conf new file mode 100644 index 0000000..9d123ee --- /dev/null +++ b/.config/redshift/redshift.conf @@ -0,0 +1,6 @@ +[redshift] +temp-day=6400 +temp-night=3600 +brightness-day=1.0 +brightness-night=0.8 +fade=1