dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8ad9b44841366cd637469a46de229e3a521a6862
parent cb5834b54bb6e590ae1b7400e84fdd0aad724dac
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Thu,  4 Oct 2018 13:59:39 -0400

i3resize cleanup

Diffstat:
M.scripts/i3resize | 22++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)

diff --git 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 ;;