gh0stzk / dotfiles

BSPWM environment with 18 themes. With a theme selector to change on the fly.
GNU General Public License v3.0
2.97k stars 220 forks source link

Dual Monitor setup not playing nice with polybar. #8

Closed hexlocation closed 2 years ago

hexlocation commented 2 years ago

Hey, tried your rice. When using any rice, polybar only shows up on one monitor. Any fix for this? Love your work btw

gh0stzk commented 2 years ago

Yes is possible, unfortunately I only have one monitor and what I do is created and tested for me on my hardware. But these links may help u.

https://github.com/polybar/polybar/wiki/Configuration#bar-settings https://github.com/polybar/polybar/issues/763

hexlocation commented 2 years ago

Cool! I made an launch_poly script in the scripts folder, containing this: polydir="$HOME/.config/bspwm/rices/emilia/polybar" if type "xrandr"; then for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do MONITOR=$m polybar --reload emi-bar -c ${polydir}/config.ini & done else polybar --reload emi-bar -c ${polydir}/config.ini & fi

Then i did chmod +x launch_poly.sh and changed `function SetGirlFriendRice() {

case $RICETHEME in

    emilia)

      SetBspwmConf 0 60 5 "#202132" "#202132" "#202132" "#070219" 5 5

      killeww
      launch polybar -q emi-bar -c ${polydir}/config.ini <-------
      launch dunst -config ${bspdir}/dunstrc-dark &

      ;;`

to `function SetGirlFriendRice() {

    case $RICETHEME in

            emilia)

              SetBspwmConf 0 60 5 "#202132" "#202132" "#202132" "#070219" 5 5

              killeww
              launch launch_poly.sh
              launch dunst -config ${bspdir}/dunstrc-dark &

              ;;

`, Only issue is that the bar on both monitors only show the workspaces for my primary monitor. Doesn't matter tho, workspace 8 and 9 still work on my second monitor.

gh0stzk commented 2 years ago

Ok there are some thing you need to change. in bspwmrc there is this code:

workspaces() { name=1 for monitor inbspc query -M; do bspc monitor ${monitor} -n "$name" -d '1' '2' '3' '4' '5' '6' let name++ done }

You need to adapt it for 2 monitors or just delete and do:

`bspc monitor LVDS1 -d 1 2 3 4 5

bspc monitor VGA1 -d 6 7 8 9`

then in polybar.ini create another bar for the second monitor;

`[bar/top] bottom = false monitor = LVDS1

modules-left = bspwm mpd modules-right = keyboard battery backlight temperature volume datetime powermenu

[bar/top_external] bottom = false monitor = VGA1

modules-left = bspwm mpd modules-right = keyboard volume datetime powermenu`

this links have some scripts may help you: https://protesilaos.com/codelog/multihead-bspwm-polybar/ https://miikanissi.com/blog/hotplug-dual-monitor-setup-bspwm/ https://www.reddit.com/r/bspwm/comments/iv6d3r/how_to_add_dual_polybars_on_two_monitors/

kvlx-alt commented 1 year ago

Ok there are some thing you need to change. in bspwmrc there is this code:

workspaces() { name=1 for monitor inbspc query -M; do bspc monitor ${monitor} -n "$name" -d '1' '2' '3' '4' '5' '6' let name++ done }

You need to adapt it for 2 monitors or just delete and do:

`bspc monitor LVDS1 -d 1 2 3 4 5

bspc monitor VGA1 -d 6 7 8 9`

then in polybar.ini create another bar for the second monitor;

`[bar/top] bottom = false monitor = LVDS1

modules-left = bspwm mpd modules-right = keyboard battery backlight temperature volume datetime powermenu

[bar/top_external] bottom = false monitor = VGA1

modules-left = bspwm mpd modules-right = keyboard volume datetime powermenu`

this links have some scripts may help you: https://protesilaos.com/codelog/multihead-bspwm-polybar/ https://miikanissi.com/blog/hotplug-dual-monitor-setup-bspwm/ https://www.reddit.com/r/bspwm/comments/iv6d3r/how_to_add_dual_polybars_on_two_monitors/

in Z0mbi3 the polybar.ini is polybar_tray.ini?