Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Porco-Rosso/PorcoSpoon
My Versatile Hammerspoon Config
https://github.com/Porco-Rosso/PorcoSpoon
Last synced: 12 days ago
JSON representation
My Versatile Hammerspoon Config
- Host: GitHub
- URL: https://github.com/Porco-Rosso/PorcoSpoon
- Owner: Porco-Rosso
- Created: 2022-02-16T21:00:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-08T12:10:51.000Z (3 months ago)
- Last Synced: 2024-08-08T14:18:53.858Z (3 months ago)
- Language: Lua
- Size: 3.74 MB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PorcoSpoon - My Versatile Hammerspoon Config
=====After having discovered the extremely powerful [Hammerspoon](http://www.hammerspoon.org/) app, and finally landing on a configuration that I am very happy with, I thought I should share it with others to enjoy. I've tried to comment `init.lua` to make it easier to understand.
I use this config together with some [Karabiner](https://karabiner-elements.pqrs.org) remapping to achieve a fast and usable config with a short learning curve.
# Features
- Reload on Save
- Hyper Key
- Additional hotkeys to switch spaces
- Window Switcher menu
- **Quick per-application window switcher (Across spaces!)**
- Rounded screen corners
- MiroWindowManager with reduced animation times
- Drag to resize and move windows
- App launcher
- Sky Rocket Spoon
- KSheet Spoon# Additional details and usage
## Hyper and hotkeys
Hyper is what people like to call a special shortcut comprised of multiple modifier keys. In this case the hyper key is the following:
Hyper = ctrl+alt+cmd
### Karabiner configuration
I've used [Karabiner](https://karabiner-elements.pqrs.org) and the default mac hotkey settings to remap the useless capslock key into something extremely powerful. If you tap capslock, it triggers “f19” which I have remapped to open [Raycast](raycast.com/). Hold it and it acts like the hyper modifier. You can find the Karabiner config for that [here](https://ke-complex-modifications.pqrs.org/#caps_lock). Perfect.### Launcher
I use Hyper + `` to either launch or switch to certain applications. This is easily configured in the init.lua file so feel free to modify it for your own use.examples:
- Hyper+V = Launch or switch to Vivaldi
- Hyper+S = Launch or switch to Slack
- Hyper+C = Launch or switch to Calendar
- Hyper+E = Launch or switch to Excel
... you get the idea### App Switcher
Many other configs online have similar features, but what is unique about this config is that if the app is already focused and you hit the key combination again, **focus will cycle through the open windows of the current application**. This works across spaces, and is really great when you have a bunch of windows open at the same time.
### Window Switcher
Thanks to the help of [dmgerman](https://github.com/dmgerman) who's code allowed me to implement my app switcher, I've also maintained his app switcher menu.- alt+b opens a switcher dialogue for all open windows
- alt+shift+b opens a switcher dialogue for all open windows for the current app
- hyper+tab switches to the last focused window### Other
- I’ve also remapped right ctrl+right/left to switch spaces left and right.
- hyper+home brings up Mission Control, but with the spaces visible automatically. This is buggy, but seems to work good enough.
- hyper+1/2/3 sets the current window to take up left quarter, center half and right quarter respectively.
- hyper+escape Centers the window on the screen
- Animations speeds are set to zero.## Spoons
### MiroWindowsManager
[MiroWindowsManager](https://github.com/miromannino/miro-windows-manager) is a great spoon to maneuver windows in a convenient fashion. Maybe one day I will graduate to a tiling window manger, but for now dragging a window to the sides will make it take up that half of the screen. Dragging to the top makes it take up the whole screen.
MiroWindowsManager also has some hotkeys mapped to it.
I use the following:- Hyper+up = Resize the window to take up the top half of the screen
- Hyper+down = Resize the window to take up the bottom half of the screen
- Hyper+right = Resize the window to take up the right half of the screen
- Hyper+left = Resize the window to take up the left half of the screen
- Hyper+f = Resize the window to take up the whole screenTapping the respective keys again does extra things, best to head to [MiroWindowsManager](https://github.com/miromannino/miro-windows-manager) page to learn more.
I have modified the code slightly to still get square windows, despite my widescreen display.![example](https://github.com/miromannino/miro-windows-manager/raw/imgs/example.gif)
### Skyrocket
The [Skyrocket Spoon](https://github.com/dbalatero/SkyRocket.spoon) allows to resize and move windows conveniently without having to grab a window by the corner of window decoration.
In my config:
- ctrl+shift allows you to move a window with the mouse
- alt+shift allows you to resize a window with the mouse.### Ksheet
[Ksheet](https://www.hammerspoon.org/Spoons/KSheet.html) Shows the current shortcuts for the active application. I have modified it for dark mode. It is toggled on and off with hyper+home.
### Rounded corners
Just the [RoundedCorners Spoon](https://www.hammerspoon.org/Spoons/RoundedCorners.html). I think it looks nice. feel free to disable to get those pixels back. Might cause burn in if you have an OLED panel, so be careful.
# Install
- Install [Hammerspoon](https://www.hammerspoon.org/)
- copy the contents of this repo into you `~/.hammerspoon` folder
- Reload the config### Spotlight/Alfred hotkey remap
Next, open up the settings app > keyboard > Shortcuts, and then remap spotlight by clicking the current shortcut and tapping capslock. If you prefer [Alfred](https://www.alfredapp.com) or [Raycast](raycast.com/), remap that in the app settings instead.---
---