Fix bspc/focus skipping over windows
Lets say you have two screens. A, B, C and D are your windows: [AB][CD] If you have C focused and invoked bspc/focus --west, it would focus A, instead of B.
This commit is contained in:
parent
bb81acfb00
commit
eec332814a
|
@ -18,8 +18,13 @@ if [[ $1 == -m ]]; then
|
||||||
leap=1; shift
|
leap=1; shift
|
||||||
fi
|
fi
|
||||||
dir=$1
|
dir=$1
|
||||||
|
opposite=
|
||||||
|
|
||||||
case $dir in west|south|north|east) ;;
|
case $dir in
|
||||||
|
west) opposite=east ;;
|
||||||
|
east) opposite=west ;;
|
||||||
|
north) opposite=north ;;
|
||||||
|
south) opposite=south ;;
|
||||||
*) >&2 echo "Not a valid direction: $dir"
|
*) >&2 echo "Not a valid direction: $dir"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
@ -32,6 +37,8 @@ else
|
||||||
if ! bspc node -f "$dir.local"; then
|
if ! bspc node -f "$dir.local"; then
|
||||||
if [[ $(bspc query -M -m "$dir") ]]; then
|
if [[ $(bspc query -M -m "$dir") ]]; then
|
||||||
bspc monitor -f "$dir"
|
bspc monitor -f "$dir"
|
||||||
|
# Ensure we start at the edge of the window we arrived from
|
||||||
|
while bspc node -f "$opposite.local"; do :; done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue