diff --git a/thinkpad/pow.pl b/thinkpad/pow.pl index 3c7b0fb..7ffdce6 100755 --- a/thinkpad/pow.pl +++ b/thinkpad/pow.pl @@ -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();