aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-07-14 14:36:22 +0300
committerJoursoir <chat@joursoir.net>2022-07-14 14:36:22 +0300
commitfe4bfa62a9042f0ee907975552cc2e2e86628fb1 (patch)
tree756f6b13bda77a0ca2021ee17e4f0b92563b2a58
parent53a18012935cf70652aa8925afe7d69c6091ad23 (diff)
downloaddotfiles-fe4bfa62a9042f0ee907975552cc2e2e86628fb1.tar.gz
dotfiles-fe4bfa62a9042f0ee907975552cc2e2e86628fb1.tar.bz2
dotfiles-fe4bfa62a9042f0ee907975552cc2e2e86628fb1.zip
dotconfig/polybar: provide list of available outputs
-rw-r--r--dotconfig/polybar/config2
-rwxr-xr-xdotconfig/polybar/launch.sh4
2 files changed, 4 insertions, 2 deletions
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..."