mirror of
https://github.com/elenapan/dotfiles.git
synced 2026-05-11 17:35:57 +08:00
Add sway and eww configs
This commit is contained in:
parent
53a1fdab2a
commit
6d3f8187c4
101 changed files with 7853 additions and 0 deletions
17
config/sway/scripts/smart-split
Executable file
17
config/sway/scripts/smart-split
Executable 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"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue