This combination of keys might also be mapped to a single key by virtue of Karabiner, a cool program allowing arbitrary key remappings and much much. I also define that I want a window grid size of 2x2, with no margins: local hyper = I use a set of modifier keys for all of the hotkeys, let's call that set hyper. So let's have a look at that:įirst, Hammerspoon's config resides in the file ~/.hammerspoon/a. For me, these are arranging windows grid-like on screen and have e.g. However, if you have about 30min at hand, you can already hammer out a nice configuration for the things that are most important for you to automate or hotkey. The configuration (it basically comes with no defaults) can be a bit daunting in the beginning - in fact, I had stumbled upon Hammerspoon already some time ago but didn't invest the effort back then. The following code snippets have been heavily inspired (read: copied) by philipalexander's, tstirrat's and cmsj's Hammerspoon configs on Github and also by Tristan Hume's post on configuring Mjolnir, of which Hammerspoon is a fork. if Thunderbolt Display connected, put Xcode on that one and Mail on the internal one) watch the name and number of screens connected and position windows accordingly (e.g.unmount USB devices upon switching to battery power.switch sound on or off, depending on the available wifi networks.Just some examples of what you can do with Hammerspoon: Not only can you access that single API, but also check for USB devices, Wifi names, attached screens and so on - all controlable with small Lua scripts. nudge a window a bit to the right.Įnter Hammerspoon: First and foremost, Hammerspoon provides you with scriptable access to OSX's accessibility API - and whatever you do with that, you can bind to a hotkey. Lately I've been using Magnet (formerly known as Window Magnet, App Store, $4.99), which is pretty nice but I felt it is not using the concept of moving stuff around with the keyboard to the full extent: While you can surely put windows in one quadrant of the screen or something, there's no option to e.g. Lots of people! You can find out more on our Contributors page.Being a big fan of using the keyboard for everything and not touching the mouse more than necessary, I went through different OSX helper applications for helping to move windows around, aligning them on screen, etc. If you find a bug, or have a suggestion, you can also file an issue on the issue tracker. We have a Discord server to chat about Hammerspoon. For more information, see the contribution guidelines on GitHub.īugs found on can be reported on GitHub Where can I get help? They can either be pure Lua scripts that offer useful helper functions, or you can write Objective-C extensions to expose new areas of system functionality to users. More extensions will always be a huge benefit to Hammerspoon. You can learn more about the Lua scripting language at lua.org. If you are new to Hammerspoon, read the Getting Started Guide with reference to the full API documentation. You will need to create a Lua script in ~/.hammerspoon/a using our APIs and standard Lua APIs. Out of the box, Hammerspoon does nothing. If you are using an older Mac which is not running a recent version of macOS, please consult our Release Notes for a version which is compatible with your system. How do I install it?ĭownload the latest release and then drag the application to /Applications/. You might want to do something crazy like have iTunes automatically start playing when your Mac detects you are in Paris. You might want to display an alert when your battery drops below a certain percentage. You might want to run a series of commands when your wifi interface connects to your home network. You might want to bind a keyboard shortcut to a series of window operations, or an applescript. Typically you would write a configuration file in Lua that connects events to actions. If you want to explore the options Hammerspoon offers, check out the Getting Started Guide and the full API documentation as well as the already pre-made plugins called Spoons. You can write Lua code that interacts with macOS APIs for applications, windows, mouse pointers, filesystem objects, audio devices, batteries, screens, low-level keyboard/mouse events, clipboards, location services, wifi, and more. What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user. At its core, Hammerspoon is just a bridge between the operating system and a Lua scripting engine. This is a tool for powerful automation of macOS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |