Compare commits
2 Commits
46f71fabdd
...
9a4c10442a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a4c10442a | ||
|
|
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,18 +1,13 @@
|
|||||||
hs.window.animationDuration = 0
|
(function()
|
||||||
hs.window.setShadows(false)
|
hs.window.animationDuration = 0
|
||||||
local hyper = { "ctrl", "alt", "cmd" }
|
hs.window.setShadows(false)
|
||||||
|
local hyper = { "ctrl", "alt", "cmd" }
|
||||||
|
|
||||||
-- move window to next screen
|
local wm = {
|
||||||
hs.hotkey.bind(hyper, "N", function()
|
|
||||||
local win = hs.window.focusedWindow()
|
|
||||||
win:moveToScreen(win:screen():next())
|
|
||||||
end)
|
|
||||||
|
|
||||||
local wm = {
|
|
||||||
sizes = { 1 / 2, 2 / 3, 1 / 3 },
|
sizes = { 1 / 2, 2 / 3, 1 / 3 },
|
||||||
}
|
}
|
||||||
|
|
||||||
function wm:_nextStep(dim, offs, cb)
|
function wm:_nextStep(dim, offs, cb)
|
||||||
if hs.window.focusedWindow() then
|
if hs.window.focusedWindow() then
|
||||||
local axis = dim == "w" and "x" or "y"
|
local axis = dim == "w" and "x" or "y"
|
||||||
local oppDim = dim == "w" and "h" or "w"
|
local oppDim = dim == "w" and "h" or "w"
|
||||||
@ -41,9 +36,9 @@ function wm:_nextStep(dim, offs, cb)
|
|||||||
|
|
||||||
hs.grid.set(win, cell, screen)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function wm:_fullscreen()
|
function wm:_fullscreen()
|
||||||
if hs.window.focusedWindow() then
|
if hs.window.focusedWindow() then
|
||||||
local win = hs.window.frontmostWindow()
|
local win = hs.window.frontmostWindow()
|
||||||
local screen = win:screen()
|
local screen = win:screen()
|
||||||
@ -57,9 +52,9 @@ function wm:_fullscreen()
|
|||||||
|
|
||||||
hs.grid.set(win, cell, screen)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function wm:_fullDimension(dim)
|
function wm:_fullDimension(dim)
|
||||||
if hs.window.focusedWindow() then
|
if hs.window.focusedWindow() then
|
||||||
local win = hs.window.frontmostWindow()
|
local win = hs.window.frontmostWindow()
|
||||||
local id = win:id()
|
local id = win:id()
|
||||||
@ -75,9 +70,9 @@ function wm:_fullDimension(dim)
|
|||||||
|
|
||||||
hs.grid.set(win, cell, screen)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function wm:init()
|
function wm:init()
|
||||||
self._pressed = {
|
self._pressed = {
|
||||||
up = false,
|
up = false,
|
||||||
down = false,
|
down = false,
|
||||||
@ -149,8 +144,10 @@ function wm:init()
|
|||||||
hs.hotkey.bind(hyper, "m", function()
|
hs.hotkey.bind(hyper, "m", function()
|
||||||
self:_fullscreen()
|
self:_fullscreen()
|
||||||
end)
|
end)
|
||||||
end
|
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}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -135,11 +136,10 @@ in
|
|||||||
launchd.agents.keepass-sync = {
|
launchd.agents.keepass-sync = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
Program = /bin/cp;
|
Program = "${pkgs.writeShellScript "keepass-sync" ''
|
||||||
ProgramArguments = [
|
${pkgs.coreutils}/bin/cp "${homedir}/storage/.macshare/.secret/arnie.kdbx" "${homedir}/.secret/arnie.kdbx"
|
||||||
"${homedir}/storage/.macshare/.secret/arnie.kdbx"
|
''}";
|
||||||
"${homedir}/arnie.kdbx"
|
ProgramArguments = [];
|
||||||
];
|
|
||||||
StartInterval = 60 * 10;
|
StartInterval = 60 * 10;
|
||||||
StandardErrorPath = "/var/log/keepass-sync.error.log";
|
StandardErrorPath = "/var/log/keepass-sync.error.log";
|
||||||
StandardOutPath = "/var/log/keepass-sync.out.log";
|
StandardOutPath = "/var/log/keepass-sync.out.log";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user