I have one suggestion for the Apple team that works on Spaces and window management: Get a big ass monitor. It’s a gorgeous 38" display that makes me feel like I’m working on a space ship. It was surprisingly hard to adapt to so many pixels but I’m loving almost everything about it. Each of these windows is about the size of a 13" monitor: Here’s what a 38 inch monitor looks like. With so many pixels on screen dragging a window is very inefficient, which kills the utility of window snapping tools like Magnet or even BetterSnapTool and it’s big sister BetterTouchTool. 1 When a window is on the right side of a 38" monitor and I want it snapped to the upper left corner, a mouse is the wrong tool. I keep Moom running for occasional assistance but I decided I wanted to dive into the new Keyboard Maestro and some KM programming. I’d like a set of keyboard shortcuts for moving windows around a grid on a large monitor. The keyboard shortcuts should let me move a window between the spaces on the grid. It should also let me instantly resize a window that is not yet positioned on the grid so that it is. Keyboard Maestro has three powerful features that I planned to use: One keyboard shortcut should allow me to cycle a window between all of the grid frames. Keyboard Maestro also comes with some examples for moving windows but none of them were what I wanted. Plus, I wanted to refresh some of my KM programming knowledge. I familiarized myself with the Keyboard Maestro actions and got to work planning. Resize and move the window to the grid position that the left corner is in.Figure out which grid location our window’s top left corner is sitting in.Chop the coordinates up into a lower and upper half as well as vertically sliced thirds.What are the visible coordinates of the main screen.When a window is just randomly thrown on screen I want a shortcut to make it fall in line with my grid. I used Keyboard Maestro to help me figure out the grid coordinates. First up, I needed to know the coordinates of the visible screen. This is important because I don’t want to try to move a window under the menu bar. I used the %ScreenVisible%Main% token to get the coordinates of the visible screen. There are a few additional KM screen calculations: As you can see below the coordinates are 0,25,3840,1575. These are all saved to variables that represent specific X & Y regions of the screen. I think the neat thing about this is the KM %Calculate% function. It’s handy because it can calculate specific values of a screen or window. For example, %Calculate%VarMainScreenVisible.Width/3% calculates the Width of the screen divided by three. No need to add another action to do the math or to extract the width from the overall array of dimensions. Now we start figuring out where our current front window is on the screen. Let’s start doing some logical tests of the window relative to the screen. This uses the Keyboard Maestro IF flow control. If the top corner of our front window is above the mid point of the screen then we probably want to snap to the top of the screen. If it’s below the midpoint then we want to snap to the bottom of the screen. Now let’s figure out which third of the screen our current front most window is in.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |