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

5
X11/sxhkd/README.md Normal file
View File

@@ -0,0 +1,5 @@
~/.config/sxhkd/sxhkdrc
# Setup
- Move `scripts/` stuff into `/bin`
- Run `sudo chmod 777` on all the scripts

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

165
X11/sxhkd/sxhkdrc Normal file
View File

@@ -0,0 +1,165 @@
#
# wm independent hotkeys
#
# terminal emulator
super + Return
kitty
super + d
~/.config/rofi/runrofi.sh
# program launcher
super + @space
dmenu_run
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
# screenshot
Print
flameshot gui
super + Print
flameshot full -c
super + e
thunar
#
# bspwm hotkeys
#
# quit/restart bspwm
# super + alt + {q,r}
# bspc {quit,wm -r}
super + alt + r
bspc wm -r
# close and kill
super + shift + q
bspc node -c
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest window
super + g
bspc node -s biggest.window
# cycle workspaces
super + alt + {Left,Right}
bspc desktop -f {prev,next}
#bspc desltop -f {prev,next}.local
#
# state/flags
#
# set the window state
# super + {t,shift + t,s,f}
# bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
super + t
{bspc node -t floating && window-placer $(bspc query -T -d | grep -o '"state":"floating"' | wc -l),bspc node -t tiled}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous window in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local.!hidden.window
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
#
# preselect
#
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# Scripts below require chown of root:root and chmod 777, and put them in /bin folder
# move focus in direction
super + {Left,Down,Up,Right}
focusmover {west,south,north,east}
# force window into direction
super + shift + {Left,Down,Up,Right}
euclid_mover {west,south,north,east}
# resize window
super + ctrl + {Left,Down,Up,Right}
bspwm_resize {west,south,north,east}
# framework brightness
XF86MonBrightnessUp
python ~/00/framework_arch_tools/brightness.py +
XF86MonBrightnessDown
python ~/00/framework_arch_tools/brightness.py -
XF86AudioRaiseVolume
sh ~/00/framework_arch_tools/volume.sh up
XF86AudioLowerVolume
sh ~/00/framework_arch_tools/volume.sh down
XF86AudioMute
sh ~/00/framework_arch_tools/volume.sh mute