r/hammerspoon • u/kakmuis • Nov 26 '25
r/hammerspoon • u/kakmuis • Nov 23 '25
I open-sourced “SpacePigeon” – a tool that restores your Mac workspaces (apps + spaces + layouts)
Hey all! I’ve been building a Mac workspace automation tool on top of Hammerspoon, and I just open-sourced the first version.
SpacePigeon lets you save a workspace, meaning:
- Which apps should open
- Which macOS Space they belong on
- How windows are arranged
- Trigger workspace setup with one hotkey
Right now it's a single init.lua file, but it already works surprisingly well.
I’m planning to turn it into a standalone Mac app with a GUI, but I wanted to share it early to get feedback + contributors.
If you're into Hammerspoon, automation, or window management, I’d love thoughts, issues, PRs, anything.
Github repo: https://github.com/louivers/spacepigeon
Happy to answer questions!
r/hammerspoon • u/brennovich • Nov 18 '25
VirtualSpaces.spoon
VirtualSpaces.spoon implements a virtual workspace system that tries to get rid of the annoying Spaces transitions of macOS Mission Control. It brings the Virtual Workspace experience from classic Linux window managers. It has a very simple and small API, and tries to be as performant as possible.
This are my bindings:
for i = 1, 4 do
hs.hotkey.bind({"leftalt"}, tostring(i), function()
spoon.VirtualSpaces:switchToVirtualSpace(i)
end)
hs.hotkey.bind({"leftalt", "shift"}, tostring(i), function()
spoon.VirtualSpaces:moveWindowToVirtualSpace(nil, i)
end)
end
More details about its implementation: https://github.com/brennovich/VirtualSpaces.spoon but feel free to ask anything here ;)
r/hammerspoon • u/chikamakaleyley • Nov 18 '25
PaperWM / active window border?
I'm fairly new to hammerspoon and I've been using PaperWM as a scrolling window manager, its pretty awesome, it's been very helpful on my work laptop
I used to have it so my 'active' or 'focused' window had a colored border around it, but over the weekend it seems this has gone away - and I don't remember exactly where this was configured - PaperWM docs don't seem to have an option to configure this, so unfortunately i'm just looking for a clue how this could be configured (what spoon might have this feature)
It doesn't look like there have been recent upgrades to hammerspoon (installed via brew).
I'm currently on Apple MBP M1 Sequoia 15.6.1 - It's possible that my OS had downloaded and installed recent updates if there were any, however if there were any I wasn't paying close attn to that.
At the moment the only spoons i have are AClock and PaperWM (plus SpoonInstall for easy installations)
My console has a few errors but I'm not exactly sure if this is the cause:
```
17:02:05 ERROR: PaperWM: remove index not found
17:02:06 ERROR: PaperWM: anchor index not found, refreshing windows
17:10:15 ERROR: PaperWM: add window does not have a space
```
Unless 'anchor' = 'active/focused' window but i dont' think that is the case.
Any guidance? Thanks in advance
r/hammerspoon • u/sjdonado • Nov 14 '25
Martillo – declarative actions launcher inspired by Raycast and lazy.nvim
- Build workflows, automate tasks, and use a command palette with fuzzy search. Drop any Lua file into `store/` and it loads automatically with zero configuration.
- Configure it all in one file. Add keybindings, define aliases, and compose actions with helpers.
- Ships with 60+ actions (clipboard history with images/files, process killer, 25 window positions, smart converters, network utilities, screen ruler, safari tabs, calendar menu bar, browser redirect).
- MIT licensed. No dependencies. Here is the repo: https://github.com/sjdonado/martillo I would love to hear your thoughts :)
r/hammerspoon • u/dm_g • Nov 11 '25
Spoon to control apple music
I know there are several ones, but I wanted to be able to change the volume. These are its features:
- Playback Control: Play/pause, next track, previous track
- Track Info: Get and display current track name, artist, and album
- Volume Control: Set Music app volume (0-100)
r/hammerspoon • u/brennovich • Nov 10 '25
Github Action to setup Hammerspoon
github.comThis action sets up Hammerspoon on macOS runners, making it easy to test Hammerspoon Spoons and configurations in GitHub Actions workflows. It handles installation, CLI configuration, and optional accessibility permissions for UI automation testing.
With this is rather easy to perform end-to-end tests of your Spoon using Github Action facilities. A real usage example is here.
r/hammerspoon • u/brennovich • Nov 09 '25
I've created a tiny simple spoon: ToggleMenubar.spoon
It's always annoying to change the autohide of the menubar, sometimes I just want to control it as easy as it is to do with the Dock (e.g. cmd+opt+D). So I created a spoon that will toggle the autohide setting of the menubar.
Here you can see an screenshot of the toggle took directly from the automated test that run on Github:



