diff options
-rwxr-xr-x | wpos.sh | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -2,6 +2,7 @@ DEFAULT_PROFILE="auto" SAVEPATH="/tmp/wpos" +CHECKFILE="$SAVEPATH/.tmp.check" ## Check and create main profile direcotry if [ ! -d "$SAVEPATH" ]; then @@ -46,4 +47,18 @@ elif [ "$1" = "restore" ]; then wmctrl -i -r "$ID" -e "$GRAVITY","$POSX","$POSY","$WIDTH","$HEIGHT" done + query > "$CHECKFILE" + cat "$SAVEPATH/$PROFILE" | while read LINE; do + parse "$LINE" + + [ "$GRAVITY" -lt 0 ] && continue + NEWX="$(grep "$ID" "$CHECKFILE" | awk '{print $3 }')" + [ "$(($POSY - 40 ))" -ge 0 ] && POSY=$(($POSY - 40)) + + if [ $(($NEWX - $POSX)) = 2 ]; then + POSX=$(($POSX - 2)) + wmctrl -i -r "$ID" -e "$GRAVITY","$POSX","$POSY","$WIDTH","$HEIGHT" + fi + done + fi |