crospot.blogg.se

Hammerspoon window
Hammerspoon window





  1. #Hammerspoon window how to
  2. #Hammerspoon window series
  3. #Hammerspoon window windows

If you’re alright with a key doing only one thing then it can be greatly simplified.Hammerspoon boasts two things: a truly epic project name and a lua scripting environment that hooks into extensions that allow you to control system functionality in macOS. Keep in mind that this cycles through the “units”. It turns out you place a # in front of the list.

#Hammerspoon window how to

The only Lua difficulty I had came in finding how to get the length of units. Most of the unknowns involve getting to know how Hammerspoon handles window placement (i.e. There are a couple of lines in there that might be confusing but the gist of it should be easy to follow. new ( unit ): fromUnitRect ( screen : frame ()): floor () return windowGeo : equals ( geo ) end ) if index = # units then index = 0 end window : moveToUnit ( units ) end ) end ) find ( units, function ( unit ) index = index + 1 local geo = hs. focusedWindow () local windowGeo = window : frame () local index = 0 hs. each ( grid, function ( entry ) bindKey ( entry.

hammerspoon window

I made a short helper function to avoid having to retype my modifier combo. The others use a simple percentage ranging from 0 to 1. You’ll notice that Hammerspoon, hs, provides some predefined positions like left50. To do this I created a list of possible positions. The k in the middle puts the window in the center of the screen.Ī second press maximizes the window and repeated presses once again cycle the options.

#Hammerspoon window windows

The corners of the grid do what you might expect and move windows to the top left quarter of the screen, top right quarter, bottom left quarter, and bottom right quarter. Using i sends the window to the top half and, to the bottom half. Left and right are two of my most used positions. The right side works the same way using l. Pressing again and again cycles the options. One more press and the window occupies one-third of the left side. The first press makes the window take up half of the screen.Īnother press and it will take up two-thirds of the screen. To send a window to the left side of the screen, I press the modifier combo and j. Moving the focused window works on a grid of keys with k at the center. I don’t have a particularly complex setup.īut what I do have are a very particular set of keys, keys that I have become acquainted with over my career.įor a modifier I use a combination of Ctrl and ⌘. Only enough to glue some interfaces together.Īt no point in my Hammerspoon progression was Lua the bottleneck. It turns out you don’t really have to know Lua. I decided that it would be good to know Lua and I could always cut and run if it got too bad. I thought that the effort here might be too high. I was going to have to learn the Hammerspoon interfaces and Lua.Įvery project has an effort to reward ratio. I’d never worked with Lua before Hammerspoon. Hammerspoon hands you Lua and figures if you want to burn the house down it was yours to begin with.

hammerspoon window

#Hammerspoon window series

Slate’s configuration is done through a series of directives. Its power comes from letting you use Lua itself to script them together. Its reach comes from a series of interfaces written in Lua. Hammerspoon is a framework for total system control.

hammerspoon window hammerspoon window

It can also watch your USB port, inspect your WiFi, manage audio, control Spotify, and the list goes on. Oh, don’t get me wrong, it can manage windows. Hammerspoon bills itself as, “a tool for powerful automation of OS X.” While looking for a replacement I stumbled across something new. Only it hasn’t been updated since early 2013. Slate is a window management application similar to Divvy and SizeUp (except better and free!).įor a long time Slate did everything I wanted. There’s no shortage of applications claiming to fix windowing and increase productivity.īefore long I realized my windows ended up in the same places. I want to move windows around with ease and precision. Window management on OS X is… well… not a strong point. Switching From Slate to Hammerspoon 2016.02.16 03:44 AM UTC







Hammerspoon window