From fe4bfa62a9042f0ee907975552cc2e2e86628fb1 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Thu, 14 Jul 2022 14:36:22 +0300 Subject: dotconfig/polybar: provide list of available outputs --- dotconfig/polybar/config | 2 +- dotconfig/polybar/launch.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'dotconfig/polybar') diff --git a/dotconfig/polybar/config b/dotconfig/polybar/config index 6010c5c..9ad7de1 100644 --- a/dotconfig/polybar/config +++ b/dotconfig/polybar/config @@ -35,7 +35,7 @@ include-file = ~/.config/polybar/modules ; $ polybar -M | cut -d ':' -f 1 ; $ xrandr -q | grep " connected" | cut -d ' ' -f1 ; If no monitor is given, the primary monitor is used if it exists - monitor = + monitor = ${env:MONITOR} ; Tell the Window Manager not to configure the window. ; Use this to detach the bar if your WM is locking its size/position. diff --git a/dotconfig/polybar/launch.sh b/dotconfig/polybar/launch.sh index 829d7ac..f607575 100755 --- a/dotconfig/polybar/launch.sh +++ b/dotconfig/polybar/launch.sh @@ -11,5 +11,7 @@ NETWORK_TYPE="wired" # or `wireless` # Launch the bar echo "---" | tee -a /tmp/mypolybar.log -NETWORK_TYPE=$NETWORK_TYPE polybar main >> /tmp/mypolybar.log 2>&1 & disown +for m in $(polybar --list-monitors | cut -d":" -f1); do + MONITOR=$m NETWORK_TYPE=$NETWORK_TYPE polybar main >> /tmp/mypolybar.log 2>&1 & disown +done echo "Bar launched..." -- cgit v1.2.3-18-g5258