# menu with quick config options
use Term::ReadKey;
+use Time::HiRes;
# enable alternate charset support (needed for screen)
print "\e(B\e)0";
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";
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
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";