Update --bar formatting
This commit is contained in:
parent
aa70b984c3
commit
58c03333a7
|
@ -97,7 +97,7 @@ if ($bar) {
|
||||||
my $json = JSON::XS->new();
|
my $json = JSON::XS->new();
|
||||||
my $powref = $json->decode($output);
|
my $powref = $json->decode($output);
|
||||||
my $class = 'discharging';
|
my $class = 'discharging';
|
||||||
$output = '{"text": "';
|
$output = '';
|
||||||
if ($powref->{AC}->{Status} eq "Plugged-In") {
|
if ($powref->{AC}->{Status} eq "Plugged-In") {
|
||||||
$class = 'charging';
|
$class = 'charging';
|
||||||
$output .= "";
|
$output .= "";
|
||||||
|
@ -114,7 +114,13 @@ if ($bar) {
|
||||||
} else {
|
} else {
|
||||||
$output .= "";
|
$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) {
|
} elsif ($pretty) {
|
||||||
use JSON::XS;
|
use JSON::XS;
|
||||||
my $json = JSON::XS->new();
|
my $json = JSON::XS->new();
|
||||||
|
|
Loading…
Reference in New Issue