aboutsummaryrefslogtreecommitdiff
path: root/bspc/bspcDirectionFocus.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bspc/bspcDirectionFocus.sh')
-rwxr-xr-xbspc/bspcDirectionFocus.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/bspc/bspcDirectionFocus.sh b/bspc/bspcDirectionFocus.sh
index 5222298..f36359b 100755
--- a/bspc/bspcDirectionFocus.sh
+++ b/bspc/bspcDirectionFocus.sh
@@ -13,14 +13,15 @@ if ! echo "$direction" | grep -Eq '(west)|(south)|(north)|(east)'; then
exit 1
fi
-status="$(bspc wm --get-status)"
+nodeStatus="$(bspc query -T -n)"
+desktopStatus="$(bspc query -T -d)"
-# If floating (TF) select floating in direction.
-# Else if monocle (LM) and west or east select previous or next local window in direction.
+# 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 "$status" | grep -q ':TF:'; then
- bspc node --focus "$direction".floating;
-elif echo "$status" | grep -q ':LM:'; then
+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
bspc node --focus prev.local.window.!floating
elif [ "$direction" = "east" ]; then