

Customizing the Mac to behave like Xmonad - liangzan
http://blog.liangzan.net/blog/2012/06/03/customizing-the-mac-to-behave-like-xmonad/

======
pudquick
I see you found SizeUp. That's also my application of choice. But it doesn't
look like you did a lot of research into the available choices, or at least
didn't bother listing them. Here's but a handful, for others who are
interested:

ShiftIt: <https://github.com/fikovnik/ShiftIt>

TileWindows: <http://www.carsten-mielke.com/tilewindows.html>

Mercury Mover: <http://www.heliumfoot.com/mercurymover/>

... Or if you like mouse control of window placement:

MondoMouse: <http://www.atomicbird.com/mondomouse>

Zooom/2: <http://coderage-software.com/zooom/index_green/index.html>

Cinch: <http://www.irradiatedsoftware.com/cinch/>

... Or if you like a bit of both keyboard and mouse:

Optimal Layout: <http://most-advantageous.com/optimal-layout/>

Arrange: <http://www.trifle.pl/arrange.html>

Divvy: <http://mizage.com/divvy/>

BetterTouchTool and BetterSnapTool: <http://blog.boastr.net/>

Flexiglass: <http://www.nulana.com/flexiglass>

Moom: <http://manytricks.com/moom/>

And throwing this one in to just show that it can get exotic:

<http://infinite-labs.net/afloat/>

.... I could go on. OS X does not lack for people who disagree with Apple's
idea of window management. There's lots of tools out there, if you just look
for them :)

~~~
flou
I just recently discovered Spectacle and it's really awesome. It's open source
and free, doesn't take up a lot of memory.

<http://spectacleapp.com/> <https://github.com/eczarny/spectacle>

~~~
tuananh
Great app, however I need to remap some shortcuts, they are not very intuitive
though.

------
pimeys
I use Arch + Xmonad at work and I simply love it as the OP does. Sometimes I
need to work from home and I don't want to keep two laptops here, so I need to
use my old 2008 unibody Macbook.

Working in OSX with Vim and console is painful after the Linux experience.
Installing lots of utilities might help, but I chose to install Ubuntu with
Xmonad and after couple of hours I had my favorite environment ready for
productive work.

I know that the support for newer Apple technologies is not so good in Linux,
so when this old laptop finally dies I need to buy a new one from some other
manufacturer.

~~~
josephkern
Thinkpad. Great build quality, Linux friendly.

~~~
pimeys
I've been watching Thinkpads very closely. I used to own X40 until it broke
and before 600x (which never broke, but it's kind of old now).

What model is preferable nowadays? There are not lots of shops to test them at
least in Berlin. I want 13" and lightweight, but still powerful enough laptop.
Lots of ram, i7 CPU and a SSD disk. The most important thing is an excellent
keyboard and touchpad. I heard Lenovo is not using the old and excellent
keyboard in their laptops anymore and I haven't tested the new one yet.

~~~
gsharm
ThinkPad X1 Carbon (which is their answer to the MacBook Air - similar size to
the 13", but 14" with more horizontal resolution), or the 12.5" X230, which is
a bit heavier, but has 60WHr+ battery options and IPS display (both missing
from the MacBook Air).

~~~
MikeW
The guy doing this review was only able to get 3.5 - 4 hours out of the
battery. <http://www.nomobile.ru/reviews/162216.html> Mediocre horizontal
screen resolution for a 14" too

~~~
gsharm
1600x900 on 14" is mediocre? Bear in mind that it's exactly the same
size/weight as the 13" MacBook Air but has larger display (thanks to a
narrower bezel on the sides), higher resolution, and an arguably better
keyboard. Shame about the battery life, though. Also, considering they're
using a carbon fibre shell, they should have been able to get the weight down
to considerably less than that of the Aluminium MacBook Air. Sony got that
part right with their own carbon fibre VAIO Z (lighter and with better display
than either), but it has worse ergonomics than either the ThinkPad or the Air.

No product out there at the moment that gets everything right. The MacBook Air
probably comes closest, although the battery life and TN+ display could both
be substantially improved.

Note that the ThinkPad X220/X230 has both a better, IPS, display and can run
for 12+ hours using a 9-cell battery whilst still weighing less than a 13"
MacBook Pro. However, it's heavier than the newer slimmer notebooks and has
lower resolution:

[http://blog.laptopmag.com/record-breaker-lenovo-
thinkpad-x22...](http://blog.laptopmag.com/record-breaker-lenovo-
thinkpad-x220-lasts-over-20-hours)

------
moe
I haven't used XMonad but I've been a heavy ion3 user for many years.

Last I checked none of the available bolt-ons (including Sizeup which the
author proposes) would come anywhere near a true tiling WM.

The only candidate that would even try to _automatically_ tile windows was
TylerWM - but that was buggy as hell. All the others only act on keyboard-
shortcuts, which largely defeats the purpose.

I'd happily pay $200+ for ion3 as a native OSX WM. The OSX window manager is
just absurdly terrible.

~~~
pyre
He did seem to imply that his usage of Xmonad was 1 app per workspace, which
isn't really 'tiling' per se.

~~~
pimeys
One app per workspace is great for a 13" laptop. When having two big screens,
it's not enough anymore.

------
lubutu
A slight tangent, but dmenu-4.5 uses token matching, which allows you to
search somewhat fuzzily: "foo rb" will match "foobarbaz". How it looks
compared to Alfred and co. is a matter of one's aesthetic...

Disclosure: I'm a dmenu developer.

~~~
mwyvern
I've always wondered -- is it suckless as in suck less than something else, or
as in without suck?

~~~
mgurlitz
It says right on the suckless.org home page, "software that sucks less," so
probably the first.

~~~
mwyvern
I've been saying that wrong in my head for a long time now. Thank you :-).

------
tyler_ball
Tyler WM (<http://www.tylerwm.com/>) shows a lot of promise. It's a pretty
good 1.0 but there are some edge cases that still prevent me from using it
full time.

~~~
tomlu
To chime in here, IMO what sets Tyler apart is that it takes control of a
window as soon as it is created, whereas AFAIK all other offerings leave the
windows alone until you use keyboard commands to resize them.

It is indeed promising, but like you I cannot recommend it to anyone until
they have fixed several critical bugs.

~~~
nickbarnwell
Could you elaborate on what some of the bugs you ran into were? I came across
it the other day and was eager to try it, but reticent to spend the $10
without a demo (currently in between jobs)

~~~
tomlu
Oh, stuff like windows becoming unmanaged, Tyler becoming disabled until a
restart, windows moving around without you wanting them to. It's pretty much
an alpha product - don't spend yet, wait a couple months and see how it goes.

------
zdw
What I use (both are free/open source):

Slate for window management: <https://github.com/jigish/slate>

Quicksilver for launching: <http://qsapp.com/>

------
DannyPage
It depends on what mouse or touchpad you have, but I find that I don't even
use Command-Tab anymore. It lacks the precision of getting to exactly the
right window. Launching Mission Control via touch allows me to switch to the
window I need much faster.

I hear you on the maximizing thing; I ended up finding a program called Shift
(<http://shift-it.en.softonic.com/mac>) works very well to maximize, snap a
window to just the left or right half of the screen, etc. Hope that helps!

~~~
duaneb
How do you navigate Mission Control without touching the mouse? Surely it
can't be easier than cmd-tab.

~~~
lloeki
Going to _System - > Preferences -> Keyboard -> Keyboard Shortcuts_ and
looking for _Mission Control_ and _Keyboard & Text Input_ reveal a number of
shortcuts which may or may not be enabled (the same way swipe settings are 3f
or 4f)

Here you will find the following shortcuts:

    
    
        Mission Control
        Application windows
        Move left a space
        Move right a space
        Switch to desktop N (number of entries up to N appearing  varies with current number N of dynamic Spaces)
    

Also:

    
    
        Move focus to active or next window
    

By default and depending whether you upgraded to Lion and what your previous
settings were the base mod key may be Command, Control or Command+Control. If
you installed from scratch it's Control.

Then, shortcuts are:

\- Ctrl+Up/Down to enter MC/App Exposé

\- Ctrl+Left/Right/1/2/3/4 to change Spaces (works on the desktop and in MC)

\- Command+` (and Tab/Shift+Tab) cycles apps in App Exposé.

\- Arrows allow one to select a window in App Exposé

On a laptop, the touchpad is right below the keyboard and I usually trigger MC
with a 3f swipe, F3 or Control+Down (depends on my zone level) and select the
window with index (when swipe-triggered) or thumb (when keyboard triggered).
When using a mouse, I'm using a Logitech MediaPlay at home and a Logitech
MX900 at work, which have two awesomely placed thumb buttons, which map
perfectly to Mission Control and App Exposé (the button choices appear in the
rightmost combos in System Settings -> Mission Control if you have a
sufficiently buttoned mouse). Using another mouse than Magic Mouse I lose the
brilliant touch/inertia scroll, but the two-finger double-tab gesture is
completely ridiculous and a total pain.

Comparatively, Command+Tab is only fine when I'm toggling between two apps
which have a single window, else the whole target app windows cover the
previous one, which defeats my extensive use of Window Magnet. Also I have 1)
a high chance of not landing into the proper window this way, and 2) a high
chance of toggling between three apps, in which case Command+Tab is
inefficient. Also I find it egregious that one keeps open Command+Tab by
keeping Command down, then drill down to App Exposé, where you have to release
command before moving with arrows and subsequently select a window with Return
when it could be Command all the way then release to exit.

Also, when moving between terminal windows and tabs I use the build-in Next
Window/Tab shortcut (Command+Left/Right, with Shift for tabs). I bound the
same keys in MacVim for consistency.

Besides there's still lack a (non third party) keyboard way to:

\- navigate between window groups/windows in MC

\- add a new space

\- move windows between spaces

~~~
duaneb
Ah. I work on a laptop, and I can't stand it when a window isn't using up the
entire space, so I just make everything fullscreen and flip between them with
cmd-tab (slow) or ctl-left/right (fast). I switch between ~4-5 macs a day and
~30-50 a month, so I can't be bothered to use anything but default keybindings
and software.

------
stevengg
why not just run arch on your mac laptop?

~~~
psadauskas
No thunderbolt support, for one, so you can't use the beautiful 27" external
monitor. The nVidia/ATI drivers on Linux aren't nearly as good, either.

~~~
lloeki
I really love Arch, but for me the reason it's segregated to a VM is:

\- power management: Linux does not hold a candle to OSX (which is able to
shutdown entire components like soundcard, webcam dynamically when not in use)

\- Lion's external display+lid+sleep behavior: external screen+AC power makes
lid-close sleep inoperant, so I can just plug both lid closed and my laptop
wakes up to be a desktop (bluetooth input devices help a lot). Conversely
unplugging either makes it go to sleep, back in laptop mode.

~~~
jrockway
The Linux kernel is capable of commanding individual devices to power off. Run
powertop and it will show you what's using power and offer to turn it off. My
experience with Thinkpads (from two or three years ago) is that running
Windows gives you about 10 hours of battery life while doing essentially
nothing, while running Linux gives you 8 hours. Both are so high that it
doesn't really matter. My X220 has never run out of battery, and I fly a lot
and don't really plug my laptop in at home, so 8 hours is apparently enough.

For your second point, just explicitly command your computer to do what you
want. If you want it to go to sleep, type "acpitool -s". If you don't want it
to go to sleep, don't type that.

If you like OS X, use it, but if you hate OS X and are only using it because
of the two issues you list above, that's crazy :)

~~~
lloeki
_> The Linux kernel is capable of commanding individual devices to power off.
Run powertop and it will show you what's using power and offer to turn it off_

Oh I perfectly know that, the problem is that it's _manual_. With OSX I play a
song, soundcard comes alive from its powered off state and plays sound, song
stops, soundcard powers down after a little idle timeout. The same goes for
the webcam, ethernet board and various other components. With Linux I have to
either write some suboptimal wrappers to programs to kick devices in or out,
or do it manually, or sacrifice battery life.

Comparing battery life, Linux is two~three full hours behind OSX out of
seven~eight (after thorough analysis involving powertop1/2). That's a 30% drop
and brings me to almost a day to a little more than half a day of work per
cycle. Well, it was so a year ago, because now my battery has crossed the 600
cycle count bar so it holds an hour less. And don't start telling me "oh that
was a year ago, Linux has improved on that front since then", since OSX
improved in that area too (I've looked at hard data battery metrics).

 _> For your second point, just explicitly command your computer to do what
you want. If you want it to go to sleep, type "acpitool -s". If you don't want
it to go to sleep, don't type that._

You're missing the point, I perfectly know that too.

Find me a single PC that can do this:

1) asleep with lid closed, you plug in an external screen and if you're on AC
power the computer wakes up and makes the external screen primary, else it
does not even wake up and stays asleep.

2) awake with lid closed, AC and screen plugged in, you plug out external
screen or AC power and the computer goes to sleep

3) awake with lid closed, AC and screen plugged in, you open the lid and it
becomes primary while external screen becomes secondary.

4) awake with lid open, AC doesn't matter but you plug in an external screen
and this one becomes secondary, retains its specific configuration including
relative position, wallpapers, resolution and color calibration settings from
previous times _per external screen device_.

I've written my own extendable acpid handler in Python to achieve various
schemes, react to complex events, and take complex actions. I know exactly how
to do 2, 3 and 4, and I know exactly how much hackery and time is needed to
achieve this, and it's not really reliable in the end. As for 1 it might as
well be downright impossible.

 _> My X220 has never run out of battery, and I fly a lot and don't really
plug my laptop in at home, so 8 hours is apparently enough._

As I said my battery is getting past middle-aged and the more minutes, the
happier. Also you can consider not only "instant" battery life (i.e time it
takes to go from full to empty) but long-term battery life (time it takes
before the battery is a complete brick): the longer the cycles, the less wear
it takes, so the longer it lasts before going to the trash.

 _> If you like OS X_

I do :-)

If only Lion's "full-screen" would really be a chrome-less tiling window
manager I'd be completely happy. Things, like Window Magnet, fullscreen
Terminal.app and tmux help a lot though.

~~~
freyrs3
> Find me a single PC that can do this

Every computer can do this, its not a function of hardware. You'll have to
write your own scripts to do it but thats just part of the Arch Linux ethos.

To wake and reconfigure displays on in your example (1), you can poll for ACPI
events for on:

    
    
        /proc/acpi/ibm/video:video_switch

~~~
lloeki
> Every computer can do this, its not a function of hardware.

I'm dying to know how a computer in ACPI S3† can execute my ACPI scripts. The
only way for it to work is for some hardware to trigger an event that will
kick it out of S3, and PCs old and new that do so on external display plug are
(if any) apparently rare enough that I _never_ encountered them, so currently
I consider them devoid of this feature.

Even if it were so, this would require, as you say, and again as I did already
for cases 2) 3) and 4), writing scripts, and such scripts are non-trivial.
Calling xrandr (which of course needs DISPLAY and some X magic cookies) from
an ACPI handler (which runs as root while the X session runs as you) requires
interesting piles of trickery. Then timing issues come in, as drivers take
time adjusting themselves and you have no way of knowing when they're ready
(in the meantime e.g xrandr redurns/does crap). Also, interestingly enough,
all sorts of fun stuff happens on VTs when the primary display vanishes to be
thrown into an external one.

I long for the day when KMS supports multiple monitors and I can have VTs left
and right, and I can run my favorite phrakture-like no-X setup on bare metal
(and my web browser in a lightweight Wayland), but that day is far away so
that setup stays in a VM.

 _† i.e CPU off == no power at all, only RAM and components registered for
waking like USB controllers have reduced power._

edit: formatting

------
ditoa
You bought a new computer because of a fan error?! You could have got a new
fan with next day delivery (so Tuesday in your case) for a hell of a lot less
than a new computer and all the time it took you to get OS X setup how you
want.

Or do you earn such crazy amounts of money that you made enough money on that
Monday to cover the cost of the new Mac and your time configuring it?

~~~
shellox
I think his Thinkpad died, because of a fan error. Maybe it overheated or
something like that.

------
mwyvern
Comment to the author: use cmd-` while you are command tabbing if you go too
far! Similarly useful, hold cmd-tab and it will stop at the end. Also, cmd-esc
if you decide not to switch.

I used a 15" MBP for a long time without missing a tiling window manager that
much... but the problem was exaggerated when I started using a 27" imac. So I
looked around and started using spectacle. Great utility. I use Quicksilver's
"open application" custom triggers to get the app switching behavior, so I
finally have a use for F15-F19 (on the very left side of my keyboard)! It has
made a big difference for me.

One problem I would like to solve is switching between multiple emacsen. I
have an 8:00-5:00 job and work on my own stuff after that, and I like to keep
my buffer lists separate (so I can't just use multiple frames). Therefore, I
open emacs again from the terminal and I wish I could switch between them with
quicksilver's shortcut. Alas, quicksilver always brings up the first one. Has
anyone dealt with this?

------
julioc
Is there anything like xmonad for Windows?

Edit: found [some options on wikipedia][1], but maybe you have any other
sugestions.

[1]:
[http://en.wikipedia.org/wiki/Tiling_window_manager#3rd_party...](http://en.wikipedia.org/wiki/Tiling_window_manager#3rd_party_addons)

~~~
technosmurf
I've had good success with an open source tiling window manager for Windows
called HashTWM [1]. I use it inside my Windows XP virtual machine to manage a
bunch of hairy situations with multiple windows. I like that it actually does
reposition new windows to fit inside the grid, and that I can easily adjust
the middle "split" line so that my main window can become thinner or thicker.

Where it falls down is when you deal with modal dialogue windows, like the
"Save File As..." window of Firefox, or the "Find and Replace" window of
Excel. I haven't found a good way to overcome the issue of those modal windows
being hidden, even with the "-i ConsoleWindowClass -i #32770" ignore options.
It seems like Firefox, Excel, and Photoshop implement some non-standard ways
of opening smaller windows. In these situations, I quit HashTWM, deal with the
modal window, and then start HashTWM again (using quick keyboard shortcuts).

[1] <https://github.com/ZaneA/HashTWM>

------
Void_
Spark: <http://www.shadowlab.org/Software/spark.php>

You can create shortcuts for anything.

I have Alt+S for Safari, Cmd+~ for Terminal, Alt+M for TextMate, etc.

------
gurraman
I'm in a similar situation (hooked on Xmonad, but cannot run Linux). I've
tried various solutions over the years, but the only one I've found acceptable
so far is a full-screen iTerm2 running tmux.

I use `bind t split-window \; select-layout main-vertical` to emulate Xmonads
default layout behaviour.

It works because I spend most of my time in the terminal anyway. I miss having
the browser - and the video player when doing repetitive or otherwise boring
tasks! - in a pane, but keeping other apps out of the tile-management is fine
as I'm, more often than not, switching context anyway.

------
evangineer
Having made a similar transition a few years ago from a mouseless linux
desktop using ruby-wmii on a thinkpad to osx on a macbook, I find ShiftIt
works for tiling windows using the keyboard.

------
bcl
Or you could install Fedora 17 on your Mac and just run xmonad

------
tilltheis
I haven't used Xmonad myself but with all the talking why hasn't someone
ported it to OS X (Cocoa) yet?

~~~
ef4
It's not just a question of porting it to cocoa. To really do its job, it
needs to take control of every other window. So you need to hack Apple's
existing window manager.

FWIW, you can easily compile and run it on OSX, under X. But of course it
can't reach out and control any of the native applications.

------
batista
"Or you could, you know, just use Xmonad" comments considered harmful.

(plus ignorant/simplistic: it's not like everything else related to one's OS
use and needs will be the same).

------
duaneb
TL;DR use SizeUp.

