Skip to content

Commit

Permalink
multihead fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frnsys committed Jul 12, 2017
1 parent 144a669 commit f801b4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/multihead
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ PLACE=$1
INMON=eDP1
EXMON=HDMI1

# so bspc properly picks up the primary monitor
xrandr --output $INMON --auto --primary

function restart_panel {
# Kill the panel/lemonbar and restart
pkill panel
Expand Down Expand Up @@ -44,6 +47,9 @@ elif [[ $PLACE == 'reset' ]]; then
fi

if [ ! -z "$EXNAME" ]; then
# TODO how to get non-primary monitor name?
# try getting primary mon id, then getting the next monitor

# list windows on ext mon, move them to primary mon
bspc query -N -m $EXNAME | xargs -L1 -I % bspc node % -m primary

Expand Down Expand Up @@ -79,8 +85,8 @@ bspc monitor primary -n $INMON
xrandr --output $EXMON --auto --$POSITION $INMON

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

# setup desktops on external monitor
bspc monitor $EXMON_PLACE -d   
Expand Down

0 comments on commit f801b4a

Please sign in to comment.