mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 19:24:53 +00:00
hammerspoon fix for 3 monitors
This commit is contained in:
parent
672001829d
commit
9ba095c29d
@ -15,9 +15,17 @@ function obj:init()
|
||||
local win = hs.window.focusedWindow()
|
||||
-- get the screen where the focused window is displayed, a.k.a. current screen
|
||||
local screen = win:screen()
|
||||
-- local nextScreen = screen:next()
|
||||
-- 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)
|
||||
-- win:move(win:frame():toUnitRect(screen:frame()), screen:next(), true, 0)
|
||||
win:moveToScreen(screen:next(), true, true, 0)
|
||||
end)
|
||||
|
||||
hs.hotkey.bind({ "alt", "ctrl", "cmd" }, "b", function()
|
||||
local win = hs.window.focusedWindow()
|
||||
local screen = win:screen()
|
||||
win:moveToScreen(screen:previous(), true, true, 0)
|
||||
end)
|
||||
|
||||
hs.hotkey.bind({ "alt", "ctrl", "cmd" }, "m", function()
|
||||
|
Loading…
Reference in New Issue
Block a user