'indicators:s',
'palette=s' => sub {
$opt{palette} = {
+ '' => [],
fire => [qw( 90 31 91 33 93 97 96 )],
fire256=> [map {"38;5;$_"} qw(
235 52 88 124 160 196
)],
whites => [qw( 1;30 0;37 1;37 )],
greys => [map {"38;5;$_"} 0, 232..255, 15],
+ random => [map {"38;5;$_"} List::Util::shuffle(17..231)],
rainbow=> [map {"38;5;$_"}
196, # r
(map { 196 + $_*6 } 0..4), # +g
(map { 201 - $_ } 0..4), # -b
196,
],
- }->{$_[1]} // [ split /[^0-9;]/, $_[1] ];
+ }->{$_[1]} // do {
+ my @vals = split /[^0-9;]/, $_[1]
+ or die "Empty palette resulting from \"$_[1]\"\n";
+ \@vals;
+ };
},
'stat|s!',
'signal-stat=s',
$opt{'signal-stat'} //= exists $SIG{INFO} ? 'INFO' : 'QUIT';
$opt{markers} //= '=avg >31.73v <68.27v +50v |0';
$opt{palette} //= $opt{color} && [31, 90, 32];
-$opt{indicators} = [split //,
- $opt{indicators} || ($opt{ascii} ? ' .oO' : ' ▁▂▃▄▅▆▇█')
+$opt{indicators} = [split //, $opt{indicators} ||
+ ($opt{ascii} ? ' .oO' : $opt{spark} ? ' ▁▂▃▄▅▆▇█' : ' ▏▎▍▌▋▊▉█')
] if defined $opt{indicators} or $opt{spark};
$opt{hidemin} = ($opt{hidemin} || 1) - 1;
$opt{input} = (@ARGV && $ARGV[0] =~ m/\A[-0-9]/) ? \@ARGV : undef
$val == $order[-1] ? $opt{palette}->[0] : # min
$opt{palette}->[ $rel * ($#{$opt{palette}} - 1) + 1 ];
my $indicator = $opt{indicators} && $opt{indicators}->[
- !$val || !$#{$opt{indicators}} ? 0 : # blank
+ !length($val) || !$#{$opt{indicators}} ? 0 : # blank
$#{$opt{indicators}} < 2 ? 1 :
$val >= $order[0] ? -1 :
$rel * ($#{$opt{indicators}} - 1e-14) + 1