diff options
Diffstat (limited to 'wpos.sh')
-rwxr-xr-x | wpos.sh | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -41,7 +41,6 @@ elif [ "$1" = "restore" ]; then ## Check few important values [ "$GRAVITY" -lt 0 ] && continue - [ "$(($POSY - 40 ))" -ge 0 ] && POSY=$(($POSY - 40)) ## And run command wmctrl -i -r "$ID" -e "$GRAVITY","$POSX","$POSY","$WIDTH","$HEIGHT" @@ -53,12 +52,14 @@ elif [ "$1" = "restore" ]; then [ "$GRAVITY" -lt 0 ] && continue NEWX="$(grep "$ID" "$CHECKFILE" | awk '{print $3 }')" - [ "$(($POSY - 40 ))" -ge 0 ] && POSY=$(($POSY - 40)) + NEWY="$(grep "$ID" "$CHECKFILE" | awk '{print $4 }')" - if [ $(($NEWX - $POSX)) = 2 ]; then - POSX=$(($POSX - 2)) - wmctrl -i -r "$ID" -e "$GRAVITY","$POSX","$POSY","$WIDTH","$HEIGHT" - fi + DIFFY="$(($NEWY - $POSY))" + DIFFX="$(($NEWX - $POSX))" + [ "$DIFFY" -ge 0 ] && POSY=$(($POSY - $DIFFY)) + [ "$DIFFX" -ge 0 ] && POSX=$(($POSX - $DIFFX)) + + wmctrl -i -r "$ID" -e "$GRAVITY","$POSX","$POSY","$WIDTH","$HEIGHT" done fi |