bspwm icon indicating copy to clipboard operation
bspwm copied to clipboard

`bspc config remove_unplugged_monitors true` resets the monitor order

Open DominikRusso opened this issue 3 years ago • 6 comments

If bspc wm -O <monitors> is run before bspc config remove_unplugged_monitors true it has no effect. Since this isn't documented in the manual I'm assuming it's a bug.

Config where bspc wm -O <monitors> doesn't work.
#!/bin/sh

# start sxhkd
killall -q sxhkd
sxhkd &

# monitors
displayport="$(xrandr --query | grep -o "DisplayPort-. connected" | cut -d " " -f 1)"

if [ -n "$displayport" ]; then
  bspc wm -O eDP                             # <=====
  bspc monitor eDP -d 1 2 3 4 5
  bspc monitor "$displayport" -d 6 7 8
else
  bspc monitor -d 1 2 3 4 5
fi

# config
bspc config border_width                3
bspc config borderless_monocle          true
bspc config directional_focus_tightness low
bspc config gapless_monocle             true
bspc config remove_disabled_monitors    true
bspc config remove_unplugged_monitors   true # <=====
bspc config single_monocle              true
bspc config split_ratio                 0.5
bspc config window_gap                  0

# start polybar(s)
"$XDG_CONFIG_HOME/bspwm/polybar.sh" &

Config where it does work.
#!/bin/sh

# start sxhkd
killall -q sxhkd
sxhkd &

# monitors
displayport="$(xrandr --query | grep -o "DisplayPort-. connected" | cut -d " " -f 1)"

if [ -n "$displayport" ]; then
  bspc monitor eDP -d 1 2 3 4 5
  bspc monitor "$displayport" -d 6 7 8
else
  bspc monitor -d 1 2 3 4 5
fi

# config
bspc config border_width                3
bspc config borderless_monocle          true
bspc config directional_focus_tightness low
bspc config gapless_monocle             false
bspc config remove_disabled_monitors    true
bspc config remove_unplugged_monitors   true # <=====
bspc wm -O eDP                               # <=====
bspc config single_monocle              true
bspc config split_ratio                 0.5
bspc config window_gap                  0

# start polybar(s)
"$XDG_CONFIG_HOME/bspwm/polybar.sh" &

DominikRusso avatar Oct 31 '21 10:10 DominikRusso

this seems to work fine here:

$ bspc query -M --names
DVI-D-0
HDMI-0
$ bspc wm -O HDMI-0
$ bspc query -M --names
HDMI-0
DVI-D-0
$ bspc config remove_unplugged_monitors
false

what is the behavior that you are expecting and not seeing?

ortango avatar Oct 31 '21 18:10 ortango

bspc config remove_unplugged_monitors true resets the monitor order.

$ bspc query -M --names
eDP
DisplayPort-1
$ bspc config remove_unplugged_monitors true
$ bspc query -M --names
DisplayPort-1
eDP

DominikRusso avatar Oct 31 '21 19:10 DominikRusso

oh. maybe change the issue description?

seems to me that update_monitors() resets the monitor order. so any command that will call it would result in the same issue. eg setting any SET_MON_BOOL command or bspc wm -r would also reset the monitor order.

ortango avatar Oct 31 '21 22:10 ortango

As a side note, how does your bspc query returns xrandr values? Mine only shows something like 0x000...

rubanunes avatar Nov 28 '21 15:11 rubanunes

As a side note, how does your bspc query returns xrandr values? Mine only shows something like 0x000...

Add the --names flag

DominikRusso avatar Nov 28 '21 15:11 DominikRusso

Man I don't know if it was after using the xrandr command on bspwmrc but now it does show the monitor names where before was just 0x000000...

rubanunes avatar Nov 29 '21 23:11 rubanunes