sub hasX { return undef if not defined $ENV{DISPLAY}; return undef if port_not_listening($ENV{DISPLAY}); return 1; }