raguay / MyAlfred

This is where I am keeping my Alfred 2, Alfred 3, and Alfred 4 workflows.
441 stars 47 forks source link

HammerspoonWorkflow not working under El Capitan #6

Closed templeman closed 8 years ago

templeman commented 8 years ago

I can't be certain that it's related, but right around the time I upgraded to El Capitan the Hammerspoon workflow stopped working altogether. I've tried reinstalling both the workflow and Hammerspoon itself (Hammerspoon v.0.9.42). Alfred debug console outputs

[ERROR: alfred.workflow.action.script] /bin/bash: line 29: /usr/local/bin/hs: No such file or directory
raguay commented 8 years ago

Your copy of "hs" in /usr/local/bin was deleted. Once you upgraded to El Capitan, that directory is no longer writeable by you. To fix it: run this in the command line: sudo chown -R /usr/local. That will change all of /usr/local to being owned by you and not the system. If you are not sure what your user name is, do "ls -al" in your home directory and it will show the owner of that directory, which is you.

This is needed with the move by El Capitan to a "rootless" system. It is for better security, but messes with many applications former use of the system. Also, make sure you are using the latest version of the workflow. I have optimized the check for "hs" since my initial release (ie: it no longer installs the "hs" program every time it is ran). Therefore, after fixing the file system ownership above, run "hs:install" again.

templeman commented 8 years ago

Strangely, I had already fixed my permissions on the /usr/local folder following the upgrade to El Capitan. After confirmation that I have ownership, I can run hs:install and get the "Hammerspoon config installed." message as well as the "Configuration by Custom Computer Tools is Loaded" alert. Yet there remains no "hs" in /usr/local/bin, so all other "hs:" commands continue to fail. Is there anything else that could be preventing the "hs" files from being generated on install?

raguay commented 8 years ago

Well, changing the ownership should of fixed it, unless you only changed the top and not the whole tree. Did you have the -R flag on the chown? You can try to manually make the link:

ln -s /Applications/Hammerspoon.app/Contents/Resources/extensions/hs/ipc/bin/hs /usr/local/bin/hs

Run that in a terminal. If it still says you do not have write ability, the /usr/local/bin is still not owned by you.

templeman commented 8 years ago

I created the link manually as you suggested and it worked on the first try. It seems like something in my uninstalling-installing process made the workflow start to skip the symlink step. Anyway, that was the missing piece, thanks for your help and for sharing such a useful workflow!

raguay commented 8 years ago

Un-installing Hammerspoon would remove the link. Glad that it is working for you.