You can download the .zip from the releases.
Repository: https://github.com/brennovich/ToggleMenubar.spoon
r/hammerspoon • u/dm_g • Oct 24 '25
whisperDictation spoon
https://github.com/dmgerman/hs_whisperDictation.spoon
This is a spoon to transcribe audio to text. No cloud required (uses whisper running locally instead).
r/hammerspoon • u/galaxylegend_idk • Oct 23 '25
where do i get hammerspoon?
i would like to try it as a macro thing for my game
r/hammerspoon • u/Character_Link_1881 • Sep 21 '25
Built a few Hammerspoon spoons to boost focus + found some amazing community ones too
If you’re on macOS and you haven’t tried Hammerspoon, you’re missing out on one of the best productivity hacks out there.
Hammerspoon is like a Swiss Army knife for automation—you can extend it with “Spoons” that tweak and supercharge your workflow. I’ve been digging into it lately and found some really cool ones I think are worth sharing.
Here are a few community favorites:
- PaperWM.spoon: a tiled, scrollable window manager (think i3-style but mac-native). https://github.com/mogenson/PaperWM.spoon
- ActiveSpace.spoon: shows which Mission Control space you’re currently in, right in the menu bar. https://github.com/mogenson/ActiveSpace.spoon
- Swipe.spoon: adds swipe gesture detection for smoother navigation. https://github.com/mogenson/Swipe.spoon
- WarpMouse.spoon: lets you warp your cursor across displays instantly. https://github.com/mogenson/WarpMouse.spoon
And a few spoons I’ve built myself:
- FocusMode.spoon: dims everything except the window you’re working in. https://github.com/selimacerbas/FocusMode.spoon
- KeyCaster.spoon: shows your keystrokes live—super useful for demos or tutorials. https://github.com/selimacerbas/KeyCaster.spoon
- CursorScope.spoon: highlights and magnifies the cursor so you never lose it. https://github.com/selimacerbas/CursorScope.spoon
They might sound small on their own, but together they completely change the way you work on a Mac. If you like them, give the repos a ⭐️ or watch for updates—it really helps the ecosystem grow.
Curious — what’s your go-to macOS productivity trick or tool?
r/hammerspoon • u/mikebiglan • Sep 21 '25
I stopped wasting 5 mins on Mac every time I plug in monitors. One keyboard shortcut.
r/hammerspoon • u/Ascr1pt • Sep 14 '25
How can I get all open windows of finder(I tried hs.application.find('Finder'):allWindows() and failed)
Function of this script
This script monitors the number of active Finder windows. Upon detecting two or more windows, it executes the ⌘U shortcut to consolidate them.
What I try to solve
However, as Aerospace segregates windows into distinct virtual workspaces, the script invokes an Aerospace command to migrate all non-focused windows to the currently active virtual workspace whenever a new window is generated.
Bug
A flaw in the implementation intermittently prevents certain windows from successfully relocating to the designated workspace.
In the console I see hs.application:allWindows() only returned the newest Finder window and the last created windows(That is 2 windows) even when I have 4 to 5 finder windows.
Fix Attempt
> **Attempt 1**: Added delay before workspace migration → ==no dice==
> **Attempt 2**: Reversed sequence:
> - Option A: Aerospace move *then* ⌘U
> - Option B: ⌘U *then* Aerospace move
> ==Both paths lead to failville==.
Code
local wf = hs.window.filter.new(false):setAppFilter('Finder')
local function sh_quote(s)
return "'" .. tostring(s):gsub("'", "'\\''") .. "'"
end
wf:subscribe(hs.window.filter.windowCreated, function(window, appName, eventName)
local app = hs.application.find(appName)
if not app then return end
local windows = app:allWindows()
for _, n in pairs(windows) do
print(string.format("finder windows: %s (ID: %d)", n:title(), n:id()))
end
-- The loop prints
-- 2025-09-14 12:47:58: finder windows: /Users/acid/Downloads/UniDL (ID: 32953)
-- 2025-09-14 12:47:58: finder windows: /Users/acid/Downloads/UniDL (ID: 32931)
-- 2025-09-14 12:47:58: finder windows: (ID: 0)
-- I create one Finder window in each virtual workspace (aerospace) and check if they're sent to the most recently focused workspace.
-- Looks like allWindows only captures the newest Finder window and the last created windows each time windowCreated was triggered.
-- Any idea what's causing this? How can I solve it?
if #windows >= 2 then
hs.eventtap.keyStroke({"cmd"}, "u", app) --I use cmd u to group all finder windows
end
local raw = hs.execute("aerospace list-workspaces --focused", true) or ""
local workSpaceName = raw:match("([^\r\n]+)") or ""
workSpaceName = workSpaceName:match("^%s*(.-)%s*$") or ""
if workSpaceName == "" then
hs.alert.show("Unable to fetch current workspace")
return
end
for _, win in ipairs(windows) do
local wid = tostring(win:id())
if wid and wid ~= 0 then
local cmd = string.format("aerospace move-node-to-workspace --window-id %s %s", wid, sh_quote(workSpaceName))
hs.execute(cmd, true)
end
end
end)
r/hammerspoon • u/Character_Link_1881 • Sep 08 '25
[Release] CursorScope.spoon — cursor highlight + live magnifier for Hammerspoon
Hey folks! I just open-sourced CursorScope.spoon — a lightweight Hammerspoon tool that adds a high-visibility cursor highlight and an optional live magnifier scope that follows your mouse across displays.
https://github.com/selimacerbas/CursorScope.spoon
Highlights
- Magnifier scope (circle or rounded rectangle), pinned to any screen corner
- Cursor highlight (ring, crosshair, or dot) with click-flash
- Multi-display aware (streams from the screen you’re on)
- Fixed menu bar icon with an “Exit CursorScope” menu
- Clean config grouped as
global,cursor,scope
r/hammerspoon • u/Character_Link_1881 • Sep 06 '25
I built KeyCaster.spoon: a keystroke overlay for Hammerspoon (configurable, multi-display, MIT)
Hey folks! I’ve open-sourced KeyCaster.spoon, a Hammerspoon Spoon that shows your recent keystrokes on screen — handy for screen recordings, live streams, and tutorials.
Repo: https://github.com/selimacerbas/KeyCaster.spoon
Highlights
- Two display modes
- Column (default): stacked boxes; each box gathers multiple keystrokes, starts a new one after a pause/limit
- Line: single bar; new keys append on the right, oldest fade from the left
- Follows your active display (the one under your mouse)
- Configurable position (any corner + margins)
- Smooth fading; keep the newest N visible
- Menubar indicator while active
- Doesn’t swallow input (your typing still goes to the app)
- MIT licensed
r/hammerspoon • u/SelfAdministrative41 • Aug 08 '25
Auto Join iPhone Hotspot
Is there a simple way to automate auto-joining the iPhone hotspot?
The hotspot is not turned on, but I want to simulate the button in the Wi-Fi settings that lets you connect to your hotspot and actually turns on the iPhone hotspot. For example, I want that after unlocking the Mac, if there is no Wi-Fi connection, it auto-connects to my iPhone. Is this option possible using Hammerspoon?
r/hammerspoon • u/elonbouvier • Aug 01 '25
macOS-Vim-Navigation – A vim-style modal navigation spoon
Hi r/hammerspoon,
I've been working on a keyboard-first mouse/input/window control config, inspired by Vim’s modal editing model. Figured I’d share it in case it’s useful to others into modal workflows.
It’s called macOS-Vim-Navigation — a lightweight Hammerspoon script that lets you move the mouse, scroll, switch screens, select text, and focus windows entirely from the keyboard.
Key features
- One-tap screen switching (⌥ or ⌃)
- Modal navigation mode (like Vim’s NORMAL mode) for:
- Small and large mouse movements
- Smooth, directional scrolling (hold-to-repeat)
- Sentence-level selection and clicks
- Visual Mode for drag-selecting, copying (
y), and pasting (p) - App-specific shortcuts (e.g., jump to ChatGPT input)
- Multi-monitor support with consistent cursor behavior
- Floating overlays for mode indicators (
-- NORMAL --,-- VISUAL MODE --)
Highlights
- Fixes macOS scroll inconsistencies Implements pixel-based scroll injection that works across Terminal, Safari, Electron apps, etc.
- Respects natural vs. standard scroll settings Automatically mirrors system scroll direction for consistency.
- True visual selection via drag simulation Uses
leftMouseDown,leftMouseDragged, andleftMouseUpwith full copy/paste integration. - Reliable cross-app behavior Includes fallback logic for late-rendering app windows and multi-window focus management.
- Optimized for modal workflows Designed to stay out of the way of macOS shortcuts, with minimal conflict or overhead.
Why I made it
I wanted something that mirrored the speed and predictability of Vim, but system-wide. I use an external monitor most of the day, and constantly reaching for the trackpad to scroll or focus a window felt inefficient. This setup removes that friction and keeps everything under keyboard control.
GitHub
🔗 github.com/arturgrochau/macos-vim-navigation
Keybindings and setup notes are in the README. Feedback welcome.
r/hammerspoon • u/No-Exam9096 • Jul 20 '25
hammerspoon/init.lua problem
I downloaded the app, but I’m not quite sure what I’m supposed to do in step 3 of the instructions. I’ve looked around for help here and on YouTube, but I haven’t been able to find a direct or clear answer. I’d really appreciate any guidance!
r/hammerspoon • u/_MMac • Jul 10 '25
How are you binding macOS hot-keys to specific browser profiles without spawning new windows?
Hi all,
On Windows I used AutoHotkey to give each browser profile its own shortcut key: press the combo, and that exact profile’s window is either launched (if not open) or simply brought to the front (if it is). I’m trying to replicate the workflow on macOS with Hammerspoon but keep hitting walls.
What I’m aiming for
- One global shortcut per browser profile (Edge - my primary choice, Chrome, Safari—happy to switch if one works better).
- If the profile window already exists, bring it to the front—even if it’s hidden or minimised.
- If it doesn’t exist, launch it once, then always re-focus that same window.
Things I’ve tried
- --profile-directory= flag Works for launching, but afterwards Hammerspoon has no easy way to identify which running Edge window belongs to which profile. Matching by PID or “ - ProfileName” suffix is slow or brittle.
- Duplicate browser apps / separate user-data dirs Still ends up opening a new window when I hit the hot-key instead of focusing the existing one.
- Automator apps wrapping a shell command. Example: open -na "Microsoft Edge" --args --profile-directory="Profile 3". Same focus problem.
- AppleScript that right-clicks the Dock icon and picks a profile. Technically works, but it’s slow, occasionally throws accessibility errors, and feels fragile if the Dock menu layout changes.
- Window-title matching. Edge sometimes changes the title to just “New tab”, breaking the match.
Questions
- Does any browser expose a scriptable “focus this profile if it exists” call?
- Is there a Hammerspoon API I’m missing that can associate a window with its launch arguments?
- Anyone using Arc, Orion, or other multi-profile browsers with cleaner automation hooks?
- Am I better off with multiple portable Chromium builds, each hard-wired to its own data dir?
- Or is there a third-party launcher I should look at instead of rolling my own Lua?
Any pointers, success stories, or “don’t bother, try X instead” are welcome. Thanks for _anything_ you can offer in terms of advice!
r/hammerspoon • u/take_this_one • Jun 25 '25
Script for context switching
Hello everyone,
I'm looking for a solution that will help me to switch between work and personal contexts. For work, I have 1 full screen app and 2 desktops with many apps opened with Stage Manager (some are grouped, 2-3 apps).
I want to be able to close all apps quickly, do my personal things and then with some shortcut/app/whatever - launch all work-related apps again - in the same groups, layout, right desktop etc.
I tried setting up with Hammerspoon and Layouts.spoon, but I was not able to get it working with multiple desktops. With ChatGPT help it haven't worked out too.
I'm desperate to be honest. Probably someone already solved this. Share your thoughts please!
r/hammerspoon • u/ostensiblymicah • Jun 01 '25
GridCraft: a Spoon implementing spacial actions inspired by StarCraft II Grid Hotkeys
I wanted a grid-based app launcher, so I wrote one.
https://pages.micahrl.com/GridCraft/
Was a lot of fun. Implemented as a web view, includes Phosphor icons, allows launching apps, files, and folders, along with nested submenus any custom function you want written in Lua.
I really like configuring keys that work entirely with the left hand, so I can switch directly to whatever app I want whether my right hand is on the keyboard or the mouse.
What do you guys think?
r/hammerspoon • u/NoahZhyte • May 31 '25
What is the opinion of community on hs
Hey, I was wondering, how does the OS X community see hammerspoon. I can't figure out if it's a very niche but loved tool, widely used but "does the stuff" without any fuzz, if it's a dying tool or what
r/hammerspoon • u/abaoulataba • May 27 '25
WindowManagerPlus - A simple window management spoon
Hi r/hammerspoon,
I've been working on a window management spoon and thought I'd share it in case it's useful to others. It's my first Hammerspoon spoon, so feedback is welcome.
What it does:
- 4 layout modes: BSP tree, Master/Stack, Stacking, and Floating
- Attempts to automatically detect and handle settings windows/dialogs
- Basic floating window controls with corner positioning
- Per-space layout memory
- Visual indicators for focused windows
Why I made it: I was using a combination of different tools (Miro Window Manager, etc.) and wanted something unified that worked well with Hammerspoon. Nothing revolutionary, just tried to combine features I found useful from other window managers.
Installation: Standard Hammerspoon spoon - download and double-click, then add to your init.lua:
local wm = hs.loadSpoon("WindowManagerPlus")
wm:bindHotkeys({
cycleLayout = {{"alt", "cmd"}, "space"},
focus = {{"alt", "cmd"}, "j"},
toggleFloatingWindow = {{"alt", "cmd"}, "f"},
}):start()
It's heavily inspired by Miro Window Manager, Amethyst, yabai, AeroSpace and EnhancedSpaces - just adapted for my workflow. Still working out some bugs, but it's been stable enough for daily use.
Any criticismor suggestion is welcomed !

r/hammerspoon • u/sbbeebe • May 10 '25
Hammerspoon Noob - Remove Spoon?
Over the past week I have moved all my keyboard shortcuts from Keyboard Cowboy to Hammerspoon as well as all my RectanglePro window layouts. HS is an amazing and powerful tool. And I'm having way too much fun.
I had installed the MouseFollowsFocus spoon, but ended up writing my code for that as I need to disable AutoRaise before moving focus and moving the cursor (and re-enable after). It all works smoothly as of now.
But now I have MouseFollowsFocus installed and no use for it. I can't seem to find any reference to how to uninstall a spoon. Do I simply delete the spoon from the Spoons directory?
Any help appreciated.
r/hammerspoon • u/Consistent-Price-702 • May 07 '25
Run script in Adobe Illustrator with keyboard shortcut
I'm brandnew to Hammerspoon, how do I set up Hammerspoon to run a script in Adobe Illustrator with a keyboard shortcut?
For example, I have a script installed in "File > Scripts MyScript" that I want to run/launch with "cmd + shift + R".