scripts/i3-configuration/i3blocks/volume.sh

21 lines
453 B
Bash
Raw Normal View History

2024-11-16 17:16:26 +01:00
2024-11-15 11:59:05 +01:00
#!/bin/bash
# Get the current volume level and mute status
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | awk '{print $5}' | tr -d '%')
mute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')
# Determine icon and color based on mute status
if [ "$mute" = "yes" ]; then
icon="🔇" # Muted
else
icon="🔊" # Volume icon
color="#50FA7B" # Green
fi
# Output the volume with icon and color
echo "$icon $volume%"
echo
echo $color