Skip to content

Instantly share code, notes, and snippets.

@hasufell
Created January 4, 2021 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasufell/d75ed99cdfebc08fb4472b7c4602c755 to your computer and use it in GitHub Desktop.
Save hasufell/d75ed99cdfebc08fb4472b7c4602c755 to your computer and use it in GitHub Desktop.
#!/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