This moves the current window to the right half of the screen. This moves the current window to the left half of the screen. This moves the current window to the right 2/3 of the screen. This moves the current window to the left 1/3 of the screen. If caffenate is active, red "zzz" will be shown. If the AnyBar workflow and program are installed, then an indicator is shown. This nudges the current window to the right. This nudges the current window to the left. This opens the Hammerspoon console to the foreground. This tells Hammerspoon to reload the configuration file. This will work for all versions newer than version 1.4. This will upgrade the hammerspoon configuration file instead of writing the main config file. The original is backed up into the users home directory as hs.orig. After that, everything should just work.Ĭonfigure Hammerspoon with the configuration file that this workflow needs. Once installed, run the "hs:install" to set the configuration file this workflow expects and reload Hammerspoon. Follow this layout and you can do many neat things with Hammerspoon.įirst off, download Hammerspoon from. This is just a sample of the things that can be done. This workflow is for running scripts using Hammerspoon to control your windows. Installing Hammerspoon is much simpler without any external modules needing to be installed. It appears that Hammerspoon is a fork of Mjolnir, so their configs are rather similar.This is a direct port of my Mjolnir Workflow. You can get fairly extensive: example Hammerspoon config.Īlso, if you want an alternative to Hammerspoon with what looks like a more modular approach, check out Mjolnir. I’m looking forward to seeing what else I can do with Hammerspoon. My full configs are available in my dotfiles (if I make any further tweaks or add more functionality): hammerspoon configs This does have something of a memory leak (in that it never clears up closed windows), but the amount should be small enough that it doesn’t overly matter.Īnd that’s it. The other interesting bit is the aerosnap_save_window function, which allows you to restore the size of a window you had just maximized. Saved_window_sizes = nil end end)īasically, I took the same functionality that they had in the demo and factored out the functionality that gets the current window / sets the new sizes. If old_bounds ~= nil then aerosnap_move_window(old_bounds.x, old_bounds.y, old_bounds.w, old_bounds.h) Saved_window_sizes = saved_window_sizes or, "Down", function() Local window, frame, bounds = aerosnap_get_parameters()Įnd - Save the current window's position so we can restore it function aerosnap_save_window() Aerosnap helper functions to get and set current window parameters function aerosnap_get_parameters()Įnd - Aerosnap help to move a window to a specified position function aerosnap_move_window(x, y, w, h) hammerspoon/aīase code, handles reloading, locking, and loading modules With unusually precient timing, Lifehacker posted an article about Hammerspoon: Hammerspoon Is Powerful, Free Automation Tool for OS XĪfter a bit of digging, I found that their Getting Started document actually has an example that does exactly what I want to do: Window sizing Shiny!Ī bit of tweaking and this is what I ended up with. If you don’t particularly want to tweak the functionality and just want AeroSnapesqe functionality, this is probably a good enough option. It actually has exactly the functionality that I wanted and was configurable enough that I could tweak the keybindings to what my fingers already expected them to be. The first thing that I stumbled across was ShiftIt. Since I use only a tiny fraction of the functionality, I decided to see if there were other options. Unfortunately (for me, it’s a good move for them), the author(s) of BetterTouchTool are now moving to a paid model. Specifically the ability to use a keyboard shortcut to move windows to the left/right half of a monitor.įor a while, BetterTouchTool provided that functionality for me, among it’s many (many) other options. One bit of functionality that I’ve been missing though is AeroSnap. Relatively recently, I switched my last Windows machine over to OSX.
0 Comments
Leave a Reply. |