resize script cleanup
This commit is contained in:
parent
eb7451f76c
commit
2942d4a528
2 changed files with 23 additions and 21 deletions
|
@ -93,8 +93,7 @@ bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec $truepause ;
|
||||||
bindsym $mod+q kill
|
bindsym $mod+q kill
|
||||||
bindsym $mod+Shift+q kill
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
bindsym $mod+w exec --no-startup-id openweb
|
bindsym $mod+w exec $term -e sudo wifi-menu
|
||||||
#bindsym $mod+w exec $term -e sudo wifi-menu
|
|
||||||
bindsym $mod+Shift+w exec --no-startup-id $BROWSER
|
bindsym $mod+Shift+w exec --no-startup-id $BROWSER
|
||||||
|
|
||||||
bindsym $mod+e exec $term -e neomutt
|
bindsym $mod+e exec $term -e neomutt
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# This script was made by `goferito` on Github.
|
# This script was made by `goferito` on Github.
|
||||||
|
|
||||||
direction=$1
|
direction=$1
|
||||||
|
@ -8,23 +7,27 @@ distanceStr="$pts px or $pts ppt"
|
||||||
|
|
||||||
[ -z $1 ] && echo "No direction provided" && exit 1
|
[ -z $1 ] && echo "No direction provided" && exit 1
|
||||||
|
|
||||||
if [ "$1" == "up" ]; then
|
function moveChoice {
|
||||||
i3-msg resize grow up $distanceStr | grep '"success":true' || \
|
act1=$1 # first action
|
||||||
i3-msg resize shrink down $distanceStr
|
dir1=$2 # first direction
|
||||||
fi
|
act2=$3 # fallback action
|
||||||
|
dir2=$4 # fallback direction
|
||||||
|
i3-msg resize $1 $2 $distanceStr | grep '"success":true' || \
|
||||||
|
i3-msg resize $3 $4 $distanceStr
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$1" == "down" ]; then
|
case $direction in
|
||||||
i3-msg resize shrink up $distanceStr | grep '"success":true' || \
|
up)
|
||||||
i3-msg resize grow down $distanceStr
|
moveChoice grow up shrink down
|
||||||
fi
|
;;
|
||||||
|
down)
|
||||||
if [ "$1" == "left" ]; then
|
moveChoice shrink up grow down
|
||||||
i3-msg resize shrink right $distanceStr | grep '"success":true' || \
|
;;
|
||||||
i3-msg resize grow left $distanceStr
|
left)
|
||||||
fi
|
moveChoice shrink right grow left
|
||||||
|
;;
|
||||||
if [ "$1" == "right" ]; then
|
right)
|
||||||
i3-msg resize grow right $distanceStr | grep '"success":true' || \
|
moveChoice grow right shrink left
|
||||||
i3-msg resize shrink left $distanceStr
|
;;
|
||||||
fi
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue