diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-03-02 16:39:18 +0100 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-03-02 16:39:18 +0100 |
commit | 15b96ce24cdeb7c0c26756fa717b4e8294367294 (patch) | |
tree | b6d4d6fe4b7131705d362cec2d9c3cdd51b612c0 /wpos.sh | |
parent | wpos: Add second round to restore operation and check the result of operation (diff) | |
download | display_autoset-15b96ce24cdeb7c0c26756fa717b4e8294367294.tar.xz |
Fix it to new weired behavior of new driver
Now, it is sensitive to any shift of coordinates. It is much more portable
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 |