Help for this page
use X11::Protocol; my $display = $ENV{DISPLAY} || 'localhost:0'; my $has_x11 = eval { X11::Protocol->new($display) } ? 1 : 0;