aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/menuresize
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin/menuresize')
-rwxr-xr-xdotfiles/.local/bin/menuresize23
1 files changed, 23 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/menuresize b/dotfiles/.local/bin/menuresize
new file mode 100755
index 0000000..8875c45
--- /dev/null
+++ b/dotfiles/.local/bin/menuresize
@@ -0,0 +1,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"