Skip to content

Commit

Permalink
feat(polybar): add tools bar
Browse files Browse the repository at this point in the history
Move Spotify module to leftmost monitor.
  • Loading branch information
eliasnorrby committed Jul 15, 2021
1 parent 70d1441 commit ae8c7fe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 7 additions & 1 deletion panel/polybar/config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 13 additions & 4 deletions panel/polybar/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit ae8c7fe

Please sign in to comment.