nix-configuration/home-manager/hammerspoon/window-move.lua
2025-01-30 09:52:53 +01:00

22 lines
679 B
Lua

windowMove = function()
-- move window to next screen
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "N", function()
local win = hs.window.focusedWindow()
win:moveToScreen(win:screen():next())
end)
-- Windows seem to be indexed by primary screen first
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad1", function()
hs.window.focusedWindow():moveToScreen(hs.screen.allScreens()[3])
end)
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad2", function()
hs.window.focusedWindow():moveToScreen(hs.screen.allScreens()[1])
end)
hs.hotkey.bind({ "ctrl", "alt", "cmd" }, "pad3", function()
hs.window.focusedWindow():moveToScreen(hs.screen.allScreens()[2])
end)
end
windowMove()