Table of Contents generated with DocToc
Hammerspoon lets you automate Mac OSX tasks. I use it to save and restore window arrangements using a hotkey combo. To set it up:
brew install hammerspoon
- Download ArrangeDesktop spoon
- Save the script below into
~/.hammerspoon/init.lua
- Go to Hammerspoon menu (Hammer icon) and reload config
- Now you can hit the key combo below and get the menu!
-- Download the spoon from https://github.com/Hammerspoon/Spoons/blob/master/Spoons/ArrangeDesktop.spoon.zip
-- If you hit the hotkey pop up menu allows you to set new configuration or load one. Hit ESC to exit
spoon = hs.loadSpoon("ArrangeDesktop")
if spoon then
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "D", function()
local m = hs.menubar.new()
local items = spoon.addMenuItems()
m:setMenu(items)
m:popupMenu({x = 100, y = 100})
end)
else
hs.alert("Please download ArrangeDesktop spoon!")
end