]> Dogcows Code - chaz/tint2/blobdiff - src/battery/battery.c
*add* changed everything to kernel timer for easier integration with new timer
[chaz/tint2] / src / battery / battery.c
index 5b98f1303917adc30a63e2dead224febf911f807..f0498b728e689e8aaa7b74295aacc6887a9598e9 100644 (file)
@@ -31,6 +31,7 @@
 #include "taskbar.h"
 #include "battery.h"
 #include "clock.h"
+#include "timer.h"
 
 PangoFontDescription *bat1_font_desc=0;
 PangoFontDescription *bat2_font_desc=0;
@@ -47,6 +48,14 @@ char *path_energy_full=0;
 char *path_current_now=0;
 char *path_status=0;
 
+void update_batterys()
+{
+       int i;
+       update_battery();
+       for (i=0 ; i < nb_panel ; i++)
+               panel1[i].battery.area.resize = 1;
+}
+
 
 void init_battery()
 {
@@ -120,6 +129,9 @@ void init_battery()
 
        g_free(path1);
        g_free(battery_dir);
+
+       if (battery_enabled)
+               install_timer(0, 1000000, 3, 0, update_batterys);
 }
 
 
This page took 0.019924 seconds and 4 git commands to generate.