Last active
December 28, 2024 00:26
-
-
Save tlockney/03a56e6116d970903589e14928c10e70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function launchAppOnHotkey(modifiers, key, appName) | |
hs.hotkey.bind(modifiers, key, function() | |
local app = hs.application.find(appName) | |
if app == nil then | |
hs.application.launchOrFocus(appName) | |
elseif app:isFrontmost() then | |
app:hide() | |
else | |
local win = app:mainWindow() | |
spaces.moveWindowToSpace(win:id(), spaces.activeSpaceOnScreen()) | |
win:focus() | |
end | |
end) | |
end | |
launchAppOnHotkey({"alt"},"`","WezTerm") | |
launchAppOnHotkey({"alt","shift"},"o","Obsidian") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment