123456789101112131415161718192021 |
- #!/bin/sh
- # script to increase the display brightness by $1%
- [ -z "$1" ] && echo "Error: please give percent as argument" && exit 1
- #xbacklight -inc "$1"
- #exit
- device=$(brightnessctl -l | grep "class 'backlight'" | tail -n +3 | awk '{print $2}' | tr -d "'")
- if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'intel_backlight'"; then
- device="intel_backlight"
- fi
- brightness=$(brightnessctl -d "${device}" | grep Current | awk -F '[)(]' "{print \$2 + $1}")
- if [ "$(cat .config/norisa/brightness-state)" -eq "100" ]; then
- exit 1
- else
- brightnessctl -d "${device}" set "$brightness"%
- fi
|