Last active
February 15, 2026 00:58
-
-
Save bavovna/fb1a2c0073ba1bb2ac0e8da7a82321b3 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
| local function toggleApp(appName, newWindowMenuItem) | |
| local app = hs.application.get(appName) | |
| if app then | |
| if not app:mainWindow() then | |
| app:selectMenuItem({appName, newWindowMenuItem}) | |
| elseif app:isFrontmost() then | |
| app:hide() | |
| else | |
| app:activate() | |
| end | |
| else | |
| hs.application.launchOrFocus(appName) | |
| end | |
| end | |
| -- Bind hotkeys to toggle ghostty, kitty, alacritty | |
| hs.hotkey.bind({"ctrl", "shift"}, "`", function() | |
| toggleApp("ghostty", "New OS window") | |
| end) | |
| hs.hotkey.bind({"ctrl", "shift"}, "-", function() | |
| toggleApp("alacritty", "New OS window") | |
| end) | |
| hs.hotkey.bind({"ctrl", "shift"}, "=", function() | |
| toggleApp("kitty", "New OS window") | |
| end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment