Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Run apps at different color depths simultaneously in X11 UNIX
X11.app preferences allow you to set it to 256 colors for the occasional x-windows programs requiring this setting, but you may then find other x-windows applications don't function at all, or at least look terrible. There is a simple way to have it both ways, simultaneously. The trick is to create a wrapper shell script that looks something like this:
#!/bin/zsh -f
DISPLAY=:$$[3]$$[4]
Xquartz $DISPLAY  -depth 8    2>/dev/null  & 
quartz-wm &
/path/to/program/requiring/256/colors
This essentially forces a second X11 session to be started on a different (randomly determined) DISPLAY, so it can peacefully coexist with X11.app running in default mode (usually on DISPLAY :0.0, unless multiple users have X11 running with Fast User Switching). By randomly assigning the DISPLAY, multiple instances of the program invoked from the wrapper script can be run simultaneously. This works on Intel powered Macs now, too.

[robg adds: I haven't tested this one...]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[4,306 views]  

Run apps at different color depths simultaneously in X11 | 4 comments | Create New Account
Click here to return to the 'Run apps at different color depths simultaneously in X11' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Run apps at different color depths simultaneously in X11
Authored by: wgscott on Mon, Apr 30 2007 at 10:19AM PDT
One improvement is to use this for the last line:

/path/to/program/requiring/256/colors ; kill -9 %1

Then when you close the 8-bit program that you invoked, the script will kill the new instance of Xquartz (which appears as a blank white icon in the dock).

If you want to test this, make the script executable and replace the last line with, for example,

/usr/X11R6/bin/xclock ; kill -9 %1




[ Reply to This | # ]
Run apps at different color depths simultaneously in X11
Authored by: speir on Mon, Apr 30 2007 at 2:23PM PDT
This works great. I have a script that will change the X11 color depth pref and then relaunch the app, but this is better. Thanks Bill.

[ Reply to This | # ]
Run apps at different color depths simultaneously in X11
Authored by: wgscott on Tue, May 1 2007 at 8:13AM PDT
I neglected to thank Jun T (Apple BB) and David Gohara for their help. The final four-line script belies a lot of painful stumbling about in the dark.

[ Reply to This | # ]
Run apps at different color depths simultaneously in X11
Authored by: goo4711 on Wed, May 16 2007 at 7:48AM PDT
Alternatively you can download the X11 source, allow the creation of a Pseudocolor display (search for PSEUDOCOLOR in the apple tree) and recompile it. It goes really straight forward...
The major disadvantage of many instances of the X11 Server is that only the first instance will have access the OpenGL for the display. Of course it will also slow down the machine.

[ Reply to This | # ]