Live data from Hacker News

Hammerspoon

github.com

51–60 of 154 posts

Re: Hammerspoon

#51
post #21

I use it to hide Zoom's screen sharing controls so they don't come back when pressing Esc: -- Hide Zoom's "share" windows so it doesn't come back on ESC keypress local zoomWindow = nil local originalFrame = nil hs.hotkey.bind({"cmd", "ctrl", "alt"}, "H", function() print("> trying to hide zoom") if not zoomWindow then print("> looking for window") zoomWindow = hs.window.find("zoom share statusbar window") end if zoom…

Oh my god, immediately worth installing just for this

Re: Hammerspoon

#52

Shameless plug/proud self-promotion - https://github.com/agzam/spacehammer "Spacemacs|Doom inspired Hammerspoon modal toolkit" I can't even work on Mac without it. It let's you do stuff like "alt+spc a b" (apps -> browser) or "alt+spc m j/k" (media -> vol up/down), or edit just about any text of any app in your editor (Emacs atm) - with all the tools you have there - spellchecking, thesaurus, translation, LLMs, etc.…

> "alt+cmd m j/k" (media -> vol up/down)

if only keyboards came with built in buttons for adjusting the volume… oh wait. Unless of course you are suffering on a touch bar mac, then I completely understand.

Re: Hammerspoon

#53
post #8

I utterly love Hammerspoon. It's fun to combine with qmk [0], which gives you a bunch more options for hotkeys on your keyboard via layers. I've ended up with a layer where half the keyboard is Hammerspoon shortcuts directly to apps (e.g. go to Slack, to Chrome, etc.) and half of it is in-app shortcuts (like putting cmd-number on the home row, for directly addressing chrome tabs). Between this and one of the tiling w…

My QMK Tmux "layer" is still one of my favourite customisations. Prepends Ctrl-B to everything I type.

Re: Hammerspoon

#54
post #24
post #15

Earlier quoted context omitted.

What features are you trying to replicate from Aerospace?

Well, a tiling window and workspace manager. But as I am typing this, I’m realizing they hammerspoon can probably do some of the window placement, but maybe not handling workspaces and global state. I was hoping I could be lazy and ask, and a not-lazy person could give a ready made answer :)

If workspace management is an another term for managing desktop/spaces, then you are going to be hard pressed to find anything that is not a brittle hack.

I am writing a window manager bundled with other knick-knacks for myself. I have a "solution" for moving windows between spaces, but in the most vile way possible.

The only way I have managed to move windows between spaces is by, and this is no joke, recording the mouse position, moving the mouse to an app's titlebar, automating the 'click and hold' on the window's titlebar, then having the keybindings for "Switch to Next/Previous Space" fire off, and then moving the mouse back to the original position.

Because of the animations, all of junk requires carefully timed, short sleeps, which are also not likely consistent across various hardware/OS versions (can't test it myself).

Also, I have no idea what happens if my solution is tried on apps with pop-up windows, 'headless' apps (no title bar), electron apps, etc..

Apple's support for spaces is notoriously atrocious. There is no clean way to move windows from one space to another or to create/delete spaces. Though there was a built in way in OSX Snow Leopard, IIRC. Why it was removed? I have no idea.

Aerospace creates its own virtual desktops/spaces instead of trying to fight against the OS. I have never used Aerospace, so I cannot comment on its efficacy. But that is probably the cleanest solution we currently have available.

Re: Hammerspoon

#55
post #29

Earlier quoted context omitted.

I highly recommend Aerospace[1], went through a few approaches, I cared about not completely compromising security either, it works really well if you come from something like i3 1. https://github.com/nikitabobko/AeroSpace

Seconding this. I find MacOS unusable without it. I'll ask here because websearch is failing me: is there a way to fix the focus stealing that happens when you have multiple windows of an application on different displays? Specifically, say workspace 1 and 2 are on monitor Left, while 3 and 4 are on Right. Application A has a window on workspace 1, B has one window on 2 and another on 3, and C has a window on 4. Work…

Thirding the recommendation, and I also have this same issue. It's quite frustrating—but still better than no Aerospace!

Re: Hammerspoon

#56
post #54
post #24

Earlier quoted context omitted.

Well, a tiling window and workspace manager. But as I am typing this, I’m realizing they hammerspoon can probably do some of the window placement, but maybe not handling workspaces and global state. I was hoping I could be lazy and ask, and a not-lazy person could give a ready made answer :)

If workspace management is an another term for managing desktop/spaces, then you are going to be hard pressed to find anything that is not a brittle hack. I am writing a window manager bundled with other knick-knacks for myself. I have a "solution" for moving windows between spaces, but in the most vile way possible. The only way I have managed to move windows between spaces is by, and this is no joke, recording the…

Sadly, I think you’re right.

Aerospace is pretty cool, i recommend it, but I have not really worked out how full screen interacts with spaces. It’s a mess with and without aerospace.

Re: Hammerspoon

#57
post #37

Hammerspoon is the glue that holds my Mac together. For a starter list of things to do with this app, a partial list of the things that I'm using it for: - Dumping all open Safari tabs to an Obsidian doc - Adding 'hyper' (Ctrl-Opt-Cmd) keybinds to pop a new window for: - Safari - Finder - Terminal / Ghostty - VS Code - Notes - Editing Hammerspoon/AeroSpace/Sketchybar config - Reloading Hammerspoon config - Reloading…

Keyboard stuff is better handled with Karabiner elements

Karabiner can _create_ new keys like hyper, but you _bind_ them with Hammerspoon.

Re: Hammerspoon

#59

Hammerspoon is the glue that holds my Mac together. For a starter list of things to do with this app, a partial list of the things that I'm using it for: - Dumping all open Safari tabs to an Obsidian doc - Adding 'hyper' (Ctrl-Opt-Cmd) keybinds to pop a new window for: - Safari - Finder - Terminal / Ghostty - VS Code - Notes - Editing Hammerspoon/AeroSpace/Sketchybar config - Reloading Hammerspoon config - Reloading…

> - Dumping all open Safari tabs to an Obsidian doc

I'd love to do this too. Would you mind sharing how you do it? Or is it trivially easy and not worth explaining? (I haven't looked too deeply into HS yet.)

Re: Hammerspoon

#60
post #29

Earlier quoted context omitted.

I highly recommend Aerospace[1], went through a few approaches, I cared about not completely compromising security either, it works really well if you come from something like i3 1. https://github.com/nikitabobko/AeroSpace

Seconding this. I find MacOS unusable without it. I'll ask here because websearch is failing me: is there a way to fix the focus stealing that happens when you have multiple windows of an application on different displays? Specifically, say workspace 1 and 2 are on monitor Left, while 3 and 4 are on Right. Application A has a window on workspace 1, B has one window on 2 and another on 3, and C has a window on 4. Work…

So what you’re saying is:

Charlie's paternal grandfather Reginald married twice—first to Mildred, mother of Charlie's father Arthur and his siblings Beatrice (a nun with spiritual godchildren) and Cecil (whose widow Dorothy married Charlie's maternal uncle Edward). What is the name of Charlie's goddaughter?

Post reply on HN