Small changes to the grml-quickonfig errormessage
[grml-scripts.git] / usr_sbin / grml-quickconfig
index 2896c69..aef071a 100755 (executable)
@@ -10,6 +10,7 @@
 # menu with quick config options
 
 use Term::ReadKey;
+use Time::HiRes;
 
 # enable alternate charset support (needed for screen)
 print "\e(B\e)0";
@@ -101,13 +102,14 @@ EOF
   ReadMode 4; # Turn off controls keys
   while (not defined ($x = ReadKey(-1))) {
       # No key yet
+      Time::HiRes::sleep(0.5); 
   }
   ReadMode 0; # Reset tty mode before exiting
 
   print $N.$/.$/;
   if (defined($menu_commands{$x})) {
       $command = $menu_commands{$x};
-  } elsif ($x eq "\n") {
+  } elsif ($x eq "\n" || $x eq ' ') {
       $command= 'exit';
   } elsif ($x eq "x") {
       print <<"EOF";
@@ -126,6 +128,7 @@ EOF
       ReadMode 4; # Turn off controls keys
       while (not defined ($x = ReadKey(-1))) {
     # No key yet
+        Time::HiRes::sleep(0.5); 
       }
       ReadMode 0; # Reset tty mode before exiting
 
@@ -133,7 +136,8 @@ EOF
       if (defined($windowmanagers{$x})) {
     $command = "su - grml -c 'grml-x ".$windowmanagers{$x}."'";
       } else {
-    print "Unknown key. Returning to main menu.\n";
+    print "Unknown key, not bound to a windowmanager.\n";
+    print "Returning to main menu.\n";
       }
   } else {
       print "Unknown key.\n";