sb

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

sb_alsa (311B)


      1 # Checks alsa volume information
      2 
      3 alsa() {
      4     printf "VOL: "
      5     info="$(amixer get Master)"
      6     printf '%s' "$info" | grep -q "\[off\]" && \
      7 	    printf 'MUTED %s ' "$DELIMITER" && return 0
      8 
      9     printf '%s' "$info" | grep -o "\[[0-9]\+%\]" | sed 's/\[//;s/\]//' | tr -d '\n'
     10     printf ' %s ' "$DELIMITER"
     11 
     12 }