sb-brightness (495B)
1 #!/bin/sh 2 3 # current brightness 4 curr_brightness=$(cat /sys/class/backlight/*/brightness) 5 6 # max_brightness 7 max_brightness=$(cat /sys/class/backlight/*/max_brightness) 8 9 # brightness percentage 10 brightness_per=$((100 * curr_brightness / max_brightness)) 11 12 case $1 in 13 1) 14 ;; 15 3) 16 notify-send "💡 Brightness module" "\- Shows current brightness level ☀️." 17 ;; 18 8) 19 setsid -f "$TERMINAL" -e "$EDITOR" "$0" 20 ;; 21 esac 22 23 echo "💡 ${brightness_per}%"