aboutsummaryrefslogtreecommitdiff
path: root/modules/home
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2025-12-30 20:02:15 -0800
committerCaroline Larimore <caroline@larimo.re>2025-12-30 20:02:15 -0800
commit4884360964f6bac7e4811c22cbbb43f3bfc77a9a (patch)
tree9976201aa94ea5b3ebe12b653e1d0a2a6fe816ca /modules/home
parente4bc6a8538f8350b745e95440d74a5853ff8db3b (diff)
polybar: mic mute display
Diffstat (limited to 'modules/home')
-rw-r--r--modules/home/desktop/components/polybar/default.nix28
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" ];