diff --git a/.config/polybar/config b/.config/polybar/config index 78e78d42..1899b86f 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 @@ -130,6 +130,8 @@ format = index-sort = true wrapping-scroll = false +pin-workspaces = true + label-mode-padding = 1 label-mode-foreground = ${colors.white} label-mode-background = ${colors.darkyellow} 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..."