diff options
Diffstat (limited to 'nixos/scripts/get-volume')
-rwxr-xr-x | nixos/scripts/get-volume | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/scripts/get-volume b/nixos/scripts/get-volume new file mode 100755 index 0000000..4a9d510 --- /dev/null +++ b/nixos/scripts/get-volume @@ -0,0 +1,22 @@ +#!/bin/sh +# Dependencies: pactl, awk + +volume=$(pactl list sinks | awk '/^\s+Volume:/ {print $5}' | head -n 1 | tr -d '%') +muted=$(pactl list sinks | awk '/^\s+Mute:/ {print $2}' | head -n 1) + +if [ "$muted" = "yes" ]; then + icon="" +else + if [ "$volume" -le 20 ]; then + icon="" + elif [ "$volume" -le 50 ]; then + icon="" + elif [ "$volume" -le 100 ]; then + icon="" + else + icon="" + fi +fi + +echo "$icon $volume%" + |