diff --git a/.config/waybar/config b/.config/waybar/config index 2d2d7a5..b52f704 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -82,9 +82,10 @@ }, "custom/micmute": { - "exec": "bash -c 'wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -q MUTED && echo \"\" || echo \"\"'", - "interval": 1, + "exec": "~/.config/waybar/scripts/micmute.sh", + "interval": 0, "tooltip": true, + "min-length": 2, "on-click": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" } } diff --git a/.config/waybar/scripts/micmute.sh b/.config/waybar/scripts/micmute.sh new file mode 100755 index 0000000..2693e7a --- /dev/null +++ b/.config/waybar/scripts/micmute.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +print_icon() { + if wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -q MUTED; then + echo "" + else + echo "" + fi +} + +# Print once on startup +print_icon + +# Subscribe to PipeWire events +wpctl subscribe @DEFAULT_AUDIO_SOURCE@ | while read -r _; do + print_icon +done + diff --git a/.config/waybar/style.css b/.config/waybar/style.css index f20f0f0..c446dd6 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -5,7 +5,7 @@ /* --- Global Styles --- */ * { - font-family: 'SF Pro Text', 'Inter', 'Segoe UI, NotoSans Nerd Font', sans-serif; + font-family: "JetBrainsMono Nerd Font Propo"; font-size: 14px; min-height: 25px; padding-right: 0px; @@ -89,7 +89,8 @@ #custom-power:hover, #pulseaudio:hover, #battery:hover, -#tray:hover { +#tray:hover, +#custom-micmute:hover { background-color: @Buttonshover; } @@ -107,17 +108,11 @@ background-color: @Buttons; color: @Text; border-radius: 10px; - padding: 0.5rem; - margin: 5px; + padding: 0.7rem; + margin: 0.35rem; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; } -#pulseaudio { - background-color: @Buttons; - color: @Text; - padding-right: 1rem; -} - #battery { color: @Text;