Update --bar formatting
This commit is contained in:
parent
922e3708c2
commit
bd0bbdb727
|
@ -97,7 +97,7 @@ if ($bar) {
|
|||
my $json = JSON::XS->new();
|
||||
my $powref = $json->decode($output);
|
||||
my $class = 'discharging';
|
||||
$output = '{"text": "';
|
||||
$output = '';
|
||||
if ($powref->{AC}->{Status} eq "Plugged-In") {
|
||||
$class = 'charging';
|
||||
$output .= "";
|
||||
|
@ -114,7 +114,13 @@ if ($bar) {
|
|||
} else {
|
||||
$output .= "";
|
||||
}
|
||||
$output .= $powref->{Total}->{Percentage} . '%", "tooltip": "' . $class . '", "class": "' . $class . '"}';
|
||||
$output = '{'
|
||||
. '"text":"' . $output . '\u200a' . $powref->{Total}->{Percentage} . '%",'
|
||||
. '"icon":"' . $output . '",'
|
||||
. '"percentage":"' . $powref->{Total}->{Percentage} . '",'
|
||||
. '"tooltip":"' . $class . '",'
|
||||
. '"class":"' . $class . '"'
|
||||
. '}';
|
||||
} elsif ($pretty) {
|
||||
use JSON::XS;
|
||||
my $json = JSON::XS->new();
|
||||
|
|
Loading…
Reference in New Issue