"hs" command not found in latest version Hammerspoond

671 views
Skip to first unread message

stardiviner

unread,
Nov 17, 2021, 4:07:09 AM11/17/21
to Hammerspoon
Does this "hs" command not provided in latest version hammerspoon?
I'm newbie on Hammerspoon, so don't know whether it's deprecated or something else.

Diego Zamboni

unread,
Nov 17, 2021, 10:20:38 AM11/17/21
to stardiviner, Hammerspoon
Did you run hs.ipc.cliInstall() ?

--Diego

On Wed, Nov 17, 2021 at 10:07 AM stardiviner <numb...@gmail.com> wrote:
Does this "hs" command not provided in latest version hammerspoon?
I'm newbie on Hammerspoon, so don't know whether it's deprecated or something else.

--
You received this message because you are subscribed to the Google Groups "Hammerspoon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hammerspoon...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hammerspoon/e68f45b9-8d04-417e-b334-5aed4cf3dc0fn%40googlegroups.com.

Christopher M. Miles

unread,
Nov 18, 2021, 1:10:18 AM11/18/21
to Diego Zamboni, stardiviner, Hammerspoon

Diego Zamboni <di...@zzamboni.org> writes:

> Did you run hs.ipc.cliInstall() ?
>

I added this "hs.ipc.cliInstall()" line code in my "init.lua" config file, then restart Hammerspoon,
and check "hs" command in terminal with command: "which hs". Still command not found. I also tried
execute "hs.ipc.cliInstall()" in Hammerspoon Console input field. it returns "false".

My Hammerspoon version 0.9.91 (6078) on macOS Big Sur.
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express.

Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
signature.asc

Chris Jones

unread,
Nov 18, 2021, 2:08:11 AM11/18/21
to numb...@gmail.com, Diego Zamboni, Hammerspoon
What does hs.ipc.cliStatus() say?

Cheers,
--
Chris Jones

> On 18 Nov 2021, at 06:10, Christopher M. Miles <numb...@gmail.com> wrote:
>
> 
> To view this discussion on the web, visit https://groups.google.com/d/msgid/hammerspoon/PAXPR08MB6640D1E5680C6186979EB7A1A39B9%40PAXPR08MB6640.eurprd08.prod.outlook.com.

Christopher M. Miles

unread,
Nov 18, 2021, 5:56:54 AM11/18/21
to Chris Jones, numb...@gmail.com, Diego Zamboni, Hammerspoon

Chris Jones <cm...@tenshu.net> writes:

> What does hs.ipc.cliStatus() say?
>
> Cheers,

It returns "false" in Hammerspoon Console.
signature.asc

Chris Jones

unread,
Nov 18, 2021, 6:40:13 AM11/18/21
to numb...@gmail.com, Diego Zamboni, Hammerspoon
Hmm, in the latest version (0.9.91) it ought to print an error message like this:

> hs.ipc.cliStatus()

2021-11-18 11:38:31: cli installation problem: 'hs' is a dangling link.

2021-11-18 11:38:31: cli installation problem: man page for 'hs.1' is a dangling link.

broken


Is there nothing like that in your Console?

Cheers,
Chris
--
Cheers,

Chris

Christopher M. Miles

unread,
Nov 18, 2021, 7:51:23 AM11/18/21
to Chris Jones, numb...@gmail.com, Diego Zamboni, Hammerspoon

Chris Jones <cm...@tenshu.net> writes:

> Hmm, in the latest version (0.9.91) it ought to print an error message like this:
>
> > hs.ipc.cliStatus()
>
> 2021-11-18 11:38:31: cli installation problem: 'hs' is a dangling link.
>
> 2021-11-18 11:38:31: cli installation problem: man page for 'hs.1' is a dangling link.
>
> broken
>
> Is there nothing like that in your Console?

Yes, there is no upper output. Just returned value "false".
signature.asc

Chris Jones

