Hammerspoon configuration I personally use to make macOS more productive.
- custom shortcuts
- battery status notifications
- window tiling hotkeys
- window moving to other spaces
First up, install Hammerspoon if you haven't already.
Follow the installation instructions for the required Spaces Module.
Then clone (or copy) hammerspoon-dotfiles
into your hammerspoon directory:
cd $HOME/.hammerspoon
git clone https://github.com/reybok/hammerspoon-dotfiles .
-
Settings > Mission Control: disable
Automatically rearrange Spaces based on most recent use
-
Settings > Mission Control: enable
Displays have separate Spaces
-
Settings > Keyboard > Shortcuts: enable Mission Control > Switch to Desktop
n
and set the hotkey to mod+[n] (see chapter Quick Start)
To update to the latest configuration, pull from git:
cd $HOME/.hammerspoon
git pull
There are several branches that accompany a short introductory talk (download as PDF) I held in 2017.
Checkout tutorial01
, tutorial02
, and tutorial03
as you go along to see the incremental evolution. Finally, for space manipulation, check out the tutorial04
branch.
The default modifier (base key for every action) is ⌘.
To change that, edit the globals.lua
file found in ~/.hammerspoon/
.
The default modifier is abreviated with mod in the following list.
Key explanation:
^ : ctrl
⌥ : alt
⌘ : cmd
⌫ : delete
mod+⇧+↩ : open new iTerm2 window
mod+⇧+← : move window to left half
mod+⇧+→ : move window to right half
mod+⇧+↑ : move window to top half
mod+⇧+↓ : move window to bottom half
mod+⇧+M : maximize window
mod+⇧+⌫ : return window to its size and position it was before using any hotkeys on it
mod+⇧+1 : move window to space 1
mod+⇧+2 : move window to space 2
mod+⇧+3 : move window to space 3
mod+⇧+4 : move window to space 4
mod+⇧+5 : move window to space 5
mod+⇧+6 : move window to space 6
⌘+⌥+^+R : reload hammerspoon config
⌥+^+7 : emit ⌘+\ , which is used to line comment code in jetbrains products on German keyboards
^+n : Focus Chrome and switch to profile n
, who can be defined in chrome.lua
.
^+4 : Open incognito window
MIT License
Copyright (c) 2017 Jakob Niemeyer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.