diff --git a/home-manager/modules/polybar/default.nix b/home-manager/modules/polybar/default.nix index 5265c1a..902ef76 100644 --- a/home-manager/modules/polybar/default.nix +++ b/home-manager/modules/polybar/default.nix @@ -83,9 +83,13 @@ in ${pkgs.polybar}/bin/polybar-msg cmd quit while ${pkgs.procps}/bin/pgrep -u ''${UID} -x polybar > /dev/null; do sleep 0.1; done - outputs=$(${pkgs.polybar}/bin/polybar -m | ${pkgs.coreutils}/bin/cut -d ':' -f 1) + outputs=$(${pkgs.polybar}/bin/polybar -m | ${pkgs.gnugrep}/bin/grep -v primary | ${pkgs.coreutils}/bin/cut -d ':' -f 1) primary=$(${pkgs.polybar}/bin/polybar -m | ${pkgs.gnugrep}/bin/grep primary | ${pkgs.coreutils}/bin/cut -d ':' -f 1) + MONITOR=''${primary} polybar -q main & disown + + sleep 0.5 # Make sure the primary bar is started so the tray appears here + for m in ''${outputs}; do MONITOR=''${m} polybar -q main & disown done