diff --git a/home/.local/bin/scripts/gui/bspwm/swapdesktop b/home/.local/bin/scripts/gui/bspwm/swapdesktop index c00e28d..886d53c 100755 --- a/home/.local/bin/scripts/gui/bspwm/swapdesktop +++ b/home/.local/bin/scripts/gui/bspwm/swapdesktop @@ -32,16 +32,16 @@ else # In case the active desktop on the other monitor is the desktop we will be moving # away into this monitor, we will want to focus the current desktop on the other # monitor instead. Essentially, we simply swap them in this case. - [ "$ACTIVE_OTHER" == "$SELECTED_DESKTOP" ] && ACTIVE_OTHER="$CURRENT_DESKTOP" + [ "$ACTIVE_OTHER" == "$SELECTED_DESKTOP" ] && ACTIVE_OTHER="$FOCUSED_DESKTOP" # Move currently focused desktop into the monitor where the other desktop is. # This is necessary, because BSPWM require each monitor to have at least 1 desktop, # so since we're moving a desktop away, we should first move one in, to avoid failures. # It also allows us to later bring the current desktop into focus on the other monitor. - bspc desktop "$CURRENT_DESKTOP" --to-monitor "$SELECTED_MONITOR" + bspc desktop "$FOCUSED_DESKTOP" --to-monitor "$SELECTED_MONITOR" # Now we can move the selected desktop from the other monitor onto this one. - bspc desktop "$SELECTED_DESKTOP" --to-monitor "$CURRENT_MONITOR" + bspc desktop "$SELECTED_DESKTOP" --to-monitor "$FOCUSED_MONITOR" # Ensure the previoulsy active desktop on the other monitor is active by bringing it # into focus now. If this was the desktop we moved, this will instead be the desktop