Retrieving config filename.

Ben Skeggs d4rk74m4 at intas.net.au
Mon Oct 18 22:16:25 PDT 2004


Thankyou everybody for your info.

The utility is geared towards users of ATI's fglrx driver mainly,
which implies only linux and xfree86 (and unofficially xorg). So,
the differences with Xsun etc don't really matter much.

Again, thankyou.
Ben Skeggs.


Roland Mainz wrote:

>Ben Skeggs wrote:
>  
>
>>Is there an X request or even an Xlib call which can be used to discover
>>the location of the config file being used by the X server.  I am trying to
>>write a control panel interface to various things related to the X server,
>>and with XFree/Xorg and whatever other X servers there are around,
>>guessing the current config file might be a little difficult.
>>    
>>
>
>1. At least for the Xorg server there is already the "xorgcfg" tool.
>
>2. A general API for this does not exist as the configuration method
>differs a lot between X distributions and Xservers - for example Solaris
>Xsun has a different configuration method than the Xorg server or the
>HP-UX Xserver. And even on the same platform there are differentces -
>for example Xsun (video server) uses different config files than Xprt
>(print server) etc. etc.
>
>3. For the Xorg server there is an API in the Xfree86Misc extension.
>Example:
>-- snip --
>int dummy;
>int major = 0;
>XF86MiscFilePaths xfpaths;
>
>if (XF86MiscQueryExtension(dpy, &dummy, &dummy) &&
>    XF86MiscQueryVersion(dpy, &major, &dummy) &&
>    (major > 0) && 
>    XF86MiscGetFilePaths(dpy, &xfpaths)) {
>    printf("File paths:\n");
>    printf("  Config file:  %s\n", xfpaths.configfile);
>    printf("  Modules path: %s\n", xfpaths.modulepath);
>    printf("  Log file:     %s\n", xfpaths.logfile);
>}
>-- snip --
>... but again... this is a specific API for the "Xorg" server and won't
>work for everything else except "Xorg" ...
>
>----
>
>Bye,
>Roland
>
>  
>



More information about the xorg mailing list