Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[7,490 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 whoever posted them. This site is not responsible for what they say.
Run apps at different color depths simultaneously in X11
Authored by: wgscott on Apr 30, '07 10:19:15AM

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 Apr 30, '07 02:23:07PM

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 May 01, '07 08:13:18AM

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 May 16, '07 07:48:21AM

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 | # ]