aboutsummaryrefslogtreecommitdiff
path: root/x11/lxpanel
diff options
context:
space:
mode:
authorWilliam Grzybowski <wg@FreeBSD.org>2013-08-27 15:32:57 +0000
committerWilliam Grzybowski <wg@FreeBSD.org>2013-08-27 15:32:57 +0000
commit149b1a234ead248ecb6483cb36dc85b5dd358713 (patch)
treeaa648a90a73368d1367a5aaf2ba832487e87e496 /x11/lxpanel
parent47388a0b29a4dbbb59c348595b2da625d902e6f4 (diff)
downloadports-149b1a234ead248ecb6483cb36dc85b5dd358713.tar.gz
ports-149b1a234ead248ecb6483cb36dc85b5dd358713.zip
Notes
Diffstat (limited to 'x11/lxpanel')
-rw-r--r--x11/lxpanel/Makefile5
-rw-r--r--x11/lxpanel/distinfo4
-rw-r--r--x11/lxpanel/files/patch-src__plugins__batt__batt.c111
-rw-r--r--x11/lxpanel/files/patch-src__plugins__batt__batt_sys.c268
-rw-r--r--x11/lxpanel/files/patch-src__plugins__batt__batt_sys.h26
5 files changed, 4 insertions, 410 deletions
diff --git a/x11/lxpanel/Makefile b/x11/lxpanel/Makefile
index 6d77db8ddcd1..d5667311320b 100644
--- a/x11/lxpanel/Makefile
+++ b/x11/lxpanel/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= lxpanel
-PORTVERSION= 0.5.12
-PORTREVISION= 1
+PORTVERSION= 0.6.0
CATEGORIES= x11
MASTER_SITES= SF/lxde/LXPanel%20%28desktop%20panel%29/LXPanel%20${PORTVERSION}/
@@ -33,7 +32,7 @@ USE_CSTD= gnu89
MAN1= lxpanel.1 lxpanelctl.1
-PORTDOCS= AUTHORS README TODO
+PORTDOCS= AUTHORS README
.include <bsd.port.options.mk>
diff --git a/x11/lxpanel/distinfo b/x11/lxpanel/distinfo
index 01b236e5e388..054cbc46e512 100644
--- a/x11/lxpanel/distinfo
+++ b/x11/lxpanel/distinfo
@@ -1,2 +1,2 @@
-SHA256 (lxpanel-0.5.12.tar.gz) = 11cfe76f6241bbac556e57a6efc079b6e10dceea76a8bdaf4c749afdb81d15ab
-SIZE (lxpanel-0.5.12.tar.gz) = 2048801
+SHA256 (lxpanel-0.6.0.tar.gz) = ab1f395d03fe585acb4bc2d63e5ebe8af4243644c136f588f1dfa99c7c26f9d7
+SIZE (lxpanel-0.6.0.tar.gz) = 2083742
diff --git a/x11/lxpanel/files/patch-src__plugins__batt__batt.c b/x11/lxpanel/files/patch-src__plugins__batt__batt.c
deleted file mode 100644
index 2adc4970b586..000000000000
--- a/x11/lxpanel/files/patch-src__plugins__batt__batt.c
+++ /dev/null
@@ -1,111 +0,0 @@
-diff --git src/plugins/batt/batt.c src/plugins/batt/batt.c
-index d288132..6088c53 100644
---- src/plugins/batt/batt.c
-+++ src/plugins/batt/batt.c
-@@ -68,7 +68,7 @@ typedef struct {
- cairo_surface_t *pixmap;
- GtkWidget *drawingArea;
- int orientation;
-- unsigned int alarmTime,
-+ unsigned int alarmPercentage,
- border,
- height,
- length,
-@@ -118,7 +118,6 @@ void update_display(lx_battery *lx_b, gboolean repaint) {
- char tooltip[ 256 ];
- battery *b = lx_b->b;
- /* unit: mW */
-- int rate;
- gboolean isCharging;
-
- if (! lx_b->pixmap )
-@@ -128,9 +127,12 @@ void update_display(lx_battery *lx_b, gboolean repaint) {
- cairo_set_line_width (cr, 1.0);
-
- /* no battery is found */
-- if( b == NULL )
-+ if( b == NULL || b->percentage < 0 )
- {
- gtk_widget_set_tooltip_text( lx_b->drawingArea, _("No batteries found") );
-+ gdk_cairo_set_source_color(cr, &lx_b->background);
-+ cairo_rectangle(cr, 0, 0, lx_b->width, lx_b->height);
-+ cairo_fill(cr);
- return;
- }
-
-@@ -141,12 +143,11 @@ void update_display(lx_battery *lx_b, gboolean repaint) {
-
- /* fixme: only one battery supported */
-
-- rate = lx_b->b->current_now;
- isCharging = battery_is_charging ( b );
-
- /* Consider running the alarm command */
-- if ( !isCharging && rate > 0 &&
-- ( ( battery_get_remaining( b ) / 60 ) < lx_b->alarmTime ) )
-+ if ( !isCharging &&
-+ ( ( b->percentage ) < lx_b->alarmPercentage ) )
- {
- /* Shrug this should be done using glibs process functions */
- /* Alarms should not run concurrently; determine whether an alarm is
-@@ -176,7 +177,7 @@ void update_display(lx_battery *lx_b, gboolean repaint) {
- int left_seconds = b->seconds - 3600 * hours;
- int minutes = left_seconds / 60;
- snprintf(tooltip, 256,
-- _("Battery: %d%% charged, %d:%02d until full"),
-+ _("Battery: %d%% charged"),
- lx_b->b->percentage,
- hours,
- minutes );
-@@ -187,10 +188,10 @@ void update_display(lx_battery *lx_b, gboolean repaint) {
- int left_seconds = b->seconds - 3600 * hours;
- int minutes = left_seconds / 60;
- snprintf(tooltip, 256,
-- _("Battery: %d%% charged, %d:%02d left"),
-+ _("Battery: %d%% charged, %d:%02dh left"),
- lx_b->b->percentage,
-- hours,
-- minutes );
-+ hours,
-+ minutes);
- } else {
- snprintf(tooltip, 256,
- _("Battery: %d%% charged"),
-@@ -375,7 +376,7 @@ constructor(Plugin *p, char **fp)
- = lx_b->dischargingColor1 = lx_b->dischargingColor2 = NULL;
-
- /* Set default values for integers */
-- lx_b->alarmTime = 5;
-+ lx_b->alarmPercentage = 10;
- lx_b->requestedBorder = 1;
-
- line s;
-@@ -404,8 +405,8 @@ constructor(Plugin *p, char **fp)
- lx_b->dischargingColor1 = g_strdup(s.t[1]);
- else if (!g_ascii_strcasecmp(s.t[0], "DischargingColor2"))
- lx_b->dischargingColor2 = g_strdup(s.t[1]);
-- else if (!g_ascii_strcasecmp(s.t[0], "AlarmTime"))
-- lx_b->alarmTime = atoi(s.t[1]);
-+ else if (!g_ascii_strcasecmp(s.t[0], "AlarmPercentage"))
-+ lx_b->alarmPercentage = atoi(s.t[1]);
- else if (!g_ascii_strcasecmp(s.t[0], "BorderWidth"))
- lx_b->requestedBorder = atoi(s.t[1]);
- else if (!g_ascii_strcasecmp(s.t[0], "Size")) {
-@@ -554,7 +555,7 @@ static void config(Plugin *p, GtkWindow* parent) {
- _("Hide if there is no battery"), &b->hide_if_no_battery, CONF_TYPE_BOOL,
- #endif
- _("Alarm command"), &b->alarmCommand, CONF_TYPE_STR,
-- _("Alarm time (minutes left)"), &b->alarmTime, CONF_TYPE_INT,
-+ _("Alarm percentage (percentage left)"), &b->alarmPercentage, CONF_TYPE_INT,
- _("Background color"), &b->backgroundColor, CONF_TYPE_STR,
- _("Charging color 1"), &b->chargingColor1, CONF_TYPE_STR,
- _("Charging color 2"), &b->chargingColor2, CONF_TYPE_STR,
-@@ -574,7 +575,7 @@ static void save(Plugin* p, FILE* fp) {
-
- lxpanel_put_bool(fp, "HideIfNoBattery",lx_b->hide_if_no_battery);
- lxpanel_put_str(fp, "AlarmCommand", lx_b->alarmCommand);
-- lxpanel_put_int(fp, "AlarmTime", lx_b->alarmTime);
-+ lxpanel_put_int(fp, "AlarmPercentage", lx_b->alarmPercentage);
- lxpanel_put_str(fp, "BackgroundColor", lx_b->backgroundColor);
- lxpanel_put_int(fp, "BorderWidth", lx_b->requestedBorder);
- lxpanel_put_str(fp, "ChargingColor1", lx_b->chargingColor1);
diff --git a/x11/lxpanel/files/patch-src__plugins__batt__batt_sys.c b/x11/lxpanel/files/patch-src__plugins__batt__batt_sys.c
deleted file mode 100644
index ed808cd4bdb0..000000000000
--- a/x11/lxpanel/files/patch-src__plugins__batt__batt_sys.c
+++ /dev/null
@@ -1,268 +0,0 @@
---- src/plugins/batt/batt_sys.c.orig 2012-04-16 15:53:13.000000000 -0400
-+++ src/plugins/batt/batt_sys.c 2012-09-05 13:21:28.945076259 -0400
-@@ -39,26 +39,10 @@
- static int battery_num = 1;
- battery * b = g_new0 ( battery, 1 );
- b->type_battery = TRUE;
-- b->capacity_unit = "mAh";
-- b->energy_full = -1;
-- b->charge_full = -1;
-- b->voltage_now = -1;
-- b->energy_full_design = -1;
-- b->charge_full_design = -1;
-- b->energy_now = -1;
-- b->charge_now = -1;
-- b->current_now = -1;
-- b->power_now = -1;
- b->state = NULL;
-- b->battery_num = battery_num;
-- b->seconds = -1;
-- b->percentage = -1;
-- b->poststr = NULL;
-- battery_num++;
- return b;
- }
-
--
- static gchar* parse_info_file(battery *b, char *sys_file)
- {
- char *buf = NULL;
-@@ -97,7 +81,7 @@
- return parse_info_file(b, sys_file);
- }
-
--void battery_print(battery *b, int show_capacity)
-+void battery_print(battery *b)
- {
- if ( b->type_battery )
- {
-@@ -110,34 +94,13 @@
- int seconds = b->seconds - 3600 * hours;
- int minutes = seconds / 60;
- seconds -= 60 * minutes;
-- printf(", %02d:%02d:%02d%s", hours, minutes, seconds,
-- b->poststr);
-+ printf(", %02d:%02d:%02d", hours, minutes, seconds);
- } else if (b->poststr != NULL) {
- printf(", %s", b->poststr);
- }
-
- printf("\n");
-
-- if (show_capacity && b->charge_full_design > 0) {
-- int percentage = -1;
-- int charge_full = -1;
-- if (b->charge_full <= 100) {
-- /* some broken systems just give a percentage here */
-- percentage = b->charge_full;
-- charge_full = percentage * b->charge_full_design / 100;
-- } else {
-- percentage = b->charge_full * 100 / b->charge_full_design;
-- charge_full = b->charge_full;
-- }
-- if (percentage > 100)
-- percentage = 100;
--
-- printf ("%s %d: design capacity %d %s, "
-- "last full capacity %d %s = %d%%\n",
-- BATTERY_DESC, b->battery_num - 1, b->charge_full_design,
-- b->capacity_unit, charge_full, b->capacity_unit,
-- percentage);
-- }
- }
- }
- }
-@@ -145,143 +108,48 @@
-
- void battery_update(battery *b)
- {
-- gchar *gctmp;
--
-- /* read from sysfs */
-- b->charge_now = get_gint_from_infofile(b, "charge_now");
-- b->energy_now = get_gint_from_infofile(b, "energy_now");
--
-- b->current_now = get_gint_from_infofile(b, "current_now");
-- b->power_now = get_gint_from_infofile(b, "power_now");
-- /* FIXME: Some battery drivers report -1000 when the discharge rate is
-- * unavailable. Others use negative values when discharging. Best we can do
-- * is to treat -1 as an error, and take the absolute value otherwise.
-- * Ideally the kernel would not export the sysfs file when the value is not
-- * available. */
-- if (b->current_now < -1)
-- b->current_now = - b->current_now;
-- if (b->power_now < -1)
-- b->power_now = - b->power_now;
--
-- b->charge_full = get_gint_from_infofile(b, "charge_full");
-- b->energy_full = get_gint_from_infofile(b, "energy_full");
--
-- b->charge_full_design = get_gint_from_infofile(b, "charge_full_design");
-- b->energy_full_design = get_gint_from_infofile(b, "energy_full_design");
--
-- b->voltage_now = get_gint_from_infofile(b, "voltage_now");
--
-- gctmp = get_gchar_from_infofile(b, "type");
-- b->type_battery = gctmp ? (strcasecmp(gctmp, "battery") == 0) : TRUE;
--
-- b->state = get_gchar_from_infofile(b, "status");
-- if (!b->state)
-- b->state = get_gchar_from_infofile(b, "state");
-- if (!b->state) {
-- if (b->charge_now != -1 || b->energy_now != -1
-- || b->charge_full != -1 || b->energy_full != -1)
-- b->state = "available";
-- else
-- b->state = "unavailable";
-- }
--
--
-- /* convert energy values (in mWh) to charge values (in mAh) if needed and possible */
--
-- if (b->energy_full != -1 && b->charge_full == -1) {
-- if (b->voltage_now != -1) {
-- b->charge_full = b->energy_full * 1000 / b->voltage_now;
-- } else {
-- b->charge_full = b->energy_full;
-- b->capacity_unit = "mWh";
-- }
-- }
--
-- if (b->energy_full_design != -1 && b->charge_full_design == -1) {
-- if (b->voltage_now != -1) {
-- b->charge_full_design = b->energy_full_design * 1000 / b->voltage_now;
-- } else {
-- b->charge_full_design = b->energy_full_design;
-- b->capacity_unit = "mWh";
-- }
-- }
--
-- if (b->energy_now != -1 && b->charge_now == -1) {
-- if (b->voltage_now != -1) {
-- b->charge_now = b->energy_now * 1000 / b->voltage_now;
-- if (b->current_now != -1)
-- b->current_now = b->current_now * 1000 / b->voltage_now;
-- } else {
-- b->charge_now = b->energy_now;
-- }
-- }
--
-- if (b->power_now != -1 && b->current_now == -1) {
-- if (b->voltage_now != -1 && b->voltage_now != 0)
-- b->current_now = b->power_now * 1000 / b->voltage_now;
-- }
--
--
-- if (b->charge_full < MIN_CAPACITY)
-- b->percentage = 0;
-- else {
-- int promille = (b->charge_now * 1000) / b->charge_full;
-- b->percentage = (promille + 5) / 10; /* round properly */
-- }
-- if (b->percentage > 100)
-- b->percentage = 100;
--
-+ char sstmp[ 100 ];
-+ int c, state;
-+ size_t intlen = sizeof c;
-+
-+ snprintf(sstmp, sizeof(sstmp), "hw.acpi.battery.life");
-+ sysctlbyname(sstmp, &c, &intlen, NULL, 0);
-+ b->percentage = c;
-+
-+ snprintf(sstmp, sizeof(sstmp), "hw.acpi.battery.state");
-+ sysctlbyname(sstmp, &state, &intlen, NULL, 0);
-+
-+ switch(state) {
-+ case BATT_FULL:
-+ b->state = "Full";
-+ break;
-+ case BATT_DISCHARGING:
-+ b->state = "Discharging";
-+ break;
-+ case BATT_CHARGING:
-+ b->state = "Charging";
-+ break;
-+ case BATT_CRITICAL:
-+ b->state = "Critical";
-+ break;
-+ case BATT_NONE:
-+ b->state = "Unavailable";
-+ break;
-+ default:
-+ b->state = "Unknown";
-+ break;
-+
-+ }
-+
-+ snprintf(sstmp, sizeof(sstmp), "hw.acpi.battery.time");
-+ sysctlbyname(sstmp, &c, &intlen, NULL, 0);
-+ b->seconds = c * 60;
-
-- if (b->current_now == -1) {
-- b->poststr = "rate information unavailable";
-- b->seconds = -1;
-- } else if (!strcasecmp(b->state, "charging")) {
-- if (b->current_now > MIN_PRESENT_RATE) {
-- b->seconds = 3600 * (b->charge_full - b->charge_now) / b->current_now;
-- b->poststr = " until charged";
-- } else {
-- b->poststr = "charging at zero rate - will never fully charge.";
-- b->seconds = -1;
-- }
-- } else if (!strcasecmp(b->state, "discharging")) {
-- if (b->current_now > MIN_PRESENT_RATE) {
-- b->seconds = 3600 * b->charge_now / b->current_now;
-- b->poststr = " remaining";
-- } else {
-- b->poststr = "discharging at zero rate - will never fully discharge.";
-- b->seconds = -1;
-- }
-- } else {
-- b->poststr = NULL;
-- b->seconds = -1;
-- }
- }
--
--
-+
- battery *battery_get() {
-- GError * error = NULL;
-- const gchar *entry;
-- GDir * dir = g_dir_open( ACPI_PATH_SYS_POWER_SUPPY, 0, &error );
-- battery *b = NULL;
-- if ( dir == NULL )
-- {
-- g_warning( "NO ACPI/sysfs support in kernel: %s", error->message );
-- return NULL;
-- }
-- while ( ( entry = g_dir_read_name (dir) ) != NULL )
-- {
-- b = battery_new();
-- b->path = g_strdup( entry );
-- battery_update ( b );
-- if ( b->type_battery == TRUE )
-- break;
-- /* ignore non-batteries */
-- else {
-- g_free(b);
-- b = NULL;
-- }
-- }
-- g_dir_close( dir );
-+ battery *b = battery_new();
-+ battery_update(b);
- return b;
- }
-
-@@ -293,10 +161,3 @@
- strcasecmp( b->state, "Full" ) == 0
- || strcasecmp( b->state, "Charging" ) == 0 );
- }
--
--gint battery_get_remaining( battery *b )
--{
-- return b->seconds;
--}
--
--
diff --git a/x11/lxpanel/files/patch-src__plugins__batt__batt_sys.h b/x11/lxpanel/files/patch-src__plugins__batt__batt_sys.h
deleted file mode 100644
index 91e55dfbd18e..000000000000
--- a/x11/lxpanel/files/patch-src__plugins__batt__batt_sys.h
+++ /dev/null
@@ -1,26 +0,0 @@
---- src/plugins/batt/batt_sys.h.o 2011-09-16 11:12:42.000000000 -0400
-+++ src/plugins/batt/batt_sys.h 2011-09-16 11:39:12.000000000 -0400
-@@ -23,6 +23,12 @@
- #ifndef BATT_SYS_H
- #define BATT_SYS_H
-
-+/* The states a battery can have */
-+#define BATT_FULL 0
-+#define BATT_DISCHARGING 1
-+#define BATT_CHARGING 2
-+#define BATT_CRITICAL 5
-+#define BATT_NONE 7
-
- #define BUF_SIZE 1024
- #define ACPI_PATH_SYS_POWER_SUPPY "/sys/class/power_supply"
-@@ -53,8 +59,8 @@
-
- battery *battery_get();
- void battery_update( battery *b );
--void battery_print(battery *b, int show_capacity);
-+void battery_print(battery *b);
-+void battery_reset(battery *b);
- gboolean battery_is_charging( battery *b );
--gint battery_get_remaining( battery *b );
-
- #endif