https://github.com/denism8977/hammerspoon
Hammerspoon is a powerful macOS automation tool that uses Lua scripts for window management, hotkeys, and system control. Unlock your productivity! ๐ ๏ธ๐
https://github.com/denism8977/hammerspoon
automation dotfiles hacktoberfest hammerspoon hammerspoon-configuration hyper-shortcuts irc literate-configuration lua objective-c osx sierra spoons stacks tabbed-layout toggl vim vim-bindings
Last synced: 11 months ago
JSON representation
Hammerspoon is a powerful macOS automation tool that uses Lua scripts for window management, hotkeys, and system control. Unlock your productivity! ๐ ๏ธ๐
- Host: GitHub
- URL: https://github.com/denism8977/hammerspoon
- Owner: denism8977
- License: gpl-3.0
- Created: 2025-06-27T02:09:32.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-27T06:03:04.000Z (11 months ago)
- Last Synced: 2025-06-27T07:20:38.572Z (11 months ago)
- Topics: automation, dotfiles, hacktoberfest, hammerspoon, hammerspoon-configuration, hyper-shortcuts, irc, literate-configuration, lua, objective-c, osx, sierra, spoons, stacks, tabbed-layout, toggl, vim, vim-bindings
- Homepage: https://denism8977.github.io
- Size: 19.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hammerspoon: Powerful macOS Automation Tool with Lua Scripting

 [](https://github.com/denism8977/Hammerspoon/releases)
## ๐ ๏ธ What Is Hammerspoon?
Hammerspoon is a robust automation tool for macOS that connects system-level APIs with a Lua scripting engine. With Hammerspoon, you can write Lua scripts to control various aspects of your system, including windows, applications, audio devices, clipboard, hotkeys, mouse events, and much more. For detailed information, visit [hammerspoon.org](https://hammerspoon.org).
## โ๏ธ Core Features
### System API Access
Hammerspoon provides access to a wide range of system APIs. You can use Lua scripts to manipulate:
- Windows
- Applications
- Filesystem
- Audio
- Screens
- Keyboard and mouse events
- Network
This extensive access allows you to create custom solutions tailored to your workflow.
### Extensible Through โSpoonsโ
Spoons are modular plugins that enhance Hammerspoon's functionality. You can use Spoons to:
- Launch applications
- Manage screen brightness
- Keep a clipboard history
- Implement Pomodoro timers
- Display clocks
This modularity allows you to add features as needed without cluttering your main configuration.
### Configurable Hotkeys
With Hammerspoon, you can bind any key combination to trigger scripts or actions. This feature enables you to streamline your workflow and execute commands quickly.
### Window Management
Efficient window management is crucial for productivity. Hammerspoon allows you to:
- Move and resize windows
- Tile windows for better organization
These features are ideal for users who work with multiple applications simultaneously.
### Accessibility and Automation
Hammerspoon can automate repetitive tasks, making your workflow smoother. You can create scripts that interact with various applications and system functions seamlessly.
## ๐ Getting Started
### Installation
1. Download the latest release from the [Releases section](https://github.com/denism8977/Hammerspoon/releases). Follow the instructions to install and execute the application.
2. Open Hammerspoon, and you will see its icon in the menu bar.
3. Create your `init.lua` configuration file in the `~/.hammerspoon/` directory. This file is where you will write your Lua scripts.
### Example Script
Hereโs a simple example of a Lua script to get you started:
```lua
hs.hotkey.bind({"cmd", "alt"}, "H", function()
hs.alert.show("Hello, Hammerspoon!")
end)
```
This script binds the key combination `Command + Option + H` to display a simple alert.
## ๐ Documentation
Hammerspoon has comprehensive documentation available on its [official website](https://hammerspoon.org). The documentation covers:
- API references
- Tutorials
- Examples
Refer to the documentation to learn more about scripting and advanced features.
## ๐งฉ Spoons
Spoons are an essential part of Hammerspoon. To install a Spoon:
1. Find the Spoon you want to use from the [Spoon repository](https://github.com/Hammerspoon/Spoons).
2. Clone or download the Spoon.
3. Place it in the `~/.hammerspoon/Spoons/` directory.
4. Load the Spoon in your `init.lua` file:
```lua
hs.loadSpoon("SpoonName")
```
Replace `SpoonName` with the actual name of the Spoon you want to load.
## ๐ Community and Support
Hammerspoon has an active community where you can seek help and share your scripts. You can join the discussions on:
- [Hammerspoon Google Group](https://groups.google.com/forum/#!forum/hammerspoon)
- [Hammerspoon Discord](https://discord.gg/hammerspoon)
Feel free to ask questions or share your experiences with other users.
## ๐ง Troubleshooting
If you encounter issues, check the following:
- Ensure your Lua syntax is correct.
- Look for error messages in the Hammerspoon console.
- Consult the [documentation](https://hammerspoon.org) for guidance.
## ๐๏ธ Repository Topics
This repository includes various topics related to Hammerspoon, such as:
- audio-control
- automation
- battery-status
- custom-ui
- hammerspoon
- macos
- macos-tools
- mouse-events
- multimonitor
- plugin-system
- spoons
- wifi-monitoring
- window-management
- workflow-automation
These topics reflect the versatility and power of Hammerspoon in automating tasks on macOS.
## ๐ Contributing
Contributions are welcome! If you want to help improve Hammerspoon:
1. Fork the repository.
2. Create a new branch for your feature or fix.
3. Submit a pull request with a clear description of your changes.
Your contributions can help enhance the Hammerspoon experience for all users.
## ๐ Additional Resources
- [Hammerspoon Documentation](https://hammerspoon.org)
- [Hammerspoon GitHub Repository](https://github.com/Hammerspoon/hammerspoon)
- [Lua Programming Language](https://www.lua.org)
For the latest updates, check the [Releases section](https://github.com/denism8977/Hammerspoon/releases) regularly.
## ๐ Examples and Use Cases
Hammerspoon can be used in various scenarios. Here are some practical examples:
### Automating Window Layouts
You can create scripts to automatically arrange your windows based on your workflow. For example, if you often work with a code editor and a web browser, you can set up a script to position these windows side by side.
### Managing System Volume
Control your system's audio settings with a simple script. You can create hotkeys to increase or decrease volume or mute the audio entirely.
### Clipboard Management
Implement a clipboard history feature to access previously copied items. This can be helpful for users who frequently copy and paste.
### Pomodoro Timer
Use Hammerspoon to create a Pomodoro timer that alerts you when to take breaks. This can enhance productivity and focus.
## ๐ฅ๏ธ User Interface Customization
Hammerspoon allows for custom UI elements. You can create pop-up windows, notifications, and alerts that fit your workflow. This feature can help you design a personalized automation experience.
## ๐ Performance Monitoring
You can monitor system performance metrics using Hammerspoon. Create scripts to track CPU usage, memory consumption, or network activity. This information can help you optimize your system's performance.
## ๐
Scheduling Tasks
Schedule tasks to run at specific times. You can use Hammerspoon to automate daily routines, such as opening specific applications or performing backups.
## ๐ฒ Mobile Device Integration
Integrate Hammerspoon with mobile devices for seamless communication. For example, you can set up notifications to appear on your desktop when you receive messages on your phone.
## ๐ Synchronizing Settings
Synchronize your Hammerspoon settings across multiple devices using cloud storage solutions like Dropbox or Google Drive. This way, you can maintain a consistent setup regardless of the device you use.
## ๐ท๏ธ Tags and Labels
Utilize tags and labels in your scripts to organize your automation tasks. This can help you quickly identify and manage different scripts based on their functionality.
## ๐ Best Practices
- Keep your `init.lua` file organized.
- Comment your code for clarity.
- Regularly back up your scripts.
- Test scripts thoroughly before deploying them.
By following these best practices, you can maintain a clean and efficient automation setup.
## ๐จ Visual Customization
Hammerspoon allows for visual customization of your alerts and notifications. You can choose colors, fonts, and styles that match your personal preferences.
## ๐ Integrating with Other Tools
Hammerspoon can work alongside other tools and applications. For example, you can integrate it with task management apps or project management tools to streamline your workflow.
## ๐ Data Visualization
Use Hammerspoon to create data visualizations. You can display system metrics or performance data in a visually appealing format, making it easier to understand and analyze.
## ๐ Internationalization
Hammerspoon supports multiple languages. You can create scripts that adapt to different languages and locales, making it a versatile tool for users around the world.
## ๐ค Voice Commands
Integrate voice commands into your Hammerspoon setup. Use voice recognition to trigger scripts and automate tasks hands-free.
## ๐ฎ Game Integration
For gamers, Hammerspoon can enhance the gaming experience. Create scripts that automate in-game actions or manage system resources while gaming.
## ๐ Learning Resources
To further your understanding of Hammerspoon and Lua, consider exploring:
- Online courses on Lua programming.
- Tutorials on automation techniques.
- Community forums for tips and tricks.
## ๐ Keeping Up with Updates
Stay informed about updates and new features by following the official Hammerspoon channels. Regularly check the [Releases section](https://github.com/denism8977/Hammerspoon/releases) for the latest changes and improvements.
## ๐ ๏ธ Troubleshooting Common Issues
If you face issues, consider the following steps:
1. Check for syntax errors in your Lua scripts.
2. Ensure all required Spoons are installed and loaded.
3. Consult the community for advice and solutions.
By addressing common problems, you can ensure a smooth experience with Hammerspoon.
## ๐ User Feedback
User feedback is valuable for improving Hammerspoon. If you have suggestions or feature requests, feel free to reach out through the community channels.
## ๐ Future Development
The future of Hammerspoon looks promising. Developers are continually working on new features and improvements. Stay engaged with the community to keep up with the latest developments.
## ๐ Conclusion
Hammerspoon is a powerful tool for macOS users looking to automate tasks and enhance their workflow. With its Lua scripting capabilities and extensive features, it offers a flexible solution for various automation needs. Explore the possibilities and make your macOS experience more efficient.
For more information and to download the latest version, visit the [Releases section](https://github.com/denism8977/Hammerspoon/releases).