sb

shitty bar for dwm
git clone git://git.ckyln.com/~cem/sb.git
Log | Files | Refs | README | LICENSE

sb_brightness (307B)


      1 # Gets brightness level and prints to stdout
      2 
      3 brightness() {
      4     for bl in /sys/class/backlight/* ; do
      5         [ -d "$bl" ] || return 1
      6         read -r cur < "$bl/brightness" ; read -r max < "$bl/max_brightness"
      7         per="$(( cur * 100 / max ))"
      8     done
      9     printf 'BRI: %s%% %s ' "$per" "$DELIMETER"
     10 }