At work I have a 3 monitor setup. I would like to move the current application to a second or a third monitor with a key binding. How to do that?
If you right click on your desktop and open up display settings, you'll see your three monitors listed. You can drag and drop the squares in the order you'd like.
I use the following script to cycle the focused window through the screens.
-- bind hotkey
hs.hotkey.bind({'alt', 'ctrl', 'cmd'}, 'n', function()
-- get the focused window
local win = hs.window.focusedWindow()
-- get the screen where the focused window is displayed, a.k.a. current screen
local screen = win:screen()
-- compute the unitRect of the focused window relative to the current screen
-- and move the window to the next screen setting the same unitRect
win:move(win:frame():toUnitRect(screen:frame()), screen:next(), true, 0)
end)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With