From f0cc6eec402a0deceafc0e0663d77008a969d7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Fri, 3 Feb 2023 02:54:09 +0300 Subject: menuresize: rofi menu script for exact resizing --- dotfiles/.local/bin/menuresize | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 dotfiles/.local/bin/menuresize (limited to 'dotfiles/.local') 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" -- cgit v1.2.3