![]() ![]() If the application has only one window, it will simply bring it to the front. It will then put all the windows back to their original position and bring the one selected to the foreground. When an application is selected, it will show all of it's windows in a matrix on the screen and ask the user for the coordinates of the one to show. This gives other workflows or scripts the ability to interact with Hammerspoon through Alfred. There is also an external trigger HammerspoonCommand that will pass whatever is sent in the trigger to Hammerspoon using the command processor as in "hs:command". Type in a command string and it will be sent to Hammerspoon directly! There is also a hotkey set to this value as an example. Therefore, to move the current window to the upper left most block in a 3x3 matric, you would do "hs:setgrid 0, 0, 1, 1". This requires you to put the x, y for a starting position in a 3x3 matrix for the current window. This snaps the current window to the closes grid box area. 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. It shows greyed "zzz" when caffienate is disabled and red "zzz" if enabled. If the AnyBar workflow and program is installed properly, a caffienate status bar is now available. 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 properly for all releases higher than 1.4. This will upgrade the installation instead of writing over the users code. 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, reload Hammerspoon and run the "hs:install" to set the configuration file this workflow expects. 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. A popular solution is to define super to be, and then define a rarely used key such as capslock to emulate pressing all three of those keys, effectivly giving you another modifier key.This is a direct port of my Mjolnir Workflow. One downside to these kind of custom keybindings is the risk of colliding with other application or OS hotkeys. I like Hammerspoon because scripts you write against APIs easier to adapt to your exact workflow needs than the configuration of a limited set of features like you get from system settings or most window management software. bind (super, "s", toggleWindowFocus ( "Spotify" ) ) bind (super, "a", toggleWindowFocus ( "Messages" ) ) bind (super, "r", toggleWindowFocus ( "Slack" ) ) bind (super, "e", toggleWindowFocus ( "Google Chrome" ) ) bind (super, "w", toggleWindowFocus ( "Code" ) ) bind (super, "q", toggleWindowFocus ( "iTerm2" ) ) new (windowName ) : getWindows ( ) if hs. focusedWindow ( ) function toggleWindowFocus (windowName ) return function ( ) Relevant section of my hammerspoon script: I think this pattern is less popular than it should be, because of how well suited it is to clean navigation between the half-dozen tools you use most often.įor me, that means using Hammerspoon (a lua API for Mac OS) to make a single set of hotkeys. I think that people commonly use ⌘+tab or alt+tab to cycle through their windows, which is better than using a mouse, but still results in an unconscious overhead many times per day, often at the moment you’re moving from one thought to another and most susceptible to distraction.Ī very clean solution is to set up “absolute” hotkeys that will always bring you to the window you need, versus the “relative” navigation of tabbing or of window management systems. One aspect of using computers that I don’t enjoy is the feeling of fumbling through many windows to find the information or tool you need. “First Order Retrievability” is the idea that the tools you use most should be directly accessible from your workspace, and able to be used without opening drawers, unzipping bags, or fuddling with your desktop manager. It’s a pointless delay that wrecks my pace-and mood.” ^ I despise not having the right tool or, worse, knowing I have it but not being able to find it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |