diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-20 14:44:33 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-20 14:44:33 +0200 |
commit | 4eb1e2255765e02bc1eeaef5bbfaa1b567c9665c (patch) | |
tree | 36542dc91fcb67d41bb30819aafe7b53a4d28ca1 /bspc/bspcDirectionFocus.sh | |
parent | 48cec0cfbf1a9b27d4e8d11f7cf2cf66e48362d3 (diff) | |
download | scripts-4eb1e2255765e02bc1eeaef5bbfaa1b567c9665c.tar.gz scripts-4eb1e2255765e02bc1eeaef5bbfaa1b567c9665c.zip |
Fixed a bspc script and created one to swap or move windows.
Diffstat (limited to 'bspc/bspcDirectionFocus.sh')
-rwxr-xr-x | bspc/bspcDirectionFocus.sh | 13 |
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 |