diff --git a/scripts/move-window-to-other-display.sh b/scripts/move-window-to-other-display.sh index 15da099..bb446ff 100755 --- a/scripts/move-window-to-other-display.sh +++ b/scripts/move-window-to-other-display.sh @@ -2,15 +2,16 @@ set -ueo pipefail -# assuming that all display's are the same width +# assuming that all displays are the same width displayWidth=$(xdotool getdisplaygeometry | cut -d' ' -f1) xPos=$(xdotool getactivewindow getwindowgeometry | grep Position: | cut -d: -f2 | cut -d, -f1 | tr -d ' ') -newXPos= + +# don't ask questions about magic numbers if [[ "${xPos}" -ge "${displayWidth}" ]]; then - newXPos="-${displayWidth}" + newXPos="-$((displayWidth + 3))" else - newXPos="${displayWidth}" + newXPos="$((displayWidth - 5))" fi # i don't know why the y value is offset, but it is what it is