Log in

No account? Create an account

a nifty little thing for shell scripting

« previous entry | next entry »
Jun. 11th, 2007 | 11:25 pm
location: Sasona
mood: geekygeeky

This seems like a sensible way to do this, I like it:
 * RunningX v1.0
 *   Brandon Long (blong@uiuc.edu)
 * This program uses an X call to determine if X is running.  I use it
 * to determine which type of content viewer I use for viewing attachments.
 * It returns 0 if we are running X, 1 if not.
 * The rfc1524 format for mailcap files would use the following to view
 * an HTML attachment with Netscape if we are running X, or with Lynx
 * if we are not.
 * text/html; netscape -remote 'openURL(%s)'; test=/usr/local/bin/RunningX
 * text/html; lynx %s
 * If you use any command line parameters, it will return a message on
 * stdout that if you are running X or not.
 * To compile, you need to link with libX11, so something like the following:
 * gcc -o RunningX RunningX.c -lX11


Link | Leave a comment | | Flag

Comments {0}