From 4884360964f6bac7e4811c22cbbb43f3bfc77a9a Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Tue, 30 Dec 2025 20:02:15 -0800 Subject: polybar: mic mute display --- .../home/desktop/components/polybar/default.nix | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/home/desktop/components/polybar/default.nix b/modules/home/desktop/components/polybar/default.nix index 468aacd..2743755 100644 --- a/modules/home/desktop/components/polybar/default.nix +++ b/modules/home/desktop/components/polybar/default.nix @@ -66,7 +66,7 @@ in { modules = { left = "stat music anki"; center = "i3"; - right = "wlan eth filesystem keyboard xkeyboard pulseaudio date"; + right = "wlan eth filesystem keyboard xkeyboard microphone pulseaudio date"; }; }; @@ -221,6 +221,32 @@ in { }; }; + "module/microphone" = { + type = "custom/script"; + + exec = pkgs.writeShellScript "get-microphone-status" '' + function update { + while read -r _; do + state="$(pactl get-source-mute @DEFAULT_SOURCE@)" + if [[ $state == 'Mute: yes' ]]; then + printf '󰍭\n' + else + printf '\n' + fi + done + } + + echo 'dummy' | update + pactl subscribe | grep --line-buffered -F 'source' | update + ''; + + tail = true; + + format = { + foreground = "#${c.bg3}"; + }; + }; + "module/xkeyboard" = { type = "internal/xkeyboard"; blacklist = [ "num lock" ]; -- cgit v1.2.3