PrawnOS-nonfree/filesystem/resources/InstallResources/xfce-config/brightness/backlight_down.sh
2020-06-29 20:39:56 -07:00

12 lines
205 B
Bash
Executable File

#!/bin/bash
DEV=/sys/class/backlight/backlight
BL=$(cat $DEV/brightness)
if [ $BL -eq 0 ]; then
exit 0
fi
if [ $BL -lt 5 ]; then
BL=$((BL - 1))
else
BL=$((BL - ( BL / 4 )))
fi
echo $BL > $DEV/brightness