Skip to content

untoldwind/alfred2-layout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 

Repository files navigation

!!!Looking for new owner/maintainer!!!

I kind of gave up on Apple as they no longer provide the Hardware I want/need and switched to Linux which already has several very powerful tiling window-managers (i3, xmonad, awesome ...).

I'll do my best to maintain this project for the time being. But since I no longer actively use it myself bug-fixing will be somewhat slow.

Alfred 2 layout workflow

A simple window layouter based on an Alfred 2 workflow.

Installation

Experimental

Also via Packal:

Description

The workflow itself is quite simple just typ in the keyword "lay" (or chose another of your liking) followed by:

  • full = Maximize
  • left, right, top, bottom = Halves of screen
  • topleft, topright, bottomleft, bottomright = Quaters of screen
  • center = Center of screen (with 10% border)
  • 11,12,13,21,22,23,31,32,33 = Thrids of screen
  • 11-12,11-13,11-21,11-22 ... = Some other sizes based on thrids
  • togglefullscreen = Toggle full screen mode of active window (if possible)
  • movecenter = Move window to center of screen (no resize)
  • movetopleft, movetopright, movebottomleft, movebottomright = Move window to edges of screen (no resize)
  • grow, shrink = resize window by 1/6 of screen size with sticky screen edges
  • ... well the script is quite flexible, so I'm waiting for suggestions

It is multi-screen-able. Even though you cannot move windows from one screen to another (yet?) the scripts tries to figure out with screen you mean (depending on the size of the visible area).

Additional notes for the Mavericks version

The Mavericks version now additionally support the "layother" keyword that moves and layout the current window to the other/next screen.

Examples:

  • layother full = Move the current window to the other screen full size
  • layother topleft = Move the current window to the top-left quarter of the other screen
  • ... and so on

Screenshots

Screenshot1 Screenshot2

Implementation notes

  • The script is written in python using PyObjC and the ScriptingBridge. This should be no problem as both is shiped as part of MacOS since 10.5.
  • It the application supports scripting, the window is moved "directly". Unluckily some Applications do not support this, so there is a fallback using "SystemEvents". his workflow only works if Alfred is included in the list of Accessibility applications, which can be found under System Preferences > Security & Privacy > Privacy > Accessibility (in previous MaxOS Versions this was done via Graphic User Interface (GUI) Scripting)
  • At the moment there are no hotkeys defined, which should be straight forward though ...

Hacking

If you are keen on adventures feel free to tweak the workflow any way you like. As a starter refer to the following wiki pages:

Also take a look at the corresponding thread on the Alfred forums: http://www.alfredforum.com/topic/3154-yet-another-window-layout-workflow

Licence

MIT Licence