Tux's lil' helper
Joined: 16 Jul 2011
|Posted: Mon Jun 18, 2018 2:12 am Post subject: Xnest tutorial - handy; don't overlook if you're unfamiliar!
|EDIT: This was originally written as a workaround for running REAPER in Qtile, as the UI in REAPER was quite buggy at the time of this writing, but worked well in OpenBox. However, in retrospect, this is more of an Xnest tutorial, so i've updated the language to make REAPER+Qtile more of an example case. I may later further refine this for the wiki, as Xnest is a very handy and interesting tool. Perhaps especially for UI developers. I'm not sure it gets much notice.
Briefly, Xnest runs an X11 server inside a window (or aka "nesting" one X in another). You could then, for example, run a window manager inside a window inside another window manager (and other programs inside of the "child" WM). In this case, I'll be showing how to run REAPER (DAW) in OpenBox inside of Qtile.
I am using Qtile version 0.11.1 and REAPER v593pre2 Linux build as of this writing, for this example.
To enable Xnest, I created /etc/portage/package.use/xorg-server with the following contents:
|x11-base/xorg-server xnest |
Then I ran the following to enact the new USE flag (which is not recommended, and there is probably a more safe way that you should investigate if you don't know what you're doing like me):
|emerge --ask --update --deep --with-bdeps=y --changed-use --newuse @world |
The above command is what I normally run to update my system. It's actually overkill for this purpose. Don't use it if you don't know what you're doing. It just happens to be what I used in my case and I don't want to be a dick and not "give the answer" as I run into many times on the net. I just don't have time to look up a better option right now.
Once Xnest is installed, I created the following file in /usr/bin/reaper thusly (where reaper would be whatever you want to type at a command line or run prompt to execute whatever it is you're running...you could put it anywhere really, but somewhere in your PATH is ideal for convenience):
Xnest -geometry 3440x1415 :2 &
openbox --startup "/path/to/reaper5"
Note: for this example, I'm running on a 3440x1440 monitor. The adjusted resolution is to compensate for tool bars in the "parent" WM and window decorations in the "child". Set it to whatever works for you.
basically, what the above BASH script does, is start Xnest and assigns it to DISPLAY :2...Then we export :2 to our script's DISPLAY environment variable. Finally, we launch openbox which will use that DISPLAY variable to know it should go on the Xnest-spawned server. That's probably clumsy, but is the best way to paraphrase what I know so far!
So far, I haven't noticed any performance issues, but I'm sure it is reduced.
I hope this helps someone.
As for questions, I'll try, but this all sorta just worked for me (see links below for the full story). If you find/notice error, or have anything else to say, please reply!
The full backstory which lead to this:
Links of me: