summaryrefslogtreecommitdiff
path: root/sysutils/xfce4-battery-plugin
diff options
context:
space:
mode:
authormartti <martti@pkgsrc.org>2007-04-27 10:48:06 +0000
committermartti <martti@pkgsrc.org>2007-04-27 10:48:06 +0000
commite2e715f6b3c89dc4c58046e7eca72483d2cc21d5 (patch)
treeae3f1977510b30b4fdce4a142938642820f786b9 /sysutils/xfce4-battery-plugin
parent1dc01a9ac8c6ae56e862ea199710e16c827d5203 (diff)
downloadpkgsrc-e2e715f6b3c89dc4c58046e7eca72483d2cc21d5.tar.gz
Added some Xfce plugins.
Diffstat (limited to 'sysutils/xfce4-battery-plugin')
-rw-r--r--sysutils/xfce4-battery-plugin/DESCR1
-rw-r--r--sysutils/xfce4-battery-plugin/Makefile16
-rw-r--r--sysutils/xfce4-battery-plugin/PLIST13
-rw-r--r--sysutils/xfce4-battery-plugin/distinfo6
-rw-r--r--sysutils/xfce4-battery-plugin/patches/patch-aa56
5 files changed, 92 insertions, 0 deletions
diff --git a/sysutils/xfce4-battery-plugin/DESCR b/sysutils/xfce4-battery-plugin/DESCR
new file mode 100644
index 00000000000..d72ea84c6d2
--- /dev/null
+++ b/sysutils/xfce4-battery-plugin/DESCR
@@ -0,0 +1 @@
+Battery monitor plugin for Xfce.
diff --git a/sysutils/xfce4-battery-plugin/Makefile b/sysutils/xfce4-battery-plugin/Makefile
new file mode 100644
index 00000000000..ebb36ceaf2d
--- /dev/null
+++ b/sysutils/xfce4-battery-plugin/Makefile
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/04/27 10:48:06 martti Exp $
+
+.include "../../meta-pkgs/xfce4/Makefile.common"
+
+XFCE4_VERSION= 0.5.0
+
+DISTNAME= xfce4-battery-plugin-${XFCE4_VERSION}
+CATEGORIES= sysutils
+MASTER_SITES= http://goodies.xfce.org/releases/xfce4-battery-plugin/
+COMMENT= Xfce battey monitor plugin
+
+USE_TOOLS+= perl:run
+
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../x11/xfce4-panel/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/xfce4-battery-plugin/PLIST b/sysutils/xfce4-battery-plugin/PLIST
new file mode 100644
index 00000000000..128305d8e07
--- /dev/null
+++ b/sysutils/xfce4-battery-plugin/PLIST
@@ -0,0 +1,13 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/04/27 10:48:06 martti Exp $
+libexec/xfce4/panel-plugins/xfce4-battery-plugin
+share/icons/hicolor/16x16/devices/battery.png
+share/icons/hicolor/22x22/devices/battery.png
+share/icons/hicolor/24x24/devices/battery.png
+share/icons/hicolor/32x32/devices/battery.png
+share/icons/hicolor/scalable/devices/battery.svg
+share/locale/ca/LC_MESSAGES/xfce4-battery-plugin.mo
+share/locale/cs/LC_MESSAGES/xfce4-battery-plugin.mo
+share/locale/eu/LC_MESSAGES/xfce4-battery-plugin.mo
+share/locale/fr/LC_MESSAGES/xfce4-battery-plugin.mo
+share/locale/pl/LC_MESSAGES/xfce4-battery-plugin.mo
+share/xfce4/panel-plugins/battmon.desktop
diff --git a/sysutils/xfce4-battery-plugin/distinfo b/sysutils/xfce4-battery-plugin/distinfo
new file mode 100644
index 00000000000..3d287e6a780
--- /dev/null
+++ b/sysutils/xfce4-battery-plugin/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/04/27 10:48:06 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
diff --git a/sysutils/xfce4-battery-plugin/patches/patch-aa b/sysutils/xfce4-battery-plugin/patches/patch-aa
new file mode 100644
index 00000000000..3cfcbadec4b
--- /dev/null
+++ b/sysutils/xfce4-battery-plugin/patches/patch-aa
@@ -0,0 +1,56 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/04/27 10:48:06 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
+@@ -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 */
+ #elif __linux__
+ #include <libapm.h>
+ #endif
+@@ -209,7 +210,7 @@
+ battmon->method = BM_BROKEN;
+ fd = open(APMDEVICE, O_RDONLY);
+ if (fd == -1) return FALSE;
+- + if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1) {
++ if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1) {
+ close(fd);
+ return FALSE;
+ }
+@@ -302,13 +303,16 @@
+ battmon->method = BM_BROKEN;
+ fd = open(APMDEVICE, O_RDONLY);
+ if (fd == -1) return TRUE;
+- if (ioctl(fd, APM_IOC_GETPOWER, &apminfo) == -1)
++ if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1)
+ return TRUE;
+ close(fd);
+ charge = apm.battery_life;
+ time_remaining = apm.minutes_left;
+ acline = apm.ac_state ? TRUE : FALSE;
+
++ if(battmon->timeoutid != 0) g_source_remove(battmon->timeoutid);
++ battmon->timeoutid = g_timeout_add(2 * 1024,
++ (GSourceFunc) update_apm_status, battmon);
+ #else
+ struct apm_info apm;
+ DBG ("Updating battery status...");
+@@ -477,7 +481,15 @@
+ }
+
+ 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
++#endif
++ )
++ g_snprintf(buffer, sizeof(buffer), "--:--");
++ else
++ g_snprintf(buffer, sizeof(buffer),"%02d:%02d ",
++ time_remaining/60,time_remaining%60);
+ gtk_label_set_text(active_label,buffer);
+
+ } else {