Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/windvalley/dot-hammerspoon
My personal configuration for amazing Hammerspoon.
https://github.com/windvalley/dot-hammerspoon
application-launcher automation hammerspoon hotkeys macos osx shortcuts window-manager
Last synced: 5 days ago
JSON representation
My personal configuration for amazing Hammerspoon.
- Host: GitHub
- URL: https://github.com/windvalley/dot-hammerspoon
- Owner: windvalley
- License: mit
- Created: 2022-12-18T14:16:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T11:37:51.000Z (11 months ago)
- Last Synced: 2023-12-14T12:46:27.088Z (11 months ago)
- Topics: application-launcher, automation, hammerspoon, hotkeys, macos, osx, shortcuts, window-manager
- Language: Lua
- Homepage:
- Size: 78.1 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ![sre.im](https://sre.im/favicon-64.png)dot-hammerspoon
![Language](https://img.shields.io/badge/language-Lua-orange)
![Platform](https://img.shields.io/badge/platform-macOS-lightgrey)
[![Version](https://img.shields.io/github/v/release/windvalley/dot-hammerspoon?include_prereleases)](https://github.com/windvalley/dot-hammerspoon/releases)
[![LICENSE](https://img.shields.io/github/license/windvalley/dot-hammerspoon)](LICENSE)
![Page Views](https://views.whatilearened.today/views/github/windvalley/dot-hammerspoon.svg)`dot-hammerspoon` is my personal configuration for [Hammerspoon](http://www.hammerspoon.org/), and you can modify to suit your needs and preferences.
## Features
- Application quick launch or hide.
- Application window manipulation, such as moving, resizing, changing position, etc.
- System management, such as lock screen, restart system, etc.
- Auto switch input method according to the application.
- Switch to the specified input method.
- Open the specified website directly.
- Toggle the keybindings cheatsheet.
- Keep the desktop wallpaper the same as the bing daily picture.
- Auto reload configuration when lua files changes.
- The code structure is clear and easy to customize into your own configuration.## Installation
1. Install [Hammerspoon](http://www.hammerspoon.org/) first: `brew install hammerspoon --cask`
2. Run `Hammerspoon.app` and follow the prompts to enable Accessibility access for the app.
3. `git clone --depth 1 https://github.com/windvalley/dot-hammerspoon.git ~/.hammerspoon`
Keep update:
```sh
cd ~/.hammerspoon && git pull
```## Usage
### Toggle Keybindings Cheatsheet
![toggle-keybindings-cheatsheet](https://user-images.githubusercontent.com/6139938/213378139-2d005ac0-bce3-4798-a8b5-e2c23fd5817c.gif)
⌥ + /
### Switch to the specified Input Method
- ⌥ + 1: ABC
- ⌥ + 2: Pinyin### System Management
- ⌥ + Q: Lock Screen
- ⌥ + S: Start Screensaver
- ⌃⌥⌘⇧ + R: Restart Computer
- ⌃⌥⌘⇧ + S: Shutdown Computer### Website Open
- ⌥ + 8: github.com
- ⌥ + 9: google.com
- ⌥ + 7: bing.com### Application Launch or Hide
![application-launch](https://user-images.githubusercontent.com/6139938/213380921-4a8a891f-3476-4160-a23d-afd402f53c46.gif)
- ⌥ + H: Hammerspoon Console
- ⌥ + F: Finder
- ⌥ + I: Alacritty
- ⌥ + C: Chrome
- ⌥ + O: Obsidian
- ⌥ + D: Draw.io
- ⌥ + K: Freeplane
- ⌥ + N: YNote
- ⌥ + M: Mail
- ⌥ + P: Postman
- ⌥ + E: Excel
- ⌥ + V: VSCode
- ⌥ + W: WeChat### Window Manipulation
#### Window Position
![window-position](https://user-images.githubusercontent.com/6139938/213381748-31c10324-aee6-48d4-9ec7-492611fac499.gif)
- ⌃⌥ + C: Center Window
- ⌃⌥ + K: Up Half of Screen
- ⌃⌥ + J: Down Half of Screen
- ⌃⌥ + H: Left Half of Screen
- ⌃⌥ + L: Right Half of Screen- ⌃⌥ + U: Top Left Corner
- ⌃⌥ + I: Top Right Corner
- ⌃⌥ + O: Bottom Left Corner
- ⌃⌥ + P: Bottom Right Corner- ⌃⌥ + Q: Left or Top 1/3
- ⌃⌥ + W: Right or Bottom 1/3
- ⌃⌥ + E: Left or Top 2/3
- ⌃⌥ + R: Right or Bottom 2/3#### Window Resize
![window-resize](https://user-images.githubusercontent.com/6139938/213382832-7f326b87-a704-441d-aa56-9c016f2072cc.gif)
- ⌃⌥ + M: Max Window
- ⌃⌥ + =: Stretch Outward
- ⌃⌥ + -: Shrink Inward- ⌃⌥⌘⇧ + K: Bottom Side Stretch Upward
- ⌃⌥⌘⇧ + J: Bottom Side Stretch Downward
- ⌃⌥⌘⇧ + H: Right Side Stretch Leftward
- ⌃⌥⌘⇧ + L: Right Side Stretch Rightward#### Window Movement
![window-movement](https://user-images.githubusercontent.com/6139938/213383576-facc8b81-a94f-4124-b0a1-409d23261421.gif)
- ⌃⌥⌘ + K: Move Upward
- ⌃⌥⌘ + J: Move Downward
- ⌃⌥⌘ + H: Move Leftward
- ⌃⌥⌘ + L: Move Rightward#### Window Monitor
- ⌃⌥ + UP: Move to Above Monitor
- ⌃⌥ + DOWN: Move to Below Monitor
- ⌃⌥ + LEFT: Move to Left Monitor
- ⌃⌥ + RIGHT: Move to Right Monitor
- ⌃⌥ + SPACE: Move to Next Monitor#### Window Batch
- ⌃⌥⌘ + M: Minimize All Windows
- ⌃⌥⌘ + U: Unminimize All Windows
- ⌃⌥⌘ + Q: Close All Windows## Keybindings Customization
Modify the file `~/.hammerspoon/keybindings_config.lua` according to your keystroke habits.
## Some Useful Shortcuts Come With macOS
More details
### Desktop
- ⌃ + RIGHT: Switch to right desktop
- ⌃ + LEFT: Switch to left desktop
- ⌃ + UP: Toggle tiling windows
- ⌥⌘ + D: Toggle dock### Application
- ⌘ + Q: Close app
- ⌘ + ,: Open the app's preferences
- ⌘⇧ + /: Toggle help### Window
- ⌘ + H: Hide window
- ⌘ + M: Minimize window
- ⌘ + N: New window
- ⌘ + W: Close window
- ⌘ + \`: Switch between windows of the same application
- ⌃⌘ + F: Toggle window fullscreen
- ⌃⌘ + H: Hide all windows except the current one### Window Tab
- ⌘⇧ + [: Switch to the left tab
- ⌘⇧ + ]: Switch to the right tab
- ⌘ + NUMBER: Switch to the specified tab
- ⌘ + 9: Switch to the last tab### Cursor
- ⌃ + P: Move the cursor up
- ⌃ + N: Move the cursor down
- ⌃ + B: Move the cursor back/left
- ⌃ + F: Move the cursor forward/right
- ⌃ + A: Move the cursor to the beginning of the line
- ⌃ + E: Move the cursor to the end of the line### File
- ⌘ + BACKSPACE: Delete the selected file
- ⌘ + DOWN: Go to a directory or open a file
- ⌘ + UP: Back to the upper level directory
- ⌘⇧ + BACKSPACE: Clear the Trash### Others
- ⌘ + +: Expand font size
- ⌘ + -: Shrink font size
- ⌘ + 0: Reset font size- ⌘ + Z: Undo
- ⌘⇧ + Z: Redo
- ⌘ + C: Copy
- ⌘ + V: Paste
- ⌘⌥ + V: Paste and delete the original object## Acknowledgments
- [Hammerspoon](https://github.com/Hammerspoon/hammerspoon)
- [awesome-hammerspoon](https://github.com/ashfinal/awesome-hammerspoon)
- [KURANADO2/hammerspoon-kuranado](https://github.com/KURANADO2/hammerspoon-kuranado)## License
This project is under the MIT License.
See the [LICENSE](LICENSE) file for the full license text.