summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-10-04 13:59:39 -0400
committerLuke Smith <luke@lukesmith.xyz>2018-10-04 13:59:39 -0400
commit8ad9b44841366cd637469a46de229e3a521a6862 (patch)
tree700b9815c3e45cc2b3998c04ffb48320fade8b0b
parentcb5834b54bb6e590ae1b7400e84fdd0aad724dac (diff)
downloadeibhear-8ad9b44841366cd637469a46de229e3a521a6862.tar.gz
eibhear-8ad9b44841366cd637469a46de229e3a521a6862.tar.zst
eibhear-8ad9b44841366cd637469a46de229e3a521a6862.zip
i3resize cleanup
-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
;;