updated waybar for laptop

This commit is contained in:
2025-09-19 18:25:11 +02:00
parent ce2eb2dd79
commit 80b3f7e68b
7 changed files with 91 additions and 7 deletions

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Prints JSON for Waybar showing mic muted/unmuted
set -euo pipefail
is_muted=$(wpctl get-mute @DEFAULT_AUDIO_SOURCE@ | awk '{print $2}')
vol=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | awk '{printf("%.0f", $2*100)}' || echo 0)
if [[ "$is_muted" == "true" ]]; then
echo '{"text":"","tooltip":"Mic: muted","class":"muted"}'
else
echo "{\"text\":\" ${vol}%\",\"tooltip\":\"Mic: ${vol}%\",\"class\":\"live\"}"
fi