Coder Social home page Coder Social logo

alfred2-layout's Introduction

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". This only works if you have UI scripting enabled: 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.