

This is shown in our example above, which will place the iTunes Mini Player window at the very bottom left of the screen, even if the dock is there. The sixth item is similar to the fifth, except it does take the OS menubar and dock into account. The fifth item is a rect that will be given to hs.window:setFrame() and should specify the position/size values as pixel positions on the screen, but without the OS menubar and dock taken into account.

Open the Hammerspoon API docs in your browser, to explore the extensions we provide, and the functions they offerĪll good programming tutorials start with a Hello World example of some kind, so we will use Hammerspoon’s ability to bind keyboard hotkeys to demonstrate saying Hello World with a simple notification.Click on the Hammerspoon menu bar icon and choose Open Config from the menu.Run Hammerspoon.app and follow the prompts to enable Accessibility access for the app.
#Cursor right hammerspoon download#
Download the latest release of Hammerspoon and drag it to your /Applications folder.If you have never programmed in Lua before, you may want to run through Learn Lua in Y minutes before you begin. It bridges various system level APIs into a Lua scripting engine, allowing you to have powerful effects on your system by writing Lua scripts. Hammerspoon is a desktop automation tool for macOS. If those are different, change the name in the Hammerspoon a configuration to be aligned with the name in the Spoons folder.Getting Started with Hammerspoon What is Hammerspoon? spoon extension).įor example, if the name in the init script is "ShiftIt", the Spoon in the ~/.hammerspoon/Spoons folder should be ShiftIt.spoon. Make sure that the Spoon name, provided in installation step 3 matches with the folder name in ~/.hammerspoon/Spoons (without the. If Hammerspoon prints errors during initialisation, like "attempt to index nil value" from Hammerspoon's init script ( ~/.hammerspoon/a), the ShiftIt spoon may have been misconfigured. "attempt to index nil value" error during startup If after installation you run into errors like attempt to index a nil value, please make sure to verify that Hammerspoon has the right permissions on your Mac. Known issues "attempt to index nil value" error while using shortcuts
#Cursor right hammerspoon full#
ctrl(^) + alt(⌥) + cmd(⌘) + = Make current window biggerĬtrl(^) + alt(⌥) + cmd(⌘) + F Toggle full screen for current windowĬtrl(^) + alt(⌥) + cmd(⌘) + Z Toggle zoom for current windowĬtrl(^) + alt(⌥) + cmd(⌘) + N Move current window to next screenĬtrl(^) + alt(⌥) + cmd(⌘) + P Move current window to previous screen.ctrl(^) + alt(⌥) + cmd(⌘) + - Make current window smaller.ctrl(^) + alt(⌥) + cmd(⌘) + C Centralize current window.ctrl(^) + alt(⌥) + cmd(⌘) + M Maximise current window.ctrl(^) + alt(⌥) + cmd(⌘) + 4 Snap current window to the right bottom quarter to the screen.ctrl(^) + alt(⌥) + cmd(⌘) + 3 Snap current window to the left bottom quarter to the screen.ctrl(^) + alt(⌥) + cmd(⌘) + 2 Snap current window to the right top quarter to the screen.ctrl(^) + alt(⌥) + cmd(⌘) + 1 Snap current window to the left top quarter to the screen.ctrl(^) + alt(⌥) + cmd(⌘) + down Snap current window to the bottom half to the screen.ctrl(^) + alt(⌥) + cmd(⌘) + up Snap current window to the top half to the screen.ctrl(^) + alt(⌥) + cmd(⌘) + right Snap current window to the right half to the screen.ctrl(^) + alt(⌥) + cmd(⌘) + left Snap current window to the left half to the screen.Having issues? Check out the Known issues section, have a look in the issues section, or create a new issue. The ShiftIt spoon is now ready to use, enjoy. Override key mappings allows you to override the default key bindings.Multiple window cycle sizes allows you to override the default 50% window size for snapping to sides and corners.Step 5 (optional)Ĭonfigure the Shiftit spoon to your preference. If you just enabled permissions for Hammerspoon, you might need to restart the application for the permissions to take effect. Go to System Preferences > Security & Privacy > Accessibility and make sure Hammerspoon.app is checked. Without those permissions, it can't move and modify windows. Make sure Hammerspoon has the 'Accessibility' permissions. Click on the Hammerspoon menubar icon again, and click on 'Reload Config'.
