Hey, how about an "xedit" command similar to visudo?

R.L. Horn lists at eastcheap.org
Sun Nov 5 20:02:56 PST 2006


On Sun, 5 Nov 2006, Ori Bernstein wrote:

> Perhaps this should be something for the portland project, similar to 
> xdg-open and friends? maybe you could propose an xdg-edit program.

Well...

     #! /bin/sh
     if test -n "${VISUAL}"
     then
         editor="${VISUAL}"
     else
         # default to vi so as to maintain compatibility with more(1) :-)
         editor=${EDITOR:=vi}
     fi

     exec ${editor} $@

seems a bit sparse.  Maybe I could spice it up with lots of autoconf 
arcana and some sed and awk commands.

Oh well, where the original poster had something was in the idea of a 
utility that would not only run an editor, but could find xorg.conf. I've 
attached a couple of scripts.  If nothing else, they're illustrative as to 
how to go about finding an X installation.

xconfedit.sh is an improved version of the script I posted yesterday. 
This one should actually be portable and fixes an embarassingly whopping 
bug in the original.

whichxconf.sh is probably more useful.  It simply makes an educated guess 
as to where xorg.conf is located.

Both use xmkmf in an attempt to figure out projectroot.  So far as I can 
tell, this is the only even remotely reliable way to find X.

Note that all bets are off if your server invocation involves a "-config" 
option.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whichxconf.sh
Type: application/x-sh
Size: 2145 bytes
Desc: 
URL: <http://lists.x.org/archives/xorg/attachments/20061105/ce78d48a/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xconfedit.sh
Type: application/x-sh
Size: 2299 bytes
Desc: 
URL: <http://lists.x.org/archives/xorg/attachments/20061105/ce78d48a/attachment-0001.sh>


More information about the xorg mailing list