Improve output for bar
This commit is contained in:
parent
274d9cc75b
commit
7876519667
|
@ -96,9 +96,8 @@ if ($bar) {
|
||||||
use JSON::XS;
|
use JSON::XS;
|
||||||
my $json = JSON::XS->new();
|
my $json = JSON::XS->new();
|
||||||
my $powref = $json->decode($output);
|
my $powref = $json->decode($output);
|
||||||
my $icon;
|
|
||||||
my $class = 'discharging';
|
my $class = 'discharging';
|
||||||
$output = '{"text": "' . $powref->{Total}->{Percentage} . '% ';
|
$output = '{"text": "';
|
||||||
if ($powref->{AC}->{Status} eq "Plugged-In") {
|
if ($powref->{AC}->{Status} eq "Plugged-In") {
|
||||||
$class = 'charging';
|
$class = 'charging';
|
||||||
$output .= "";
|
$output .= "";
|
||||||
|
@ -115,7 +114,7 @@ if ($bar) {
|
||||||
} else {
|
} else {
|
||||||
$output .= "";
|
$output .= "";
|
||||||
}
|
}
|
||||||
$output .= '", "tooltip": "' . $class . '", "class": "' . $class . '"}';
|
$output .= $powref->{Total}->{Percentage} . '%", "tooltip": "' . $class . '", "class": "' . $class . '"}';
|
||||||
} elsif ($pretty) {
|
} elsif ($pretty) {
|
||||||
use JSON::XS;
|
use JSON::XS;
|
||||||
my $json = JSON::XS->new();
|
my $json = JSON::XS->new();
|
||||||
|
|
Loading…
Reference in New Issue