|
|
|
@ -26,11 +26,15 @@ end
|
|
|
|
|
k = hs.hotkey.modal.new({}, "F17") |
|
|
|
|
|
|
|
|
|
-- Enter Hyper Mode when F18 (Hyper/Capslock) is pressed |
|
|
|
|
pressedF18 = function() k:enter() end |
|
|
|
|
pressedF18 = function() |
|
|
|
|
k:enter() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- Leave Hyper Mode when F18 (Hyper/Capslock) is pressed, |
|
|
|
|
-- send ESCAPE if no other keys are pressed. |
|
|
|
|
releasedF18 = function() k:exit() end |
|
|
|
|
releasedF18 = function() |
|
|
|
|
k:exit() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
f18 = hs.hotkey.bind({}, 'F18', pressedF18, releasedF18) |
|
|
|
|
|
|
|
|
@ -69,8 +73,6 @@ end
|
|
|
|
|
hs.hotkey.bind(hyper, 'N', movieWinBetweenMonitors('next')) |
|
|
|
|
hs.hotkey.bind(hyper, 'P', movieWinBetweenMonitors('previous')) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local grid = require 'hs.grid' |
|
|
|
|
hs.hotkey.bind(hyper, ",", grid.show) |
|
|
|
|
|
|
|
|
@ -109,7 +111,7 @@ homeSSID = "PhRouter_5G"
|
|
|
|
|
homeDDID1 = "EinVerne_5G" |
|
|
|
|
lastSSID = hs.wifi.currentNetwork() |
|
|
|
|
|
|
|
|
|
workSSID = "MIOffice-5G" |
|
|
|
|
workSSID = "XXX-5G" |
|
|
|
|
|
|
|
|
|
function selectKarabinerProfile(profile) |
|
|
|
|
hs.execute("'/Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_cli' --select-profile '" .. profile .. "'") |
|
|
|
@ -184,7 +186,6 @@ hs.network.reachability.forAddress(homeDNS):setCallback(function(self, flags)
|
|
|
|
|
end |
|
|
|
|
end):start() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hs.hotkey.alertDuration = 0 |
|
|
|
|
hs.hints.showTitleThresh = 0 |
|
|
|
|
hs.window.animationDuration = 0 |
|
|
|
@ -212,8 +213,6 @@ else
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function reloadConfig() |
|
|
|
|
hs.reload() |
|
|
|
|
hs.execute("/bin/launchctl kickstart -k \"gui/${UID}/homebrew.mxcl.yabai\"") |
|
|
|
@ -240,7 +239,7 @@ if not hspoon_list then
|
|
|
|
|
"HCalendar", |
|
|
|
|
--"HSaria2", |
|
|
|
|
"WinWin", |
|
|
|
|
"WifiNotifier", |
|
|
|
|
--"WifiNotifier", |
|
|
|
|
"WinRectangle", |
|
|
|
|
"Caffeine", |
|
|
|
|
"PomodoroTimer", |
|
|
|
@ -285,9 +284,15 @@ end
|
|
|
|
|
-- appM modal environment |
|
|
|
|
spoon.ModalMgr:new("appM") |
|
|
|
|
local cmodal = spoon.ModalMgr.modal_list["appM"] |
|
|
|
|
cmodal:bind('', 'escape', 'Deactivate appM', function() spoon.ModalMgr:deactivate({"appM"}) end) |
|
|
|
|
cmodal:bind('', 'Q', 'Deactivate appM', function() spoon.ModalMgr:deactivate({"appM"}) end) |
|
|
|
|
cmodal:bind('', 'tab', 'Toggle Cheatsheet', function() spoon.ModalMgr:toggleCheatsheet() end) |
|
|
|
|
cmodal:bind('', 'escape', 'Deactivate appM', function() |
|
|
|
|
spoon.ModalMgr:deactivate({ "appM" }) |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'Q', 'Deactivate appM', function() |
|
|
|
|
spoon.ModalMgr:deactivate({ "appM" }) |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'tab', 'Toggle Cheatsheet', function() |
|
|
|
|
spoon.ModalMgr:toggleCheatsheet() |
|
|
|
|
end) |
|
|
|
|
if not hsapp_list then |
|
|
|
|
hsapp_list = { |
|
|
|
|
{ key = 'f', name = 'Finder' }, |
|
|
|
@ -393,7 +398,9 @@ if spoon.HSaria2 then
|
|
|
|
|
|
|
|
|
|
hsaria2_keys = hsaria2_keys or { "alt", "D" } |
|
|
|
|
if string.len(hsaria2_keys[2]) > 0 then |
|
|
|
|
spoon.ModalMgr.supervisor:bind(hsaria2_keys[1], hsaria2_keys[2], 'Toggle aria2 Panel', function() spoon.HSaria2:togglePanel() end) |
|
|
|
|
spoon.ModalMgr.supervisor:bind(hsaria2_keys[1], hsaria2_keys[2], 'Toggle aria2 Panel', function() |
|
|
|
|
spoon.HSaria2:togglePanel() |
|
|
|
|
end) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -414,9 +421,15 @@ end
|
|
|
|
|
if spoon.CountDown then |
|
|
|
|
spoon.ModalMgr:new("countdownM") |
|
|
|
|
local cmodal = spoon.ModalMgr.modal_list["countdownM"] |
|
|
|
|
cmodal:bind('', 'escape', 'Deactivate countdownM', function() spoon.ModalMgr:deactivate({"countdownM"}) end) |
|
|
|
|
cmodal:bind('', 'Q', 'Deactivate countdownM', function() spoon.ModalMgr:deactivate({"countdownM"}) end) |
|
|
|
|
cmodal:bind('', 'tab', 'Toggle Cheatsheet', function() spoon.ModalMgr:toggleCheatsheet() end) |
|
|
|
|
cmodal:bind('', 'escape', 'Deactivate countdownM', function() |
|
|
|
|
spoon.ModalMgr:deactivate({ "countdownM" }) |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'Q', 'Deactivate countdownM', function() |
|
|
|
|
spoon.ModalMgr:deactivate({ "countdownM" }) |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'tab', 'Toggle Cheatsheet', function() |
|
|
|
|
spoon.ModalMgr:toggleCheatsheet() |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', '0', '5 Minutes Countdown', function() |
|
|
|
|
spoon.CountDown:startFor(5) |
|
|
|
|
spoon.ModalMgr:deactivate({ "countdownM" }) |
|
|
|
@ -452,37 +465,134 @@ end
|
|
|
|
|
if spoon.WinWin then |
|
|
|
|
spoon.ModalMgr:new("resizeM") |
|
|
|
|
local cmodal = spoon.ModalMgr.modal_list["resizeM"] |
|
|
|
|
cmodal:bind('', 'escape', 'Deactivate resizeM', function() spoon.ModalMgr:deactivate({"resizeM"}) end) |
|
|
|
|
cmodal:bind('', 'Q', 'Deactivate resizeM', function() spoon.ModalMgr:deactivate({"resizeM"}) end) |
|
|
|
|
cmodal:bind('', 'tab', 'Toggle Cheatsheet', function() spoon.ModalMgr:toggleCheatsheet() end) |
|
|
|
|
cmodal:bind('', 'A', 'Move Leftward', function() spoon.WinWin:stepMove("left") end, nil, function() spoon.WinWin:stepMove("left") end) |
|
|
|
|
cmodal:bind('', 'D', 'Move Rightward', function() spoon.WinWin:stepMove("right") end, nil, function() spoon.WinWin:stepMove("right") end) |
|
|
|
|
cmodal:bind('', 'W', 'Move Upward', function() spoon.WinWin:stepMove("up") end, nil, function() spoon.WinWin:stepMove("up") end) |
|
|
|
|
cmodal:bind('', 'S', 'Move Downward', function() spoon.WinWin:stepMove("down") end, nil, function() spoon.WinWin:stepMove("down") end) |
|
|
|
|
cmodal:bind('', 'H', 'Lefthalf of Screen', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("halfleft") end) |
|
|
|
|
cmodal:bind('', 'L', 'Righthalf of Screen', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("halfright") end) |
|
|
|
|
cmodal:bind('', 'K', 'Uphalf of Screen', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("halfup") end) |
|
|
|
|
cmodal:bind('', 'J', 'Downhalf of Screen', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("halfdown") end) |
|
|
|
|
cmodal:bind('', 'Y', 'NorthWest Corner', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("cornerNW") end) |
|
|
|
|
cmodal:bind('', 'O', 'NorthEast Corner', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("cornerNE") end) |
|
|
|
|
cmodal:bind('', 'U', 'SouthWest Corner', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("cornerSW") end) |
|
|
|
|
cmodal:bind('', 'I', 'SouthEast Corner', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("cornerSE") end) |
|
|
|
|
cmodal:bind('', 'F', 'Fullscreen', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("fullscreen") end) |
|
|
|
|
cmodal:bind('', 'C', 'Center Window', function() spoon.WinWin:stash() spoon.WinWin:moveAndResize("center") end) |
|
|
|
|
cmodal:bind('', '=', 'Stretch Outward', function() spoon.WinWin:moveAndResize("expand") end, nil, function() spoon.WinWin:moveAndResize("expand") end) |
|
|
|
|
cmodal:bind('', '-', 'Shrink Inward', function() spoon.WinWin:moveAndResize("shrink") end, nil, function() spoon.WinWin:moveAndResize("shrink") end) |
|
|
|
|
cmodal:bind('shift', 'H', 'Move Leftward', function() spoon.WinWin:stepResize("left") end, nil, function() spoon.WinWin:stepResize("left") end) |
|
|
|
|
cmodal:bind('shift', 'L', 'Move Rightward', function() spoon.WinWin:stepResize("right") end, nil, function() spoon.WinWin:stepResize("right") end) |
|
|
|
|
cmodal:bind('shift', 'K', 'Move Upward', function() spoon.WinWin:stepResize("up") end, nil, function() spoon.WinWin:stepResize("up") end) |
|
|
|
|
cmodal:bind('shift', 'J', 'Move Downward', function() spoon.WinWin:stepResize("down") end, nil, function() spoon.WinWin:stepResize("down") end) |
|
|
|
|
cmodal:bind('', 'left', 'Move to Left Monitor', function() spoon.WinWin:stash() spoon.WinWin:moveToScreen("left") end) |
|
|
|
|
cmodal:bind('', 'right', 'Move to Right Monitor', function() spoon.WinWin:stash() spoon.WinWin:moveToScreen("right") end) |
|
|
|
|
cmodal:bind('', 'up', 'Move to Above Monitor', function() spoon.WinWin:stash() spoon.WinWin:moveToScreen("up") end) |
|
|
|
|
cmodal:bind('', 'down', 'Move to Below Monitor', function() spoon.WinWin:stash() spoon.WinWin:moveToScreen("down") end) |
|
|
|
|
cmodal:bind('', 'space', 'Move to Next Monitor', function() spoon.WinWin:stash() spoon.WinWin:moveToScreen("next") end) |
|
|
|
|
cmodal:bind('', '[', 'Undo Window Manipulation', function() spoon.WinWin:undo() end) |
|
|
|
|
cmodal:bind('', ']', 'Redo Window Manipulation', function() spoon.WinWin:redo() end) |
|
|
|
|
cmodal:bind('', '`', 'Center Cursor', function() spoon.WinWin:centerCursor() end) |
|
|
|
|
cmodal:bind('', 'escape', 'Deactivate resizeM', function() |
|
|
|
|
spoon.ModalMgr:deactivate({ "resizeM" }) |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'Q', 'Deactivate resizeM', function() |
|
|
|
|
spoon.ModalMgr:deactivate({ "resizeM" }) |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'tab', 'Toggle Cheatsheet', function() |
|
|
|
|
spoon.ModalMgr:toggleCheatsheet() |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'A', 'Move Leftward', function() |
|
|
|
|
spoon.WinWin:stepMove("left") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepMove("left") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'D', 'Move Rightward', function() |
|
|
|
|
spoon.WinWin:stepMove("right") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepMove("right") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'W', 'Move Upward', function() |
|
|
|
|
spoon.WinWin:stepMove("up") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepMove("up") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'S', 'Move Downward', function() |
|
|
|
|
spoon.WinWin:stepMove("down") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepMove("down") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'H', 'Lefthalf of Screen', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("halfleft") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'L', 'Righthalf of Screen', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("halfright") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'K', 'Uphalf of Screen', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("halfup") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'J', 'Downhalf of Screen', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("halfdown") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'Y', 'NorthWest Corner', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("cornerNW") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'O', 'NorthEast Corner', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("cornerNE") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'U', 'SouthWest Corner', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("cornerSW") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'I', 'SouthEast Corner', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("cornerSE") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'F', 'Fullscreen', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("fullscreen") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'C', 'Center Window', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveAndResize("center") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', '=', 'Stretch Outward', function() |
|
|
|
|
spoon.WinWin:moveAndResize("expand") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:moveAndResize("expand") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', '-', 'Shrink Inward', function() |
|
|
|
|
spoon.WinWin:moveAndResize("shrink") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:moveAndResize("shrink") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('shift', 'H', 'Move Leftward', function() |
|
|
|
|
spoon.WinWin:stepResize("left") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepResize("left") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('shift', 'L', 'Move Rightward', function() |
|
|
|
|
spoon.WinWin:stepResize("right") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepResize("right") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('shift', 'K', 'Move Upward', function() |
|
|
|
|
spoon.WinWin:stepResize("up") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepResize("up") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('shift', 'J', 'Move Downward', function() |
|
|
|
|
spoon.WinWin:stepResize("down") |
|
|
|
|
end, nil, function() |
|
|
|
|
spoon.WinWin:stepResize("down") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'left', 'Move to Left Monitor', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveToScreen("left") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'right', 'Move to Right Monitor', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveToScreen("right") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'up', 'Move to Above Monitor', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveToScreen("up") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'down', 'Move to Below Monitor', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveToScreen("down") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', 'space', 'Move to Next Monitor', function() |
|
|
|
|
spoon.WinWin:stash() |
|
|
|
|
spoon.WinWin:moveToScreen("next") |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', '[', 'Undo Window Manipulation', function() |
|
|
|
|
spoon.WinWin:undo() |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', ']', 'Redo Window Manipulation', function() |
|
|
|
|
spoon.WinWin:redo() |
|
|
|
|
end) |
|
|
|
|
cmodal:bind('', '`', 'Center Cursor', function() |
|
|
|
|
spoon.WinWin:centerCursor() |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
-- Register resizeM with modal supervisor |
|
|
|
|
hsresizeM_keys = hsresizeM_keys or { "alt", "R" } |
|
|
|
@ -540,9 +650,9 @@ end
|
|
|
|
|
-- spoon.Caffeine:start() |
|
|
|
|
-- end |
|
|
|
|
|
|
|
|
|
if spoon.wifiNotifier then |
|
|
|
|
spoon.wifiNotifier:start() |
|
|
|
|
end |
|
|
|
|
--if spoon.wifiNotifier then |
|
|
|
|
-- spoon.wifiNotifier:start() |
|
|
|
|
--end |
|
|
|
|
|
|
|
|
|
log.d("PomodoroTimer Spoon loaded successfully") |
|
|
|
|
if spoon.PomodoroTimer then |
|
|
|
|