diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/home/desktop/components/polybar/default.nix | 28 |
1 files changed, 27 insertions, 1 deletions
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" ]; |