unread,
Nov 18, 2021, 12:22:20 PM11/18/21
to numb...@gmail.com, Diego Zamboni, Hammerspoon
Hmm. Are you by any chance on an M1 Mac? We're probably not doing a great job of supporting that right now for the hs.ipc.cli* commands because we blindly assume that /usr/local/ is the right default place to put stuff, but at least Homebrew chose /opt/ on Apple Silicon.

Either way, I would suggest trying hs.ipc.cliUninstall() and then hs.ipc.cliInstall() as our next step

Cheers,
Chris



--
Cheers,

Chris

Christopher M. Miles

unread,
Nov 18, 2021, 10:41:41 PM11/18/21
to Chris Jones, numb...@gmail.com, Diego Zamboni, Hammerspoon

Chris Jones <cm...@tenshu.net> writes:

> Hmm. Are you by any chance on an M1 Mac? We're probably not doing a great job of supporting that right now for the
> hs.ipc.cli* commands because we blindly assume that /usr/local/ is the right default place to put stuff, but at least
> Homebrew chose /opt/ on Apple Silicon.

Yes, I'm on M1 Mac mini. Sorry I forgot to mention this. I see, I will wait for this feature support in future. Thanks for your help.

>
> Either way, I would suggest trying hs.ipc.cliUninstall() and then hs.ipc.cliInstall() as our next step
>

I tried this method. Still return "false".
signature.asc
Message has been deleted

Amir Rajan

unread,
Dec 13, 2021, 1:28:28 PM12/13/21
to Hammerspoon
running the following commands resolved the issue for me:
     rm /usr/local/bin/hs
     rm /usr/local/share/man/man1/hs.1

d mg

unread,
Dec 16, 2021, 12:47:58 AM12/16/21
to Hammerspoon
I am also running OS 12.01 on a M1 air

/usr/local is not writable by the regular user. My hs.ipc.cliInstall fails

and the output of cliStatus() is "broken"

Chris Jones

unread,
Dec 16, 2021, 2:52:35 AM12/16/21
to d mg, Hammerspoon
Hey

Yeah we need to look at this properly and change the location for M1 macs. I note that Homebrew uses /opt on those machines. 

Cheers,
--
Chris Jones

On 16 Dec 2021, at 05:47, d mg <dmge...@gmail.com> wrote:



Luke Hamburg

unread,
Dec 29, 2021, 4:31:42 PM12/29/21
to Hammerspoon
Just one more data point:  I'm also on an M1 Mini (12.1) and my `hs` command is working fine. It's symlinked at /usr/local/bin. I don't remember setting any special permissions there, but here is how mine are currently:

$ ls -ld /usr/local/bin
drwxr-xr-x  127 luke  staff  4064 Dec 27 11:18 /usr/local/bin
$ touch /usr/local/bin/foo123
(no error)

I do have Homebrew installed at /opt/homebrew but there's nothing else in /opt and I think /usr/local/ is still a fine place to install 3rd party things. I have a number of other symlinks and scripts in there.

Chris Jones

unread,
Dec 29, 2021, 6:13:27 PM12/29/21
to Luke Hamburg, Hammerspoon
Hey Luke

Out of interest, did you restore a Time Machine backup, or use Migration Assistant, on that M1 Mini?
I have a vague memory that on fresh M1 installs it's not possible to put stuff in /usr/local/, but I don't have a machine on hand that I can re-install to support that idea.

Cheers,
Chris



--
Cheers,

Chris

Luke Hamburg

unread,
Dec 30, 2021, 2:59:47 PM12/30/21
to Hammerspoon
Yes I did use Migration Assistant when I swapped from my old Intel Mac Mini to this one.  So you're probably right about that!

Dmytro Butemann

unread,
Oct 6, 2023, 6:44:33 AM10/6/23
to Hammerspoon
On a fresh M1, one needs to use the code below to install it, so the hs executable can be found.

hs.ipc.cliInstall("/opt/homebrew/")
Reply all
Reply to author
Forward
0 new messages