Skip to content
Snippets Groups Projects
Commit 14d4455a authored by Roman Lacko's avatar Roman Lacko
Browse files

Add back accidentally removed WBM::Fail

parent 8cdb9c7c
No related branches found
No related tags found
No related merge requests found
package WBM::Fail;
use v5.26;
use utf8;
use strict;
use warnings;
use parent qw(WBM::Driver);
use feature qw(signatures);
no warnings qw(experimental::signatures);
sub new($class, %args) {
my $self = $class->SUPER::new(%args);
$self->log->fatal("missing 'text' parameter in constructor")
unless defined $args{text};
$self->{text} = $args{text};
$self->{first} = 1;
return $self;
}
sub refresh_on_event($self) { 1; }
sub invoke($self) {
$self->log->info("invoked");
my $ret = {
text => $self->{text},
icon => "",
color => "dc322f",
cache => "+inf",
};
if ($self->{first}) {
$ret->{blink} = 30;
$ret->{invert} = "+inf";
$self->{first} = 0;
} else {
$ret->{reset_all} = 1;
}
return $ret;
}
# vim: syntax=perl5-24
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment