aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/menuresize
blob: 8875c4583d5ee517d8438f832888b674a3851da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

resize() {

	amount="$(rofi -dmenu -p "Resize $1")"
	if [ -z "$amount" ]; then
		exit
	fi
	if [ "$1" = "width" ] || [ "$1" = "height" ]; then
		swaymsg "resize set $1 ${amount}ppt"
		exit
	fi;
	swayresize "$1" "$amount"
}

if [ -n "$1" ]; then
	resize "$1"
	exit
fi


direction="$(printf "left\nright\nup\ndown\nwidth\nheight" | rofi -dmenu -matching prefix -p "Select resize direction or dimension")"
resize "$direction"