I wrote a small script to increase or decrease the brightness with a single command. This is handy in case one would increase or decrease the brightness by making use of a keypress bind.
#!/bin/sh
#
#afronden op hele getallen
brightness=$(printf "%.0f\n" $(sudo asdbctl get | awk '{print $5}' | awk '{ print $1/600 }'))
echo "current brightness is" $brightness
if [[ $1 == "up" ]]; then
case 1 in
$(($brightness <= 8)))((brightness+=2)); sudo asdbctl set $brightness; echo "1";;
$(($brightness > 8 && $brightness < 20)))brightness=20; sudo asdbctl set $brightness; echo "2";;
$(($brightness >= 20 && $brightness < 80)))((brightness+=20)); sudo asdbctl set $brightness; echo "3";;
$(($brightness >= 80)))brightness=100; sudo asdbctl set $brightness; echo "3";;
*)echo "error";;
esac
elif [[ $1 == "down" ]]; then
case 1 in
$(($brightness > 20 )))((brightness-=20)); sudo asdbctl set $brightness;;
$(($brightness > 10 && $brightness <= 20)))brightness=10; sudo asdbctl set $brightness;;
$(($brightness > 2 && $brightness <=10 )))((brightness-=2)); sudo asdbctl set $brightness;;
$(($brightness <= 2 )))brightness=0; sudo asdbctl set $brightness;;
*)echo "error";;
esac
else
echo "no valid input given (up / down). halt."
exit 1
fi
dunstify --appname=asdbctl -r 345678 "Set brightness to $brightness"
echo "setting to" $brightness
I wrote a small script to increase or decrease the brightness with a single command. This is handy in case one would increase or decrease the brightness by making use of a keypress bind.
Usage: To increase brightness:
./script.sh up
To decease brightness:
./script.sh down