From 1fa5e4f368e7514ce84c605efb30aefc952e7f73 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Sat, 15 Jun 2024 23:29:10 -0700 Subject: Replace window title with song on bar --- home/polybar.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/home/polybar.nix b/home/polybar.nix index bc7f0db..bc3211a 100644 --- a/home/polybar.nix +++ b/home/polybar.nix @@ -56,7 +56,7 @@ module.margin = 1; modules = { - left = "cpu memory xwindow"; + left = "cpu memory music"; center = "i3"; right = "wlan eth filesystem keyboard xkeyboard pulseaudio date"; }; @@ -66,7 +66,6 @@ type = "custom/script"; exec = "if [[ $(fcitx5-remote -n) == 'mozc' ]]; then printf 'jp'; else printf 'en'; fi"; - interval = 1; click.left = "${pkgs.fcitx5}/bin/fcitx5-remote -t"; @@ -79,6 +78,20 @@ }; }; + "module/music" = { + type = "custom/script"; + + exec = "playerctl --player=cmus,firefox,%any -F metadata --format='{{title}} - {{artist}}'"; + tail = true; + + format = { + prefix = { + text = "󰎄 "; + foreground = "#${c.accent}"; + }; + }; + }; + "module/i3" = { type = "internal/i3"; -- cgit v1.2.3