1

I've been setting up a Karabiner (Launcher Mode) shortcut to open a new Sublime Text window.

Normally I call subl -n from a terminal window to bring up a new sublime window. Karabiner lets you specify shell scripts as shortcuts to run, so I tried /usr/local/bin/subl -n

It works, but, whereas calling subl -n from a terminal window (or /usr/local/bin/subl -n) opens a new window with a "blank" file, calling it through Karabiner opens a temp file at tmp/subl stdin YEd3Bc.txt (YEd3Bc is six random numbers/digits) in a new window

It also blocks Karabiner from launching anything else until you close the window, as if I had called subl -n -w "tmp/subl stdin YEd3Bc.txt"

I thought it was a problem with Karabiner, and tried to work around it by using Automator and Applescript to create wrappers for a shell script, but both of them had the same problem, opening temp files at /tmp/subl stdin random.txt

besciualex
  • 1,872
  • 1
  • 15
  • 20

1 Answers1

0

I haven't used that particular software (Karabiner) however it could be opening a temp file due to the user that is launching the command (Karabiner) not having access to the default path to store the temp file there to which it creates a unique named file in the /tmp directory. You could try adding the following su -u "your user without quotes" -c /use/local/bin/subl -n. As for the locking of (Karabiner) that is most likely due to the internals of Karabiner and how it opens a sub process to the subl binary along with sublimes nature of staying at the foreground. You can attempt a & at the end of the command to send it to the background allowing Karabiner the ability to continue processing.

ioneyed
  • 1,052
  • 7
  • 12