Scripts quick access edit this

Synopsis Edit

Send focused window to next/previous Xinerama head.

Description Edit

Allows binding a hotkey to send the currently focused window to the next or previous Xinerama head. It's somewhat smarter than my last attempt, and should work with any number of heads. It should also move the head to the proper position on heads with different resolutions as well. Meaning, that is you have a window at 512 pixels over on a 1024 pixel wide screen, and move it to a 1280 wide screen the window will position itself at 640.

Notes Edit

If this script doesn't appear to work for you -- in my case, it simply beeped without displaying any error message -- and your X heads have differing resolutions, there may be a problem caused by passing non-integer coordinates to the move-window-to function. To fix this, change the two lines that read:

(setq newx (+ (* (/ nhx chx) (- x chox)) (car (head-offset nh))))
(setq newy (+ (* (/ nhy chy) (- y choy)) (cdr (head-offset nh))))

to this:

(setq newx (round (+ (* (/ nhx chx) (- x chox)) (car (head-offset nh)))))
(setq newy (round (+ (* (/ nhy chy) (- y choy)) (cdr (head-offset nh)))))

Note that this pair of lines occurs twice in the file, in both the send-to-next-head and sent-to-previous-head functions, so you will want to change it in both.

Hope that helps! -- Shimon Rura <>

Community content is available under CC-BY-SA unless otherwise noted.