migration

This commit is contained in:
kokopi-dev
2025-10-28 16:23:11 +09:00
commit 2f27c335cf
116 changed files with 8221 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#!/bin/bash
#++ requirements:
#+ sudo pacman -S xdo
size=${2:-'10'}
dir=$1
is_tiled() {
bspc query -T -n | grep -q '"state":"tiled"'
}
if ! is_tiled; then
case "$dir" in
west) switch="-w"
sign="-"
;;
east) switch="-w"
sign="+"
;;
north) switch="-h"
sign="-"
;;
south) switch="-h"
sign="+"
;;
esac
xdo resize ${switch} ${sign}${size}
else
case "$dir" in
west) bspc node @west -r -$size || bspc node @east -r -${size}
;;
east) bspc node @west -r +$size || bspc node @east -r +${size}
;;
north) bspc node @south -r -$size || bspc node @north -r -${size}
;;
south) bspc node @south -r +$size || bspc node @north -r +${size}
;;
esac
fi

View File

@@ -0,0 +1,85 @@
#!/bin/bash
# Originally by https://github.com/windelicato/
size=${2:-'20'}
dir=$1
transplanter() {
bspc node ${dir} -p south && bspc node -n ${dir}
}
northplanter() {
bspc node north -p north && bspc node -n north
}
rootplanter() {
bspc node @/ -p ${dir} && bspc node -n @/ || bspc node -s next.local && bspc node -n @/
bspc node @/ -p cancel
}
bspc config pointer_follows_focus true
# Find current window mode
is_floating() {
bspc query -T -n | grep -q '"state":"floating"'
}
# If the window is floating, move it
if is_floating; then
#only parse input if window is floating,tiled windows accept input as is
case "$dir" in
west) switch="-x"
sign="-"
;;
east) switch="-x"
sign="+"
;;
north) switch="-y"
sign="-"
;;
*) switch="-y"
sign="+"
;;
esac
xdo move ${switch} ${sign}${size}
# Otherwise, window is tiled: switch with window in given direction
else
if [[ $(bspc query -N -n .local.\!floating | wc -l) != 2 ]]; then
case "$dir" in
north) northplanter || rootplanter
;;
*) transplanter || rootplanter
;;
esac
else
case "$dir" in
east) bspc node -s east || bspc query -N -n west.local || \
if bspc query -N -n south.local ; then
bspc node @/ -R 90
else
bspc node @/ -R 270
fi
;;
west) bspc node -s west || bspc query -N -n east.local || \
if bspc query -N -n north.local ; then
bspc node @/ -R 90
else
bspc node @/ -R 270
fi
;;
south) bspc node -s south || bspc query -N -n north.local || \
if bspc query -N -n west.local ; then
bspc node @/ -R 90
else
bspc node @/ -R 270
fi
;;
*) bspc node -s north || bspc query -N -n south.local || \
if bspc query -N -n west.local ; then
bspc node @/ -R 270
else
bspc node @/ -R 90
fi
;;
esac
fi
fi

View File

@@ -0,0 +1,13 @@
#!/bin/sh
#Focus windows by direction, works with multihead
#called like this in sxhkdrc:
#super + {a,s,w,d}
# focusmover {west,south,north,east}
bspc config pointer_follows_monitor true; \
bspc config pointer_follows_focus true; \
dir=$@; \
if ! bspc node -f $dir; then \
bspc monitor -f $dir; \
fi; \
bspc config pointer_follows_monitor false; \
bspc config pointer_follows_focus false