Skip to content

Hammerspoon configuration I personally use to make macOS more productive

License

Notifications You must be signed in to change notification settings

reybok/hammerspoon-dotfiles

Repository files navigation

hammerspoon-dotfiles

Hammerspoon configuration I personally use to make macOS more productive.

Features

  • custom shortcuts
  • battery status notifications
  • window tiling hotkeys
  • window moving to other spaces

Installation

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 .

Enable Spaces Support

  • Settings > Mission Control: disable Automatically rearrange Spaces based on most recent use

  • Settings > Mission Control: enable Displays have separate Spaces Screenshot Mission Control Settings

  • Settings > Keyboard > Shortcuts: enable Mission Control > Switch to Desktop n and set the hotkey to mod+[n] (see chapter Quick Start) Screenshot Keyboard Shortcuts

Updating

To update to the latest configuration, pull from git:

cd $HOME/.hammerspoon
git pull

Tutorial

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.

Quick Start

The default modifier (base key for every action) is . To change that, edit the globals.lua file found in ~/.hammerspoon/.

Hotkeys

The default modifier is abreviated with mod in the following list.

Key explanation:

^ : ctrl

: alt

: cmd

: delete

Window Resizing

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

Window Moving

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

Development

++^+R : reload hammerspoon config

+^+7 : emit +\ , which is used to line comment code in jetbrains products on German keyboards

Chrome Profile Switching

^+n : Focus Chrome and switch to profile n, who can be defined in chrome.lua.

^+4 : Open incognito window

License

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.

About

Hammerspoon configuration I personally use to make macOS more productive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages