diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2023-02-03 02:54:09 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2023-02-03 02:54:09 +0300 |
commit | f0cc6eec402a0deceafc0e0663d77008a969d7aa (patch) | |
tree | 61711a9bc468c39d22bf3f6fc78b232c899bdea6 /dotfiles/.local | |
parent | ef398f6e8860a984d7ea77f2aa71961ed9adb21a (diff) | |
download | swayrice-f0cc6eec402a0deceafc0e0663d77008a969d7aa.tar.gz swayrice-f0cc6eec402a0deceafc0e0663d77008a969d7aa.zip |
menuresize: rofi menu script for exact resizing
Diffstat (limited to 'dotfiles/.local')
-rwxr-xr-x | dotfiles/.local/bin/menuresize | 23 |
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" |