blob: 98fad5a530611d89ac853fef8b306582ab3ef4a9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/bash
# This script was made by `goferito` on Github.
direction=$1
pts="2"
distanceStr="$pts px or $pts ppt"
[ -z $1 ] && echo "No direction provided" && exit 1
function moveChoice {
act1=$1 # first action
dir1=$2 # first direction
act2=$3 # fallback action
dir2=$4 # fallback direction
i3-msg resize $1 $2 $distanceStr | grep '"success":true' || \
i3-msg resize $3 $4 $distanceStr
}
case $direction in
up)
moveChoice grow up shrink down
;;
down)
moveChoice shrink up grow down
;;
left)
moveChoice shrink right grow left
;;
right)
moveChoice grow right shrink left
;;
esac
|