revbank/plugins/idle
Juerd Waalboer fa60e1081a chmod 644 plugins/*
Undoes 714b337 because github seems to no longer require chmod +x
for syntax highlighting extensionless files.
2019-08-07 15:42:16 +02:00

28 lines
723 B
Perl

#!perl
my $timeout = 10;
sub command { NEXT }
sub hook_prompt_idle {
my ($class, $cart, $plugin, $seconds, $readline) = @_;
if ($seconds >= $timeout and $cart->size and not $plugin) {
call_hooks("beep");
return if $seconds > $timeout; # text only once
my $text = $readline->copy_text;
my $point = $readline->{point};
$readline->save_prompt;
$readline->replace_line("");
$readline->redisplay;
print "\e[33;2;1mTransaction incomplete.\e[0m Enter username to pay/finish or 'abort' to abort.\n";
$readline->restore_prompt;
$readline->replace_line($text);
$readline->{point} = $point;
$readline->redisplay;
}
}