From bdc22c8ac2ba776329125857d689687ad59d15d4 Mon Sep 17 00:00:00 2001 From: tmont Date: Tue, 2 Nov 2021 14:39:47 -0700 Subject: [PATCH] fudged the x position to make it work properly cuz whatever --- scripts/move-window-to-other-display.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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