swaydots

my dotfiles
git clone https://git.awy.one/swaydots.git
Log | Files | Refs | README | LICENSE

sb-brightness (480B)


      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 $BLOCK_BUTTON 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}%"