From b9d295d45cb700fdf8bd13e82c989d99f3b49a98 Mon Sep 17 00:00:00 2001 From: Vlad Doster Date: Sat, 4 Jan 2020 23:57:26 -0500 Subject: [PATCH] Made polybar more extensible --- .config/polybar/config | 2 +- .local/bin/launch_polybar | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.config/polybar/config b/.config/polybar/config index 78e78d42..38af3a9a 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -21,7 +21,7 @@ background = #1d2021 foreground = #ebdbb2 [bar/main] -monitor = ${env:MONITOR:eDP-1-1} +monitor = ${env:MONITOR:} enable-ipc = true width = 100% height = 20 diff --git a/.local/bin/launch_polybar b/.local/bin/launch_polybar index ccd8158b..20b1029a 100755 --- a/.local/bin/launch_polybar +++ b/.local/bin/launch_polybar @@ -3,6 +3,12 @@ # Terminate already running bar instances killall -q polybar -for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar main & done +if type "xrandr"; then + for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar --reload main & + done +else + polybar --reload main & +fi echo "Bars launched..."