Updated sysutils/xfce4-battery-plugin to 0.5.0nb1
- Don't change behavior of remaining time on Linux and FreeBSD. - Don't print remaining percentage as `100%' if there are no batteries.
This commit is contained in:
parent
f4db5f10be
commit
52475c81f8
4 changed files with 27 additions and 19 deletions
|
@ -1,10 +1,11 @@
|
|||
# $NetBSD: Makefile,v 1.1.1.1 2007/04/27 10:48:06 martti Exp $
|
||||
# $NetBSD: Makefile,v 1.2 2007/05/01 17:41:59 martti Exp $
|
||||
|
||||
.include "../../meta-pkgs/xfce4/Makefile.common"
|
||||
|
||||
XFCE4_VERSION= 0.5.0
|
||||
|
||||
DISTNAME= xfce4-battery-plugin-${XFCE4_VERSION}
|
||||
PKGREVISION= 1
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= http://goodies.xfce.org/releases/xfce4-battery-plugin/
|
||||
COMMENT= Xfce battey monitor plugin
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: buildlink3.mk,v 1.1 2007/04/27 11:09:26 martti Exp $
|
||||
# $NetBSD: buildlink3.mk,v 1.2 2007/05/01 17:42:00 martti Exp $
|
||||
|
||||
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
|
||||
XFCE4_BATTERY_PLUGIN_BUILDLINK3_MK:= ${XFCE4_BATTERY_PLUGIN_BUILDLINK3_MK}+
|
||||
|
@ -12,7 +12,7 @@ BUILDLINK_PACKAGES+= xfce4-battery-plugin
|
|||
BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}xfce4-battery-plugin
|
||||
|
||||
.if ${XFCE4_BATTERY_PLUGIN_BUILDLINK3_MK} == "+"
|
||||
BUILDLINK_API_DEPENDS.xfce4-battery-plugin+= xfce4-battery-plugin>=0.5.0
|
||||
BUILDLINK_API_DEPENDS.xfce4-battery-plugin+= xfce4-battery-plugin>=0.5.0nb1
|
||||
BUILDLINK_PKGSRCDIR.xfce4-battery-plugin?= ../../sysutils/xfce4-battery-plugin
|
||||
.endif # XFCE4_BATTERY_PLUGIN_BUILDLINK3_MK
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$NetBSD: distinfo,v 1.1.1.1 2007/04/27 10:48:06 martti Exp $
|
||||
$NetBSD: distinfo,v 1.2 2007/05/01 17:42:00 martti Exp $
|
||||
|
||||
SHA1 (xfce4-battery-plugin-0.5.0.tar.bz2) = 63439d32bfe8411458d41c38824cb393bc31d6e0
|
||||
RMD160 (xfce4-battery-plugin-0.5.0.tar.bz2) = bbf64994c7686b11b6a51bd7728569cd2a5d9777
|
||||
Size (xfce4-battery-plugin-0.5.0.tar.bz2) = 222269 bytes
|
||||
SHA1 (patch-aa) = a4cc107c41cde28e94f66a40b90ce1cb9909a6d8
|
||||
SHA1 (patch-aa) = 59c9bda919abd16c25da75ea4d9946fd7bb18514
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$NetBSD: patch-aa,v 1.1.1.1 2007/04/27 10:48:06 martti Exp $
|
||||
$NetBSD: patch-aa,v 1.2 2007/05/01 17:42:00 martti Exp $
|
||||
|
||||
--- panel-plugin/battery.c.orig 2007-01-18 02:56:51.000000000 +0900
|
||||
+++ panel-plugin/battery.c 2007-04-25 02:57:46.000000000 +0900
|
||||
+++ panel-plugin/battery.c 2007-05-01 01:32:49.000000000 +0900
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <machine/apmvar.h>
|
||||
#define APMDEVICE "/dev/apm"
|
||||
+#define _APM_BATT_UNKNOWN 0xffff /* from sys/dev/acpi/acpi_apm.c */
|
||||
+#define _ACPI_APM_BATT_UNKNOWN 0xffff /* from sys/dev/acpi/acpi_apm.c */
|
||||
#elif __linux__
|
||||
#include <libapm.h>
|
||||
#endif
|
||||
|
@ -37,20 +37,27 @@ $NetBSD: patch-aa,v 1.1.1.1 2007/04/27 10:48:06 martti Exp $
|
|||
#else
|
||||
struct apm_info apm;
|
||||
DBG ("Updating battery status...");
|
||||
@@ -477,7 +481,15 @@
|
||||
@@ -460,6 +464,11 @@
|
||||
|
||||
if(battmon->options.display_percentage && !(battmon->options.hide_when_full && acline && charge >= 99)){
|
||||
gtk_widget_show((GtkWidget *)battmon->charge);
|
||||
+#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
+ if (apm.nbattery == 0)
|
||||
+ g_snprintf(buffer, sizeof(buffer),"--%% ");
|
||||
+ else
|
||||
+#endif
|
||||
g_snprintf(buffer, sizeof(buffer),"%d%% ", charge);
|
||||
gtk_label_set_text(battmon->charge,buffer);
|
||||
} else {
|
||||
@@ -477,6 +486,11 @@
|
||||
}
|
||||
|
||||
gtk_widget_show((GtkWidget *)active_label);
|
||||
- g_snprintf(buffer, sizeof(buffer),"%02d:%02d ",time_remaining/60,time_remaining%60);
|
||||
+ if (acline
|
||||
+#ifdef __NetBSD__
|
||||
+ || time_remaining == _APM_BATT_UNKNOWN
|
||||
+#if defined(__NetBSD__)
|
||||
+ if (acline || time_remaining == _ACPI_APM_BATT_UNKNOWN)
|
||||
+ g_snprintf(buffer, sizeof(buffer), "--:--");
|
||||
+ else
|
||||
+#endif
|
||||
+ )
|
||||
+ g_snprintf(buffer, sizeof(buffer), "--:--");
|
||||
+ else
|
||||
+ g_snprintf(buffer, sizeof(buffer),"%02d:%02d ",
|
||||
+ time_remaining/60,time_remaining%60);
|
||||
g_snprintf(buffer, sizeof(buffer),"%02d:%02d ",time_remaining/60,time_remaining%60);
|
||||
gtk_label_set_text(active_label,buffer);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue