Created
January 4, 2021 02:37
-
-
Save hasufell/d75ed99cdfebc08fb4472b7c4602c755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Set brightness values for each status. | |
# Range from 1 to 100 is valid | |
brightness_day=90 | |
brightness_transition=70 | |
brightness_night=50 | |
# Set fps for smoooooth transition | |
fps=1000 | |
set_brightness() { | |
xbacklight -set $1 & | |
} | |
set_theme() { | |
xfconf-query -c xsettings -p /Net/ThemeName -s $1 & | |
} | |
if [ "$1" = period-changed ]; then | |
case $3 in | |
night) | |
set_brightness $brightness_night | |
set_theme "Adwaita-dark" | |
;; | |
transition) | |
set_brightness $brightness_transition | |
set_theme "Adwaita-dark" | |
;; | |
daytime) | |
set_brightness $brightness_day | |
set_theme "Adwaita" | |
;; | |
esac | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment