aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin')
-rwxr-xr-xdotfiles/.local/bin/swayresize5
1 files changed, 5 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/swayresize b/dotfiles/.local/bin/swayresize
index 9ae94c0..89368e9 100755
--- a/dotfiles/.local/bin/swayresize
+++ b/dotfiles/.local/bin/swayresize
@@ -1,9 +1,14 @@
#!/bin/sh
# This script was made by `goferito` on Github.
# Some cleanup by Luke.
+# Some improvements by Yaroslav.
[ -z "$1" ] && echo "No direction provided" && exit 1
+
distanceStr="2 px or 2 ppt"
+if [ -n "$2" ]; then
+ distanceStr="$(printf "%s px or %s ppt" "$2" "$2")"
+fi
moveChoice() {
swaymsg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \