diff --git a/panel/polybar/config b/panel/polybar/config index 2caea1b0..166cb5d3 100644 --- a/panel/polybar/config +++ b/panel/polybar/config @@ -77,7 +77,7 @@ inherit = bar/base modules-left = bspwm task modules-center = github -modules-right = spotify vpn xkeyboard filesystem alsa memory cpu temperature date powermenu +modules-right = vpn xkeyboard filesystem alsa memory cpu temperature date powermenu [bar/secondary] inherit = bar/base @@ -90,6 +90,12 @@ modules-right = inherit = bar/secondary modules-center = memory-bar cpu-bar +modules-right = eth + +[bar/secondary-tools] +inherit = bar/secondary + +modules-center = spotify [module/vpn] type = custom/script diff --git a/panel/polybar/launch.sh b/panel/polybar/launch.sh index d15e1ba5..3cba500f 100755 --- a/panel/polybar/launch.sh +++ b/panel/polybar/launch.sh @@ -14,9 +14,9 @@ exclude_primary() { grep -v '(primary)' } -exclude_rightmost() { - if [ -n "$rightmost_monitor" ]; then - grep -v "$rightmost_monitor" +exclude() { + if [ -n "$1" ]; then + grep -v "$1" else cat fi @@ -34,6 +34,15 @@ if [ -n "$rightmost_monitor" ]; then launch_bar_on_monitor secondary-stats "$rightmost_monitor" fi -for monitor in $(list_monitors | exclude_primary | exclude_rightmost | monitor_name); do +leftmost_monitor=$(list_monitors | exclude_primary | head -1 | monitor_name) +if [ -n "$leftmost_monitor" ] && [ "$leftmost_monitor" != "$rightmost_monitor" ]; then + launch_bar_on_monitor secondary-tools "$leftmost_monitor" +fi + +for monitor in $(list_monitors \ + | exclude_primary \ + | exclude "$rightmost_monitor" \ + | exclude "$leftmost_monitor" \ + | monitor_name); do launch_bar_on_monitor secondary "$monitor" done