summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.scripts/i3resize22
1 files changed, 8 insertions, 14 deletions
diff --git a/.scripts/i3resize b/.scripts/i3resize
index 98fad5a..11b0992 100755
--- a/.scripts/i3resize
+++ b/.scripts/i3resize
@@ -1,22 +1,16 @@
-#!/bin/bash
+#!/bin/sh
# This script was made by `goferito` on Github.
+# Some cleanup by Luke.
-direction=$1
-pts="2"
-distanceStr="$pts px or $pts ppt"
+[ -z "$1" ] && echo "No direction provided" && exit 1
+distanceStr="2 px or 2 ppt"
-[ -z $1 ] && echo "No direction provided" && exit 1
-
-function moveChoice {
- act1=$1 # first action
- dir1=$2 # first direction
- act2=$3 # fallback action
- dir2=$4 # fallback direction
- i3-msg resize $1 $2 $distanceStr | grep '"success":true' || \
- i3-msg resize $3 $4 $distanceStr
+moveChoice() {
+ i3-msg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \
+ i3-msg resize "$3" "$4" "$distanceStr"
}
-case $direction in
+case $1 in
up)
moveChoice grow up shrink down
;;