Hammerspoon vs xbar
Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.
Open source · MIT
A macOS automation tool that runs Lua scripts to control your Mac's windows, keys, and system.
Open source · MIT
A macOS menu bar app that shows the output of your scripts and programs.
The short answer
Choose Hammerspoon if you need…
- Mac users comfortable writing small scripts who want custom keyboard shortcuts or window behavior
- Power users who want to automate repetitive desktop tasks on macOS
- People who used Mjolnir and want a more integrated version with built-in extensions
- Developers who want to script their own macOS environment
Choose xbar if you need…
- Mac users who want a script's output always visible in the menu bar
- People moving from BitBar who want a maintained successor
- Developers who want quick status readouts from their own scripts
- Users who want to install community plugins from the plugin directory
Side-by-side
| Hammerspoon | xbar | |
|---|---|---|
| Type | App | App |
| Price | Free and open source | Free and open source |
| Licence | MIT | MIT |
| GitHub stars | 16.4k | 18.1k |
| Setup difficulty | Intermediate | Beginner |
| How you get it | Install with a package manager | Download the app |
| Main language | Objective-C | Go |
| Last code update | 4 months ago | 2 years ago |
What each one is
Hammerspoon
Hammerspoon is a macOS tool that acts as a bridge between the operating system and a Lua scripting engine. It ships with extensions that expose many system features, so you can write Lua scripts to automate parts of your Mac. Out of the box it does nothing; you write your own configuration file to decide what it does.
xbar
xbar is a free, open-source app for macOS that displays the output of any script or program in the menu bar at the top of your screen. It is a rewrite of the older BitBar app, built in Go using the Wails framework. People use it to keep small pieces of information, such as status checks or custom readouts, visible without opening a window.
Best for
Hammerspoon
- Mac users comfortable writing small scripts who want custom keyboard shortcuts or window behavior
- Power users who want to automate repetitive desktop tasks on macOS
- People who used Mjolnir and want a more integrated version with built-in extensions
- Developers who want to script their own macOS environment
xbar
- Mac users who want a script's output always visible in the menu bar
- People moving from BitBar who want a maintained successor
- Developers who want quick status readouts from their own scripts
- Users who want to install community plugins from the plugin directory
Strengths
Hammerspoon
- Built on Lua, a simple and widely used scripting language
- Extensions expose many system features, and API docs are available online
- Open source under the MIT license with an active community and CI testing
xbar
- Free and open source under the MIT license
- Plugins can be any script or program, so it is flexible
- Built-in plugin discovery and management from within the app
Not ideal for
Hammerspoon
- People who want a ready-made app with no configuration, since it does nothing until you write Lua code
- Users on other operating systems, because it is macOS only
- Anyone unwilling to learn basic Lua, since scripting is the main way to use it
xbar
- Windows or Linux users, since the README describes it only as a macOS app
- People on macOS older than Catalina (10.15), which the README lists as the minimum
- Users who want to submit code changes, because the README asks people not to send pull requests and to open an issue first
Trade-offs
Hammerspoon
- Requires writing code, so it is not a point-and-click tool
- MacOS only, and the README does not list supported macOS versions
- Its extension coverage is still growing according to the project's own future plans
xbar
- The README lists the latest release as a beta (v2.1.7-beta), so it may change
- The README does not explain how to write plugins in detail and points to another repository for that
- Pull requests are discouraged, so outside code contributions are limited
Getting started
Hammerspoon
Install with Homebrew
brew install hammerspoon --caskFrequently asked questions
What is the difference between Hammerspoon and xbar?
Hammerspoon: A macOS automation tool that runs Lua scripts to control your Mac's windows, keys, and system. xbar: A macOS menu bar app that shows the output of your scripts and programs. Hammerspoon suits mac users comfortable writing small scripts who want custom keyboard shortcuts or window behavior, while xbar suits mac users who want a script's output always visible in the menu bar.
Are Hammerspoon and xbar free?
Hammerspoon: Free and open source. xbar: Free and open source.
Which is easier to set up, Hammerspoon or xbar?
xbar is easier to get started with (rated beginner); Hammerspoon is rated intermediate and usually needs more setup.
Is Hammerspoon or xbar more popular?
xbar has more GitHub stars (18.1k) than Hammerspoon (16.4k). Popularity isn't the same as fit — check which one matches your use case above.
What are other alternatives to Hammerspoon and xbar?
Other options people compare them with include Pear Desktop, MonitorControl.
Keep comparing
Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.