Hacking Deep Harmony to auto start on login on Mac

Not a big technical person here - finally got the CLI version of Deep Harmony up and running on my Mac. I didn’t see anyone talking about getting it to auto-run when you log into your mac. I just figured it out so thought I’d share.

My setup: Nucleus+ Core, iMac desktop Remote, Harmony Hub
Goal: Have a set it and forget it process that runs Deep Harmony while my computer is on (which is always) so I can control my Nucleus Play/Pause/Skip/Back with my Harmony remote.

This brief tutorial assumes you already have Deep Harmony up and running on your mac. It also assumes you moved the Deep harmony extension folder into a directory where you’ll never move it (so not a temp directory).

  1. Open up TextEdit
  2. Put the following text into the document (be sure to copy and paste the full text - the 2nd line may not be showing all of the text without scrolling below):
cd /Users/jager/roon-extension/
osascript -e 'tell application "Terminal" to set visible of front window to false'
./run.sh

Be sure to replace “/Users/jager/roon-extension/” part ove the text above with the full path to wherever you store your Deep Harmony extension on your mac.

  1. Click File->Save to save the file
  2. Name the file “DeepHarmony” - make sure you remove the “.txt” at the end of the file name.
  3. Uncheck the box "If no extension is provided, use “.txt”.
  4. I recommend under “Where” you choose the same folder as your DeepHarmony extension.
  5. Click save
  6. Launch the program “Terminal”
  7. Type the following command into the terminal window and press return:

chmod 755 /Users/jager/roon-extension/DeepHarmony

Be sure to replace “/Users/jager/roon-extension/” above with the full path to the DeepHarmony text you created. If you’ve done this successfully the DeepHarmony file icon now has the word “exec” in it.

  1. Make sure you’ve quit any other instances of DeepHarmony then double click on the DeepHarmony file - it should automatic start Terminal then immediately hide the window while launching the DeepHarmony extension. Make sure DeepHarmony is working the way you expect now. If not, you can click the Terminal app and click Command-Q which will bring the window back so you can see it again (prompting you to quit the app - which you can cancel to see whatever errors are happening).
  2. If it’s working, congratulations! You’ve now got an executable that starts the command line and hides the window. Now let’s make it auto start. Go into your System Preferences → User & Groups.
  3. Choose “Login Items” on the right.
  4. Click the “+” sign at the bottom of the pane on the right.
  5. Navigate to the directory where you saved “DeepHarmony” and select the “DeepHarmony” file we created in Step 7.
  6. Click Add
  7. You should now see DeepHarmony in your login items. Check the box next to it to “Hide” it (this step be unnecessary but I did it anyway).
  8. You’re all done! Give your computer a reboot and see if it works the way you want it to.

A few caveats:

  1. When you reboot your computer, you’ll get a window asking you if you want to quit Terminal - just click yes and you should be all good.
  2. This is not a service - so you must log in for the process to start - but should work fine once machine is locked. Making it into a service that starts without logging in is beyond my technical skills - but I’m sure it’s possible.
  3. If you love Deep Harmony enough to do this, throw some dollars at the developer of Deep Harmony to say thank you. You can do so at the bottom of this page: GitHub - Khazul/roon-extension-deep-harmony-release: roon-extension-deep-harmony releases

Hope that helps! If you’ve got a better way of doing above, definitely let me know!