Skip to content

windvalley/dot-hammerspoon

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Repository files navigation

dot-hammerspoon

dot-hammerspoon is my personal configuration for Hammerspoon, and you can modify to suit your needs and preferences.

Features

  • Application quick launch or switch.
  • Application window manipulation, such as movement, stretch or shrink, change position, etc.
  • Quickly switch to the specified input method.
  • System management, such as lock screen, restart system, etc.
  • 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 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:

cd ~/.hammerspoon && git pull

Usage

Toggle keybindings cheatsheet

+ /

Switch to the specified input method

  • + 1: ABC
  • + 2: Pinyin

System Manage

  • + Q: Lock Screen
  • + S: Start Screensaver
  • + R: Restart Computer
  • + S: Shutdown Computer

Application launch or switch

  • + H: Hammerspoon Console
  • + F: Finder
  • + I: Alacritty
  • + C: Chrome
  • + N: YNote
  • + M: Mail
  • + P: Postman
  • + E: Excel
  • + V: VSCode
  • + W: WeChat

Window manipulation

  • + =: Stretch Outward

  • + -: Shrink Inward

  • + C: Center Window

  • + M: Max Window

  • + H: Left Half of Screen

  • + L: Right Half of Screen

  • + K: Up Half of Screen

  • + J: Down 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

  • + 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

  • + K: Move Upward

  • + J: Move Downward

  • + H: Move Leftward

  • + L: Move Rightward

  • + M: Minimize All Windows

  • + U: Unminimize All Windows

  • + Q: Close All Windows

  • + K: Bottom Side Stretch Upward

  • + J: Bottom Side Stretch Downward

  • + H: Right Side Stretch Leftward

  • + L: Right Side Stretch Rightward

Keybindings Customization

Modify the file ~/.hammerspoon/shortcuts_config.lua according to your keystroke habits.

Acknowledgments

License

This project is under the MIT License. See the LICENSE file for the full license text.