eww replacement of waybar

This commit is contained in:
samantha42
2026-04-20 20:37:54 +02:00
parent a240874719
commit 52fa42698f
14 changed files with 591 additions and 119 deletions

21
eww/scripts/get-volume.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Outputs either:
# muted
# <0-100> (integer volume)
SINK=$(pactl get-default-sink 2>/dev/null)
if [[ -z "$SINK" ]]; then
echo "muted"
exit 0
fi
INFO=$(pactl get-sink-volume "$SINK" 2>/dev/null)
MUTED=$(pactl get-sink-mute "$SINK" 2>/dev/null | awk '{print $2}')
if [[ "$MUTED" == "yes" ]]; then
echo "muted"
exit 0
fi
VOL=$(echo "$INFO" | grep -oP '\d+(?=%)' | head -1)
echo "${VOL:-0}"