Files
infra/dotfiles/desktop/.config/i3blocks/scripts/volume
Fabio Scotto di Santolo 34276c2de1 Minimal i3 setup
2026-03-15 22:00:35 +01:00

17 lines
367 B
Bash
Executable File

#!/bin/sh
mute=$(pactl get-sink-mute @DEFAULT_SINK@ 2>/dev/null | awk '{print $2}')
vol=$(pactl get-sink-volume @DEFAULT_SINK@ 2>/dev/null | awk '/Volume:/ {print $5; exit}')
[ -n "$vol" ] || exit 0
if [ "$mute" = "yes" ]; then
text="VOL mute"
color="#7aa2f7"
else
text="VOL $vol"
color="#c0caf5"
fi
printf '%s\n%s\n%s\n' "$text" "$text" "$color"