Code: #!/bin/bash offx=$( grep metamodes /etc/X11/xorg.conf | cut -d '+' -f 4 | sed 's/[^0-9]*//g' ) offy=$( grep metamodes /etc/X11/xorg.conf | cut -d '+' -f 5 | sed 's/[^0-9]*//g' ) curx=$(xwininfo -id `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"| cut -d ' ' -f 5` | grep "Absolute upper-left X" | cut -d ' ' -f 7) cury=$(xwininfo -id `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"| cut -d ' ' -f 5` | grep "Absolute upper-left Y" | cut -d ' ' -f 7) if [ $curx -ge $offx ] then newx=$((curx-offx)) newy=$((cury-offy)) else newx=$((curx+offx)) newy=$((cury+offy)) fi /usr/bin/xdotool windowmove `/usr/bin/xdotool getwindowfocus` $newx $newy exit 0

There's probably a better sed command to find the display resolutions (I'm definitely no sed guru - in fact, it's a tool I still find incredibly hard to use after years of wrangling with it) and when I use the script to move a window, repeated moves means the window slowly gets lower on each screen, so there's pixels being added to the newy value for some reason, but I can't work out why.Anyway, let me know if this works for you.