Donnerstag, 4. Februar 2010

iTile - the Window Manager

Windows 7 has introduced a new feature: Drag a Window to the Side of the screen to arrange it at this side.  This is a really nice feature, and something like this is not found on the mac. Sometimes the window management on a mac is really weird. Developers like Irradiated Software know this and provide solutions for window managing. But Cinch and SizeUp are too expensive for what they do in my opinion. And TwoUp does not provide FullScreen or multi Monitor Support.

So I googled a little, and wrote some code. I was heaviliy inspired by the programs named above. And several Google Results did really help me (see References).

Usage
iTile can be found under www.jaak.de/andi/itile/itile.zip. The Archive contains an applescript and a Spark Library. I really recommend you to download Spark and import the Library file from the archive.
This way you can set up itile with ease in under five minutes.

Shortcuts in the Spark Library
The Spark Library provides you with several Shortcuts, similar to TwoUp:

  • Control+Option+Command+Right/Left/Up/Down arranges the frontmost window at this Side of the Screen
  • Control+Option+Command+Space maximizes the frontmost window
  • Control+Option+Command+N Brings the window to "normal" size, which means it will be in the middle of the screen
Limitations
I did not get the X Window Server to work with the shortcuts. But Matlab did work, and I think that most applications that support global shortcuts do. 
iTile is a little slow. (especially on the first run) This is because it has to call the SystemProfiler to get the screen size every time. I do not want to cache the results for I use my MacBook with an external monitor. Often I need to plug of that screen and iTile should work properly after this.
Currently iTile only supports two screens. As there are many case sto handle for more screens. Also these two screens will only be handled if they stand (virtually) side-by-side this means the second screen on the left or right side of the main monitor.

Possibilities of the script
You can use the iTile script to arrange your windows in different ways. The ways in the spark library are not the only ones. p.e. you could arrange your windows in the edges of your screen.
sizeFrontmost takes 6 arguments: the first two tell it in how many parts the screen should be divided horizontal and vertically. The second two arguments tell the script the position of the window in that grid. The upper left corner is 0,0. And the last two arguments tell the script how many cells the window should take horizontal and vertically.
p.e. you could create a 3 by 3 grid with the window set up in the lower left corner of the screen (0,2) taken two cells horizontal and one vertically (2,1).

Future Plans
Are no good ;)
Maybe I will extend the script to arrange not just the frostmost window, but every window by name.
And I plan to build in borders and maybe a simple transition while resizing to make the hole thing look more beautifull. Well, maybe ...

References
I used some blog/forum posts that really got my thoughts pushed in the right direction

Montag, 5. Oktober 2009

Last.FM for Quicksilver using iScrobbler

This is a simple Applescript, which can be used to select your Last.FM Radio via Quicksilver.
As I listen to Last.FM most of the time I'm sitting in front of my Mac, I did not like the way I have to use iScrobbler to switch radio stations. But iScrobbler has really nice Applescript support, so it's really easy to control it from Quicksilver.

Usage

  1. Copy the Scripts (not the folder) to your Library/Application Support/Quicksilver/Actions (create the Folders if they do not exist)
  2. Open up Quicksilber type "." for the Text Field. Type the Artist or the Tag your want to hear, Press "Tab" and select "Last.FM - tune Artist" or "Last.FM tune Tag" from the list.