Skip to content

Commit f801b4a

Browse files
committed
multihead fixes
1 parent 144a669 commit f801b4a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bin/multihead

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ PLACE=$1
55
INMON=eDP1
66
EXMON=HDMI1
77

8+
# so bspc properly picks up the primary monitor
9+
xrandr --output $INMON --auto --primary
10+
811
function restart_panel {
912
# Kill the panel/lemonbar and restart
1013
pkill panel
@@ -44,6 +47,9 @@ elif [[ $PLACE == 'reset' ]]; then
4447
fi
4548

4649
if [ ! -z "$EXNAME" ]; then
50+
# TODO how to get non-primary monitor name?
51+
# try getting primary mon id, then getting the next monitor
52+
4753
# list windows on ext mon, move them to primary mon
4854
bspc query -N -m $EXNAME | xargs -L1 -I % bspc node % -m primary
4955

@@ -79,8 +85,8 @@ bspc monitor primary -n $INMON
7985
xrandr --output $EXMON --auto --$POSITION $INMON
8086

8187
# rename each monitor so sxhkd can use it with bspwm to move focus/windows/desktops across monitors
82-
bspc monitor $EXMON -n $EXMON_PLACE
83-
bspc monitor $INMON -n $INMON_PLACE
88+
bspc monitor $(bspc query -M -m primary --names) -n $INMON_PLACE
89+
bspc monitor $(bspc query -M -m primary#next --names) -n $EXMON_PLACE
8490

8591
# setup desktops on external monitor
8692
bspc monitor $EXMON_PLACE -d   

0 commit comments

Comments
 (0)