Tweak polybar start script so bar on primary screen starts first

This commit is contained in:
Erwin Boskma 2023-02-17 11:54:06 +01:00
parent 593b575ccb
commit 9a1b302712
Signed by: erwin
SSH key fingerprint: SHA256:Vw4O4qA0i5x65Y7yyjDpWDCSMSXAhqT4X7cJ3frdnLY

View file

@ -83,9 +83,13 @@ in
${pkgs.polybar}/bin/polybar-msg cmd quit ${pkgs.polybar}/bin/polybar-msg cmd quit
while ${pkgs.procps}/bin/pgrep -u ''${UID} -x polybar > /dev/null; do sleep 0.1; done 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) 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 for m in ''${outputs}; do
MONITOR=''${m} polybar -q main & disown MONITOR=''${m} polybar -q main & disown
done done