Triple Entendre (triple_entendre) wrote,
Triple Entendre

  • Location:
  • Mood:

a nifty little thing for shell scripting

This seems like a sensible way to do this, I like it:
 * RunningX v1.0
 *   Brandon Long (
 * 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
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.