From 66997994dfa762532dcf52e4834281f7368f0a08 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Fri, 10 Mar 2023 18:48:59 +0100 Subject: Initial wallpaper. --- bspc/bspcDirectionFocus.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'bspc') diff --git a/bspc/bspcDirectionFocus.sh b/bspc/bspcDirectionFocus.sh index f36359b..2e76527 100755 --- a/bspc/bspcDirectionFocus.sh +++ b/bspc/bspcDirectionFocus.sh @@ -17,16 +17,25 @@ nodeStatus="$(bspc query -T -n)" desktopStatus="$(bspc query -T -d)" # If selected window is floating select floating in direction. -# Else if layout is monocle and west or east select previous or next local window in direction. -# Else select non-floating in direction. + if echo "$nodeStatus" | grep -q '"state":"floating'; then bspc node --focus "$direction".floating -elif echo "$desktopStatus" | grep -q '"layout":"monocle"'; then - if [ "$direction" = "west" ]; then + +# Else if layout is monocle and north or south select previous or next local +# window in direction. North and south are chosen over west and east so they +# don't conflict when wanting to select a window in a different screen from a +# monocle layout screen. + +elif echo "$desktopStatus" | grep -q '"layout":"monocle"' && + echo "$direction" | grep -Eq '(north)|(south)'; then + if [ "$direction" = "north" ]; then bspc node --focus prev.local.window.!floating - elif [ "$direction" = "east" ]; then + elif [ "$direction" = "south" ]; then bspc node --focus next.local.window.!floating fi + +# Else select non-floating in direction. + else bspc node --focus "$direction".!floating fi -- cgit v1.2.1