Update to 1.4.
This commit is contained in:
parent
612cfe0ea1
commit
625a339252
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=421431
@ -2,8 +2,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= rainbarf
|
||||
PORTVERSION= 1.3
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 1.4
|
||||
CATEGORIES= sysutils perl5
|
||||
MASTER_SITES= CPAN
|
||||
MASTER_SITE_SUBDIR= CPAN:SYP
|
||||
|
@ -1,2 +1,3 @@
|
||||
SHA256 (App-rainbarf-1.3.tar.gz) = 201892b1726a72275e0f5ae1ee15f3cd8627de72671e55489a921744687c8ba3
|
||||
SIZE (App-rainbarf-1.3.tar.gz) = 27292
|
||||
TIMESTAMP = 1473169613
|
||||
SHA256 (App-rainbarf-1.4.tar.gz) = 4f139ad35faaf2de0623dc0bb1dd89fa5a431e548bfec87dee194cf0e25cc97d
|
||||
SIZE (App-rainbarf-1.4.tar.gz) = 27703
|
||||
|
@ -1,36 +0,0 @@
|
||||
--- rainbarf.orig 2015-06-22 11:01:32 UTC
|
||||
+++ rainbarf
|
||||
@@ -430,6 +430,24 @@ sub battery_sys {
|
||||
return ($battery, $charging, $time);
|
||||
}
|
||||
|
||||
+sub battery_freebsd {
|
||||
+ my $battery = qx{/sbin/sysctl -n hw.acpi.battery.life 2>/dev/null} or return;
|
||||
+ my $charging = qx,/sbin/sysctl -n hw.acpi.battery.state,;
|
||||
+ my $time = qx,/sbin/sysctl -n hw.acpi.battery.time,;
|
||||
+
|
||||
+ $battery /= 100;
|
||||
+
|
||||
+ if ($charging == 2) {
|
||||
+ $charging = 1;
|
||||
+ } elsif ($charging == 7) { # Battery absent
|
||||
+ return;
|
||||
+ } else {
|
||||
+ $charging = 0;
|
||||
+ }
|
||||
+
|
||||
+ return ($battery, $charging, $time);
|
||||
+}
|
||||
+
|
||||
sub battery {
|
||||
my @battery;
|
||||
if (-x q{/usr/sbin/ioreg}) {
|
||||
@@ -438,6 +456,8 @@ sub battery {
|
||||
@battery = battery_acpi();
|
||||
} elsif (-d q(/sys/class/power_supply)) {
|
||||
@battery = battery_sys();
|
||||
+ } elsif ($^O eq q(freebsd)) {
|
||||
+ @battery = battery_freebsd();
|
||||
}
|
||||
|
||||
battery_print(@battery);
|
Loading…
Reference in New Issue
Block a user