script to move x window to other display...ish
This commit is contained in:
parent
b8e7f61bd2
commit
a3d2452da3
19
scripts/move-window-to-other-display.sh
Executable file
19
scripts/move-window-to-other-display.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ueo pipefail
|
||||||
|
|
||||||
|
# assuming that all display's are the same width
|
||||||
|
displayWidth=$(xdotool getdisplaygeometry | cut -d' ' -f1)
|
||||||
|
|
||||||
|
xPos=$(xdotool getactivewindow getwindowgeometry | grep Position: | cut -d: -f2 | cut -d, -f1 | tr -d ' ')
|
||||||
|
echo "current x: ${xPos}"
|
||||||
|
newXPos=
|
||||||
|
if [[ "${xPos}" -ge "${displayWidth}" ]]; then
|
||||||
|
newXPos="-${displayWidth}"
|
||||||
|
else
|
||||||
|
newXPos="${displayWidth}"
|
||||||
|
fi
|
||||||
|
echo "new x: ${newXPos}"
|
||||||
|
|
||||||
|
# i don't know why the y value is offset, but it is what it is
|
||||||
|
xdotool getactivewindow windowmove --relative -- "${newXPos}" -50
|
Loading…
Reference in New Issue
Block a user