Skip to content

Instantly share code, notes, and snippets.

@SofianeHamlaoui
Created January 26, 2020 14:58
Show Gist options
  • Save SofianeHamlaoui/52979c6ded181ed02d85ee4dc07e6857 to your computer and use it in GitHub Desktop.
Save SofianeHamlaoui/52979c6ded181ed02d85ee4dc07e6857 to your computer and use it in GitHub Desktop.
I3 windows resizing without entering the resize mode
#!/usr/bin/env sh
[ -z "$1" ] && echo "No direction provided" && exit 1
distanceStr="2 px or 2 ppt"
moveChoice() {
i3-msg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \
i3-msg resize "$3" "$4" "$distanceStr"
}
case $1 in
up)
moveChoice grow up shrink down
;;
down)
moveChoice shrink up grow down
;;
left)
moveChoice shrink right grow left
;;
right)
moveChoice grow right shrink left
;;
esac
@mashtonian
Copy link

Brilliant, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment