dotfiles/config/redshift/hooks/brightness.sh
2017-12-15 21:56:55 -05:00

27 lines
484 B
Bash
Executable File

#!/bin/sh
main() {
: "${BRIGHTNESS_DAY:=100}"
: "${BRIGHTNESS_TRANSITION:=50}"
: "${BRIGHTNESS_NIGHT:=20}"
: "${FADE_TIME:=60000}"
if [[ "${1}" != period-changed ]]; then
return
fi
case "${3}" in
night)
xbacklight -set "${BRIGHTNESS_NIGHT}" -time "${FADE_TIME}"
;;
transition)
xbacklight -set "${BRIGHTNESS_TRANSITION}" -time "${FADE_TIME}"
;;
daytime)
xbacklight -set "${BRIGHTNESS_DAY}" -time "${FADE_TIME}"
;;
esac
}
main "$@"