checkX is a little utility I wrote that tests to see if (a) the X11 client DLLs are installed on the machine, and (b) the Xserver on $DISPLAY (or -d x.x.x.x:x) is running and usable.

It does not link against the Xll libraries itself, but attempts to dlopen it, using a fuzzy name/path search. Both the search path and the target name are explicitly over-ridable via commandline arguments.

In its default mode, checkX returns a 0 status if X is present, 1 otherwise, and generates no output. It is intended for use in scripts, which need to intelligently decide whether to launch an X-based application or a non-X (native MS Gui? console?) one.

The source code isn't pretty, but it works pretty well; I've been trying to break it for a while now. First "published" here:
   http://www.cygwin.com/ml/cygwin-apps/2006-03/msg00148.html
but I decided to make it into its own package rather than tack it on to rxvt-unicode-X or cygutils. It's even autotooled...not that it can actually be BUILT on any platform except cygwin. <g>


checkx does not yet have a home for ongoing development, save my hard drive, so there's no "upstream" site, and obviously there are no Linux distributions which include it. Therefore, I need some votes in favor...


=============================================================================
checkX determines if X is installed and Xserver is running
  returns 0 if yes, nonzero otherwise

Options:
  -h|--help            : prints this help message
  -d|--display STR     : use STR instead of $DISPLAY
  -l|--location        : print location of Xlib DLL on stdout
  -a|--appendpath STR  : append STR to value of $PATH (cumulative)
  -p|--prependpath STR : prepend STR to value of $PATH (cumulative)
  -r|--replacepath STR : use STR instead of $PATH when searching
  -x|--xlibname STR    : use exactly STR instd of fuzzy cygX11-*.dll
  -t|--timeout FLT     : allow FLT seconds to connect with Xserver
                         defaults to 0.5, use 0.0 for Xlib's (safe, 12s)
                         timeout
     --notty           : disable stderr messages
     --debug           : turn on debugging messages
     --no-silent       : allow error, warning, and info messages
Note that -a defaults to '/usr/bin:/usr/X11R6/bin'. To eliminate the default, use '-a ""'
=============================================================================

setup.hint:
----------- 8< ------------
category: Utils
requires: cygwin
sdesc: "checks to see if Xserver is usable"
ldesc: "A quick-n-dirty utility to check if X is installed on the
machine and if the Xserver is running.  checkX is silent
by default (unless configured with --disable-silent), and
all it does is return a status (0 or 1).  There are no popups
or stderr messages.

checkX attempts to dynamically load the X11 DLL in order
to contact the Xserver; therefore this package does not
explicitly depend on the X DLLs."
----------- 8< ------------

http://cygwin.cwilson.fastmail.fm/ITP/checkx.hint
http://cygwin.cwilson.fastmail.fm/ITP/checkx-0.1.0-1-src.tar.bz2
http://cygwin.cwilson.fastmail.fm/ITP/checkx-0.1.0-1.tar.bz2


--
Chuck

P.S. For some reason I can only intermittently ssh to my cygutils.fruitbat.org site -- and the last time I tried to do so, it apparently took down the httpd server, too. I'm pretty sure that's not an "scp + cygwin" problem. <g>

So, this ITP is hosted at an alternate location.

Reply via email to