K.Mandla's blog of Linux experiences

An X for every application

I picked up an odd tip the other day, by way of questions about window managers. falconindy pointed out that, rather than looking for a lightweight option, perhaps better route is to open another instance of X.

Copy, paste, mark as executable. Call it from the terminal and suffix it with the name of the application you want to run. Switch between them by way of the CTRL+ALT+F# keys, with successive servers getting successive numbers.

Memorywise, I don’t know if it is a wise idea, or at least a wise idea for something as slow as this. On the other hand, it’s a dwindling population that uses machines with those specifications, so it might be perfectly acceptable for anyone using something built after 1999.

I gave it a try on a machine running Arch and had no real issues; whether or not you use it may depend on how practical it works out for you. After all, most window managers support multiple “desktops,” and so adding a whole different instance of X may be overcomplicating things to an unwieldy degree. You’re the best judge of that though. ;)

Extra X servers have their uses- for instance, trying out new WMs without closing out all your open applications, or running full screen games like World of Warcraft in Wine without having to close it every time you want to switch programs.

I’ve never had to be sudo to use it… but then again, I do not open a new X with the same user either. I have a few different users, and occasionally use this sort of thing to switch to them.

Since startx doesn’t work for a second user, you could just use the command: xinit — :X

(X= number of running X’s plus one. So xinit — :1 would be a second display, xinit — :2 would be the third and so on.)

In theory you can make as many as you like, but switching between them with the Ctrl+Alt+Fn keys is limited. If you have F1-F6 as consoles, then you have F7-F12 left as easy switches. There is probably a way around this, but I don’t know it right off.

Look at file Xwrapper.config. You find allowed_users=console there. It means only users from console can run new X. You can chenge it to allow anyone to start X. I do not know if it is good or bad idea.