Add sway and eww configs

This commit is contained in:
elenapan 2024-12-14 01:38:05 +02:00
parent 53a1fdab2a
commit 6d3f8187c4
101 changed files with 7853 additions and 0 deletions

17
config/sway/scripts/smart-split Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -f
swaymsg -t get_tree | jq -r 'recurse(
.focus[0] as $target
| (.nodes + .floating_nodes)[]
| select(.id == $target)
) | "\(.rect.width) \(.rect.height) \(.deco_rect.height)"' | {
while read -r line; do
# shellcheck disable=2086
set -- $line
w=$1 h=$2 d=$3
done
: "${w?No container found}"
[ "$w" -ge "$((h+d))" ] && direction=horizontal || direction=vertical
swaymsg "split $direction"
}