baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.81k stars 416 forks source link

Documentation on monitor change behaviour #1266

Open marcelmindemann opened 3 years ago

marcelmindemann commented 3 years ago

Hi, I am new to bspwm. I am using bspwm 0.9.10 on Arch. After reading the manpage top to bottom, I am still struggling to understand bspwm's behaviour when monitors are attached or unplugged. I am using a laptop with an internal screen. Sometimes I plug an external screen into the laptop. I notice the following:

  1. bspwm automatically adds a default desktop called Desktop to the new monitor. Is this configurable?
  2. It seems a monitor cannot be without at least one desktop. When I plug in my external monitor, I want to move all desktops from the internal to the external monitor. In order to do that, I have to add a temp desktop to the internal monitor before removing the monitor alltogether. This seems kinda hacky, am I going about this correctly? I am using this script, triggered by autorandr:
    
    #!/usr/bin/env bash

move_desktops() { from=$1 to=$2 bspc monitor $1 -a temp # add temp desktop so we can move the others for d in $(bspc query -m $1 -D); do bspc desktop $d --to-monitor $2; done bspc monitor $1 --remove # remove old desktop bspc desktop Desktop --remove > /dev/null # remove bspwms default Desktop }

if [ $AUTORANDR_CURRENT_PROFILE == "mobile" ]; then move_desktops DisplayPort-0 eDP elif [ $AUTORANDR_CURRENT_PROFILE == "docked" ]; then move_desktops eDP DisplayPort-0 fi


3. The setting `remove_unplugged_monitors` does nothing for me when set to `true`. When I unplug my external monitor, it is still in the output of `bspc query -M --names`, and the desktops on there are inaccessible to me until I re-plug the external screen. I suspect I misunderstand what bspwm understands as "unplugged".

I would very much appreciate it if someone could clear up my confusion or point me in the direction of documentation that I am missing.
ortango commented 3 years ago

1 & 2 as you see these are linked together. bspwm requires at least one desktop per "bspwm monitor" and the default name of that desktop is not configurable outside of the source. using bspc monitor $monitor -d $names makes this seem transparent when initializing bspwm. the way you are dealing with it is more or less the way. you could swap the first desktop with "Desktop", then move the rest to avoid using "temp", doesnt matter though.


3 remove_unplugged_monitors true: this will cause an the unplugged monitor to be removed as a bspwm monitor and the desktops will be merged. a monitor is unplugged when it is disabled via randr and physically unplugged. the physically unplugged part is not necessary if:

remove_disabled_monitors true: this will make a monitor that is disabled via randr be "unplugged" to bspwm (wired = false). (so) it only has visible effect if remove_unplugged_monitors is also true


PS merge_overlapping_monitors is another setting that can change this behavior in some situations.