diff --git a/thinkpad/pow.pl b/thinkpad/pow.pl index d794dc1..007c2e9 100755 --- a/thinkpad/pow.pl +++ b/thinkpad/pow.pl @@ -47,10 +47,6 @@ foreach (@devices) { close $t; $output .= '"Type":"' . $type . '"'; if ($name =~ /BAT[0-9]+/) { -<<<<<<< Updated upstream - $nobat = 0; -======= ->>>>>>> Stashed changes open(my $s,'<',"$_/status"); my $status = <$s>; chomp $status; @@ -88,13 +84,6 @@ foreach (@devices) { . '"'; } $output .= "},"; -<<<<<<< Updated upstream -} -unless ($nobat) { - print('{"AC":{"Type":"AC","Status":"Plugged-In"}}'); - exit(); -======= ->>>>>>> Stashed changes } $battery_total{'percentage'} = sprintf("%0d", @@ -115,15 +104,6 @@ if ($bar) { my $class = 'discharging'; $output = ''; if ($powref->{AC}->{Status} eq "Plugged-In") { -<<<<<<< Updated upstream - $class = 'charging'; - $output .= ""; - } elsif ($powref->{Total}->{Percentage} <= 10) { - $class = 'critical'; - $output .= ""; - } elsif ($powref->{Total}->{Percentage} <= 35) { - $class = 'low'; -======= $class = 'charging'; $output .= ""; } elsif ($powref->{Total}->{Percentage} <= 10) { @@ -131,7 +111,6 @@ if ($bar) { $output .= ""; } elsif ($powref->{Total}->{Percentage} <= 35) { $class = 'low'; ->>>>>>> Stashed changes $output .= ""; } elsif ($powref->{Total}->{Percentage} <= 60) { $output .= ""; @@ -154,19 +133,11 @@ if ($bar) { my $total = ''; $output = "Device Status Percentage\n"; foreach my $device (keys %{$powref}) { -<<<<<<< Updated upstream - my $status; - if ($powref->{$device}->{Status} eq "Plugged-In") { - $status = ""; - } elsif (!defined($powref->{$device}->{Percentage}) || $powref->{$device}->{Percentage} == 0) { - $status = " "; -======= my $status; if ($powref->{$device}->{Status} eq "Plugged-In") { $status = ""; } elsif (!defined($powref->{$device}->{Percentage}) || $powref->{$device}->{Percentage} == 0) { $status = " "; ->>>>>>> Stashed changes } elsif ($powref->{$device}->{Percentage} <= 10) { $status = " " . $powref->{$device}->{'Percentage'} . "%"; } elsif ($powref->{$device}->{Percentage} <= 35) { @@ -175,23 +146,6 @@ if ($bar) { $status = " " . $powref->{$device}->{'Percentage'} . "%"; } elsif ($powref->{$device}->{Percentage} <= 85) { $status = " " . $powref->{$device}->{'Percentage'} . "%"; -<<<<<<< Updated upstream - } else { - $status = " " . $powref->{$device}->{'Percentage'} . "%"; - } - if ($device eq 'Total') { - $total .= sprintf("%-24s %-12s", $device, $status); - } else { - #$output .= sprintf("%".length($powref->{$device->{'Type'}})."s (%".length($powref->{$device->{'Type'}})."s): %3d\%\n", $device, $device->{'Type'}, $device->{'Percentage'}); - my $name = ' ('.$powref->{$device}->{'Type'}.')'; - if ((length($device)+length($name)) >= 24) { - $name = substr($device, 0, (21-length($name))) . '...' . $name; - } else { - $name = substr(($device.$name), 0, 24); - } - $output .= sprintf("%-24s %-12s %-12s\n", $name, $powref->{$device}->{Status}, $status); - } -======= } else { $status = " " . $powref->{$device}->{'Percentage'} . "%"; } @@ -207,7 +161,6 @@ if ($bar) { } $output .= sprintf("%-24s %-12s %-12s\n", $name, $powref->{$device}->{Status}, $status); } ->>>>>>> Stashed changes } $output .= $total; }