ratpoison, xnest, jwm, GIMP

First of all, I know ratpoison has temporary window manager (tmpwm) and new manager (newwm) options. As the ratpoison manual says, “These commands should be used sparingly. They were created to allow users to understand how a poorly designed program is intended to function so they can build a replacement or patch an existing alternative’s missing functionality.”

In the meantime, we users are usually stuck using the applications as they’re (crummily) designed.

I don’t want to leave ratpoison just to use certain “poorly designed programs” (GIMP, etc.) so I was looking for ways to open said applications (which usually open with multiple windows) and allow those apps to function “normally” as if they were no longer under the control of a tiling manager like ratpoison. Switching window managers via newwm/tmpwm means everything then gets controlled by the other window manager rather than ratpoison. Why should everything have to suffer as a result of running a couple offending applications? That’s dumb.

After a bit of experimentation and searching, I settled on using xnest. I already had jwm installed on my laptop so I did a few things to get it all working properly. This will work with any preferred window manager. You could use twm (which gets installed in a standard Debian install) or fluxbox or whatever you want.

The first thing to do is install xnest (in Debian: aptitude install -R xnest) if it’s not already installed.

I decided to configure this to run from a shell script using a separate .xinitrc file (.xinitrc-tmpwm to be exact). That file is pretty simple and since it’s only being used to launch GIMP for now it’s very short and to the point (don’t forget ampersands if you use more than one line):

xsetroot -solid grey13 &
gimp &
jwm

This is launched from another file (~/bin/nest-jwm-in-rp.sh):

#!/bin/sh
exec xinit ~/.xinitrc-tmpwm -- /usr/X11R6/bin/Xnest :1 -ac -geometry 1280x800

This will then start gimp atop jwm in xnest at the full display resolution of my laptop screen. It also means I can start and run whatever applications in jwm I might want. I’m still managing everything via ratpoison and my ratpoison keybindings override any set for jwm. Here you can see the ratpoison window list invoked while opened to my browser:

I can switch to the xnest window and there’s GIMP in jwm (with getting another ratpoison window list):

And like I wrote above, all my ratpoison commands work and supersede jwm. Here’s the result of using ratmenu to send a message about mocp (mocp -i/mocp –info) to ratpoison’s status bar:

And finally, if you want to use another window manager it’s as easy as changing the last line in the .xinitrc. Use twm, fluxbox, flwm, fvwm, whatever.

That’s just GIMP in twm with mocp –info, all managed by ratpoison. Lovely. You probably won’t see this kind of stuff on distrowatch anytime soon, players.

I know ratpoison isn’t for everyone. Some applications can really drive users nuts because the developers make presumptions that don’t work properly for how users want to use the software (the next release of GIMP is supposed to have a one-window option which will make it a lot easier for real people to use). Whether you choose to use ratpoison options like tmpwm or newwm, or an external option like xnest, there are ways to get around crazy multi-windowed applications. I like this approach because it allows me to “contain” those applications in one window under ratpoison where they can float around as intended while managed by a separate window manager. It’s not perfect, but it works pretty well.

UPDATE: For what it’s worth, I’ve now removed jwm and will just use twm for GIMP, Skype, and/or anything else requiring more than one window to function.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: