- #!/bin/sh
-
- speaker_muted=🔇
- speaker_low=🔈
- speaker_medium=🔉
- speaker_high=🔊
- brightness_symbol=🔅
- # Statusbar loop
- while true; do
- volume=$(amixer sget Master | awk -F"[][]" 'END{ print $2 }')
- volume_amount=$(printf $volume | tr -d %)
- if [ $volume_amount = 0 ]; then
- volume_symbol=$speaker_muted
- elif [ $volume_amount -lt 30 ]; then
- volume_symbol=$speaker_low
- elif [ $volume_amount -lt 70 ]; then
- volume_symbol=$speaker_medium
- else
- volume_symbol=$speaker_high
- fi
-
- xsetroot -name "$volume_symbol$volume | $(date +"%c")"
- sleep 1m # Update time every minute
- done
|