Skip to content

Instantly share code, notes, and snippets.

@alphashuro
Created April 24, 2022 11:18
Show Gist options
  • Save alphashuro/ca4b64571a364653766df08bd91fc9d4 to your computer and use it in GitHub Desktop.
Save alphashuro/ca4b64571a364653766df08bd91fc9d4 to your computer and use it in GitHub Desktop.
AppleScript for using Alfred with kitty
on alfred_script(q)
set cmd to q
repeat while cmd starts with space
set cmd to cmd's text 2 thru -1
end repeat
tell application "kitty" to activate
do shell script "/Applications/Kitty.app/Contents/MacOS/kitty @ --to unix:/tmp/mykitty new-window --new-tab"
tell application "System Events" to keystroke cmd
tell application "System Events"
key code 36 -- enter key
end tell
end alfred_script
@alphashuro
Copy link
Author

Remember to:

  • add allow_remote_control yes to kitty.conf
  • add --listen-on unix:/tmp/mykitty to ~/.config/kitty/macos-launch-services-cmdline
echo allow_remote_control yes >> ~/.config/kitty/kitty.conf
echo --listen-on unix:/tmp/mykitty >> ~/.config/kitty/macos-launch-services-cmdline

Restart kitty after the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment