(Update: ok, so I posted this quickly without having used it a lot. I don’t use the Gimp much anyway, so this mostly meets my needs, but it does have issues. If I get motivated to look into them, I’ll update with a fix if I can.)
I just came up with an xmonad layout for gimp that I like quite a bit, so I have to share it… it uses the IM layout (twice) combined with the Full layout to get tools on each side of the screen, with images taking up the whole space between them. Here’s the code (updated to include requirements, etc):
import XMonad.Layout.IM
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Reflect
main = do
xmonad defaultConfig
{ layoutHook = onWorkspace "gimp" gimp }
where
gimp = withIM (0.11) (Role "gimp-toolbox") $
reflectHoriz $
withIM (0.15) (Role "gimp-dock") Full
You’ll probably want to change the widths assigned to the two IM docks to fit your screen, but those settings work nicely for me on a 1920×1200 24″ screen. Here’s a shot of it (click for a full-size view):
Loading image
Click anywhere to cancel
Image unavailable
16 Comments on “Xmonad and the Gimp”
You can track this conversation through its atom feed.

Awesome!
Posted on 2009/03/09 at 12:54 am.
I'd like a way for XMonad to start a new workspace when a program is detected to be running; e.g. starting gimp creates the "gimp" workspace and sets it up like this.
Possible?
Posted on 2009/03/09 at 9:26 am.
Porges, yes that's possible. I just got that working recently with much help from sereven in the #xmonad irc channel. The main bit of code that makes it work came from the Scratchpad module. Here's the key stuff from my manageHook:
import XMonad.Actions.DynamicWorkspaces
myManageHook = composeAll [ className =? "Gimp-2.6" --> doNewWS "gimp" ]
where
doNewWS tg = (liftX $ addUniqueHiddenWS tg) >> doShift tg
addUniqueHiddenWS tg = withWindowSet $ s ->
if null (filter ( (== tg) . W.tag) (W.workspaces s))
then addHiddenWorkspace tg
else return()
You can change addHiddenWorkspace to addWorkspace to switch to the workspace when creating it.
(Sorry, can't seem to make these intense debate comments preserve indenting)
Posted on 2009/03/09 at 9:38 am.
doesnt work nicely with simpleFloat – tags move in one direction while you move the window in another.
Posted on 2009/03/27 at 1:21 pm.
I tried this, but I have problems any time there are multiple image windows. When I move the mouse cursor between windows the first image pops in front of whichever one is currently showing. Is there some way to prevent this?
Posted on 2009/04/05 at 8:10 pm.
Is it possible to set the width of the tools to something like "detect automatically" so that it could be used on any screen sizes?
Posted on 2009/05/17 at 10:08 am.
Thanks for the useful info. It’s so interesting
Posted on 2009/06/11 at 10:52 am.
Here's a small variant with thanks to aavogt on #xmonad.
The goal was to avoid committing myself to dedicated "gimp" workspace — I don't just gimp *that* often — but also to avoid a lot of fancy hackery as I didn't understand the DynamicWorkspaces stuff.
Solution: omit the (onWorkspace "gimp") and change Full to (layoutConfig defaultConfig). This means that all non-gimp windows continue behaving normally, but wherever I launch gimp, I get the nice toolboxes.
Posted on 2009/07/01 at 5:00 pm.
Very cool post and comments.
The above highlights one of the core strengths of xmonad. You can really mold it and adapt it to your workflow and needs. Yes it might get tricky in the configuration sometimes but there are very few things you can't do.
On the other hand the basic defaults are a joy to use. As I said many times, things become effortless. I'll definitely use all this for gimp as well, coool!!
Now here's why since I also use a Mac, I am working on a tiling window manager for OSX based on enso (http://code.google.com/p/enso/) which I aptly named, effortless.
Nick
Posted on 2009/07/01 at 10:21 pm.
Thanks for the comments and tips, guys. Xmonad is indeed excellent. I've had to work on windows boxes more often lately and I sure miss it.
Posted on 2009/07/01 at 10:49 pm.
Whoops! In case anybody's windows got reversed by this, adding a second reflectHoriz should do the trick.
Now I have:
myLayout = withIM (0.11) (Role "gimp-toolbox") $ reflectHoriz
$ withIM (0.15) (Role "gimp-dock") $ reflectHoriz
$ layoutHook defaultConfig
Posted on 2009/07/07 at 5:49 pm.
IM layout worked fine, but one day it mysteriously started doing what you describe. Try combineTwoP combinator. I use:
combineTwoP (TwoPane 0.03 0.15) (myTabs) (reflectHoriz $ combineTwoP (TwoPane 0.03 0.2) myTabs (myTabs ||| Grid) (Role "gimp-dock")) (Role "gimp-toolbox")
Posted on 2010/02/12 at 9:13 pm.
Thanks, this was really useful. I am using gnomeConfig so I had to add desktopLayoutModifiers $ to the layouthook line just after the = so that the panels aren't covered (import XMonad.Config.Desktop is also needed).
Posted on 2010/06/10 at 10:32 pm.
Thanks for this! I’m in the process of tweaking my xmonad.hs and this was one of the things I had been trying to figure out… without success
Posted on 2010/07/16 at 1:33 pm.
Can anybody come with the final merge between the Gimp setup and the basic gnomeConfig?
I only have this:
import XMonad
import XMonad.Config.Gnome
main = xmonad gnomeConfig
What I want is to have gimp loaded on my last workspace (9)
Posted on 2010/08/04 at 10:09 pm.
Can you please re-post/edit this with a link to a text-pastie site such as http://sprunge.us/
Posted on 2011/12/25 at 9:35 pm.