neodotfiles/user/.config/suckless/dwmblocks/scripts/block_volume
2023-05-26 02:32:03 -04:00

14 lines
342 B
Bash
Executable file

#!/bin/bash
# Prints the current volume or 🔇 if muted.
[ "$(pamixer --get-mute)" = true ] && echo "󰕿x" && exit
vol="$(pamixer --get-volume)"
if [ "$vol" -gt "50" ]; then
icon="󰕾"
elif [ "$vol" -gt "10" ]; then
icon="󰖀"
elif [ "$vol" -gt "0" ]; then
icon="󰕿"
else
echo "󰕿x" && exit
fi
echo -e " $icon $vol% "