From ba8131a51bbedf7e9d432132c606c3b5cda9a0c6 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 23 Nov 2019 18:44:13 +0100 Subject: [PATCH] forgot to include this file in earlier commits --- .local/bin/polybar-launch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 .local/bin/polybar-launch diff --git a/.local/bin/polybar-launch b/.local/bin/polybar-launch new file mode 100755 index 0000000..42d7330 --- /dev/null +++ b/.local/bin/polybar-launch @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +killall -q polybar + +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + +if type "xrandr"; then + for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar --reload top & + MONITOR=$m polybar --reload bottom & + done +else + polybar --reload top & + polybar --reload bottom & +fi + +notify-send "Polybar restarted!" -a "polybar-launch"