Do not attempt to take a screenshot if the script is running headless.
Do not attempt to take a screenshot if the script is running headless.

Up to this commit Stats would try to take a screenshot unless the
--no-screenshot switch was passed. While this behavior makes sense most of the
time, it lead to a bug on headless systems. Stats would try to take a
screenshot if a supported screeshot utility was installed on the system. If
such a utility was available it would fail and print an error message, but
logically this behavior makes no sense.

Since it is fairly trivial to detect whether X is running in the context in
which the script is run, it will now only attempt to take a screenshot if it
is run in a graphical environment. This change invokes the same behavior as
when --no-screenshot is specified.

xorangekiller/haggis-stats,xorangekiller/haggis-stats