Improve output for bar

This commit is contained in:
John Mertz 2022-04-19 00:36:00 -04:00 committed by John Mertz
parent 274d9cc75b
commit 7876519667
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
1 changed files with 2 additions and 3 deletions

View File

@ -96,9 +96,8 @@ if ($bar) {
use JSON::XS;
my $json = JSON::XS->new();
my $powref = $json->decode($output);
my $icon;
my $class = 'discharging';
$output = '{"text": "' . $powref->{Total}->{Percentage} . '% ';
$output = '{"text": "';
if ($powref->{AC}->{Status} eq "Plugged-In") {
$class = 'charging';
$output .= "";
@ -115,7 +114,7 @@ if ($bar) {
} else {
$output .= "";
}
$output .= '", "tooltip": "' . $class . '", "class": "' . $class . '"}';
$output .= $powref->{Total}->{Percentage} . '%", "tooltip": "' . $class . '", "class": "' . $class . '"}';
} elsif ($pretty) {
use JSON::XS;
my $json = JSON::XS->new();