Add window moving to hammerspoon
This commit is contained in:
parent
46f71fabdd
commit
908d8e22b1
15
home-manager/hammerspoon/window-move.lua
Normal file
15
home-manager/hammerspoon/window-move.lua
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
(function()
|
||||||
|
local hyper = { "ctrl", "alt", "cmd" }
|
||||||
|
|
||||||
|
-- move window to next screen
|
||||||
|
hs.hotkey.bind(hyper, "N", function()
|
||||||
|
local win = hs.window.focusedWindow()
|
||||||
|
win:moveToScreen(win:screen():next())
|
||||||
|
end)
|
||||||
|
|
||||||
|
for i = 1, 3 do
|
||||||
|
hs.hotkey.bind(hyper, "pad" .. i, function()
|
||||||
|
hs.window.focusedWindow():moveToScreen(i)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end)()
|
||||||
@ -1,13 +1,8 @@
|
|||||||
|
(function()
|
||||||
hs.window.animationDuration = 0
|
hs.window.animationDuration = 0
|
||||||
hs.window.setShadows(false)
|
hs.window.setShadows(false)
|
||||||
local hyper = { "ctrl", "alt", "cmd" }
|
local hyper = { "ctrl", "alt", "cmd" }
|
||||||
|
|
||||||
-- move window to next screen
|
|
||||||
hs.hotkey.bind(hyper, "N", function()
|
|
||||||
local win = hs.window.focusedWindow()
|
|
||||||
win:moveToScreen(win:screen():next())
|
|
||||||
end)
|
|
||||||
|
|
||||||
local wm = {
|
local wm = {
|
||||||
sizes = { 1 / 2, 2 / 3, 1 / 3 },
|
sizes = { 1 / 2, 2 / 3, 1 / 3 },
|
||||||
}
|
}
|
||||||
@ -154,3 +149,5 @@ end
|
|||||||
wm:init()
|
wm:init()
|
||||||
|
|
||||||
hs.notify.show("Welcome to Hammerspoon", "Have fun!", "")
|
hs.notify.show("Welcome to Hammerspoon", "Have fun!", "")
|
||||||
|
|
||||||
|
end)()
|
||||||
|
|||||||
@ -43,6 +43,7 @@ in
|
|||||||
"${homedir}/.hammerspoon/init.lua" = {
|
"${homedir}/.hammerspoon/init.lua" = {
|
||||||
text = ''
|
text = ''
|
||||||
${builtins.readFile ./hammerspoon/window-tiling.lua}
|
${builtins.readFile ./hammerspoon/window-tiling.lua}
|
||||||
|
${builtins.readFile ./hammerspoon/window-move.lua}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user