[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 01/01: values and formatting thereof for the new ACPI power value

noreply at xfce.org noreply at xfce.org
Tue Oct 23 21:41:18 CEST 2018


This is an automated email from the git hooks/post-receive script.

t   i   m   y   s   t   e   r   y       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-sensors-plugin.

commit eb0063154733eb1ac29ff7febcadc4f9c82852c5
Author: Fabian <timystery at arcor.de>
Date:   Tue Oct 23 21:40:53 2018 +0200

    values and formatting thereof for the new ACPI power value
---
 lib/acpi.c                     | 7 ++++---
 lib/sensors-interface-common.c | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/acpi.c b/lib/acpi.c
index ebc4067..b2d1bdc 100644
--- a/lib/acpi.c
+++ b/lib/acpi.c
@@ -583,7 +583,7 @@ get_power_zone_value (gchar *str_zone)
         if (fgets (buffer, 1024, ptr_file)!=NULL)
         {
             cut_newline (buffer);
-            res_value = strtod (buffer, NULL) / 1000.0;
+            res_value = strtod (buffer, NULL) / 1000000.0;
         }
         fclose (ptr_file);
     }
@@ -625,15 +625,16 @@ read_power_zone (t_chip *ptr_chip)
                     ptr_chipfeature = g_new0 (t_chipfeature, 1);
                     g_return_val_if_fail(ptr_chipfeature != NULL, -1);
 
-                    ptr_chipfeature->color = g_strdup("#0000B0");
+                    ptr_chipfeature->color = g_strdup("#00B0B0");
                     ptr_chipfeature->address = ptr_chip->chip_features->len;
                     ptr_chipfeature->devicename = g_strdup(ptr_dirent->d_name);
+                    // You might want to format this with a hyphen and without spacing, or with a dash; the result might be BAT1–Power or whatever fits your language most. Spaces allow line breaks over the tachometers.
                     ptr_chipfeature->name = g_strdup_printf (_("%s - %s"), ptr_dirent->d_name, _("Power"));
                     ptr_chipfeature->formatted_value = NULL;
                     ptr_chipfeature->raw_value = get_power_zone_value(ptr_dirent->d_name);
                     ptr_chipfeature->valid = TRUE;
                     ptr_chipfeature->min_value = 0.0;
-                    ptr_chipfeature->max_value = 2.0;
+                    ptr_chipfeature->max_value = 60.0; // a T440s charges with roughly 25 Watts
                     ptr_chipfeature->class = POWER;
 
                     g_ptr_array_add (ptr_chip->chip_features, ptr_chipfeature);
diff --git a/lib/sensors-interface-common.c b/lib/sensors-interface-common.c
index a72c67a..70aa154 100644
--- a/lib/sensors-interface-common.c
+++ b/lib/sensors-interface-common.c
@@ -167,7 +167,7 @@ format_sensor_value (t_tempscale temperaturescale, t_chipfeature *ptr_chipfeatur
                break;
 
         case POWER:
-               *dptr_str_formattedvalue = g_strdup_printf(_("%.0f mW"), val_sensorfeature);
+               *dptr_str_formattedvalue = g_strdup_printf(_("%.3f W"), val_sensorfeature);
                break;
 
         case STATE:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list