Created
March 23, 2020 16:11
-
-
Save pyrho/d2f4fe152eb8113b1956edd6d7456862 to your computer and use it in GitHub Desktop.
Alfred Kitty custom terminal integration
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
on alfred_script(q) | |
do shell script "/Applications/Kitty.app/Contents/MacOS/kitty @ --to unix:/tmp/mykitty new-window --new-tab" | |
tell application "kitty" to activate | |
tell application "System Events" to keystroke q | |
tell application "System Events" | |
key code 36 -- enter key | |
end tell | |
end alfred_script |
Thanks, I had some issue with your solution because it's not working when Kitty is not already running (which is normal) but weirdly it also wasn't working when it was simply minimised, so I took your idea of using Kitty remote control and added on to it, it's not perfect but so far I had no issue.
https://gist.github.com/SebastienWae/4211d4b2b4c8abde449d69bf9c40175f
Glad that it helped :) Thanks for letting me know.
I started from this and dug into it a bit and found an alternative solution that works a bit better for me. Figured I'd share here
on alfred_script(q)
tell application "kitty" to activate
-- Note: For me, installing with Homebrew, `kitty` was lowercase
do shell script "/Applications/kitty.app/Contents/MacOS/kitty @ --to=unix:/tmp/alfred_kitty.sock launch --hold --type=os-window \"" & q & "\""
end alfred_script
Thank you for sharing this with us.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Details blog post: https://25.wf/blog/alfred-kitty/index.html