For my purpose, I’ve used the shell timeout command. Patch below.
--- /usr/bin/x2golistdesktops 2014-04-03 10:14:22.000000000 -0500
+++ x2golistdesktops 2014-07-09 16:43:54.000000000 -0500
@@ -43,7 +43,7 @@
$serv=hostname;
}
-my $rsess=`x2golistsessions x2goserver |grep _stR`;
+my $rsess=`timeout 1s x2golistsessions x2goserver |grep _stR`;
my @rsess=split("\n","$rsess");
my @rdisplays;
for (my $i=0;$i<@rsess;$i++)
@@ -67,7 +67,7 @@
$checkdisp="${checkdisp}I";
if (!( $rdisp =~ m/$checkdisp/ ))
{
- my $inf=`xwininfo -root -display $display 2> /dev/null`;
+ my $inf=`timeout 1s xwininfo -root -display $display 2> /dev/null`;
if ( $inf=~ m/geometry/)
{
print "$uname\@$display\n";
@@ -88,4 +88,4 @@
}
# closing syslog
-closelog;
\ No newline at end of file
+closelog;
w