next step for conky
authorvlad <vlad@vlanout.(none)>
Sat, 28 Aug 2010 18:37:45 +0000 (21:37 +0300)
committervlad <vlad@vlanout.(none)>
Sat, 28 Aug 2010 18:37:45 +0000 (21:37 +0300)
applet/data/external_themes/battery-eye.xml [deleted file]
applet/data/external_themes/conky.xml
applet/po/it_IT.po
applet/src/livewp-config.c
applet/src/livewp-conky.c
applet/src/livewp-settings.c

diff --git a/applet/data/external_themes/battery-eye.xml b/applet/data/external_themes/battery-eye.xml
deleted file mode 100644 (file)
index 051b10d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<theme>
-<name>Battery Eye</name>
- <exec_path>python /opt/battery-eye/beye.py</exec_path>
- <window_name>beye.py</window_name>
- <category>Unknown</category>
- <icon_on>/usr/share/livewp/external_icons/xscreensaver.png</icon_on>
- <icon_off>/usr/share/livewp/external_icons/xscreensaverd.png</icon_off>
-</theme>
index e82768c..f3606ea 100644 (file)
@@ -1,6 +1,6 @@
 <theme>
     <name>Conky</name>
-    <exec_path>/usr/bin/conky</exec_path>
+    <exec_path>/usr/bin/conky -c /tmp/conky.conf</exec_path>
     <category>Unknown</category>
     <icon_on>/usr/share/livewp/theme/Xsnow/icon.png</icon_on>       
     <icon_off>/usr/share/livewp/theme/Xsnow/icond.png</icon_off>       
index cd71695..7d4870b 100644 (file)
@@ -40,7 +40,7 @@ msgstr "Attivo"
 #: src/livewp-config.c:34 src/livewp-config.c:91 src/livewp-config.c:156
 #, c-format
 msgid "Failed to initialize GConf. Quitting.\n"
-msgstr "Avvio di GConf non riuscito. Chiusura in corso."
+msgstr "Avvio di GConf non riuscito. Chiusura in corso.\n"
 
 #: src/livewp-settings.c:442
 msgid "Live Wallpaper Settings"
index 2eb151b..e3aa165 100644 (file)
@@ -62,12 +62,11 @@ fill_priv(Animation_WallpaperPrivate *priv)
     GSList *store = priv->extheme_list;
     while (store){
         if (!strcmp(priv->theme, g_hash_table_lookup(store->data, "name"))){
-            if (!strcmp(priv->theme, "Conky"))
-                priv->scene_func = (gpointer)&init_scene_Conky;
-
             /* Default function for external themes init_scene_External */
             if (priv->scene_func)
                 priv->scene_func = (gpointer)&init_scene_External;
+            if (!strcmp(priv->theme, "Conky"))
+                priv->scene_func = (gpointer)&init_scene_Conky;
             priv->hash_theme = store->data;
             break;
         }
index 48e5ae0..455895b 100644 (file)
 */
 /*******************************************************************************/
 #include "livewp-conky.h"
+void create_config(gboolean sleep){
+    FILE    *file_in;
+    FILE    *file_out;
+    gchar buffer[2048];
+
+    file_in = fopen("/etc/conky/conky.conf","r");
+    file_out = fopen("/tmp/conky.conf","w");
+    if (file_in && file_out){
+        while (!feof(file_in)) {
+            memset(buffer, 0, sizeof(buffer));
+            fgets(buffer, sizeof(buffer) - 1, file_in);
+            if (!strcmp(buffer, "own_window yes\n")){
+                fputs("own_window no\n", file_out);
+               continue;
+           }
+           if (!strcmp(buffer, "$alignc $nodename - $sysname $kernel on $machine ${color yellow}Uptime:$color $uptime\n")){
+                fputs("$alignr $nodename - $sysname $kernel on $machine\n", file_out);
+                fputs("$alignr ${color yellow}Uptime:$color $uptime\n", file_out);
+               continue;
+           }
+           if (!strcmp(buffer, "gap_y 60\n")){
+                fputs("gap_y 0\n", file_out);
+               continue;
+           }
+           if (!strcmp(buffer, "gap_x 0\n")){
+                fputs("gap_x 5\n", file_out);
+               continue;
+           }
+           if (!strcmp(buffer, "update_interval 3.0\n") && sleep){
+                fputs("update_interval 20.0\n", file_out);
+               continue;
+           }
+           if (!strcmp(buffer, "${color #24ff00} ${top name 4}    ${top pid 4} ${top cpu 4} ${top mem 4}\n") && sleep){
+               fputs(buffer, file_out);
+                fputs("${color #20ff00} ${top name 5}    ${top pid 5} ${top cpu 5} ${top mem 5}\n", file_out);
+               continue;
+           }
+    
+            fputs(buffer, file_out);
+        }
+        fclose(file_out);
+        fclose(file_in);
+    }
+
+}
 void 
 init_scene_Conky(AWallpaperPlugin *desktop_plugin){
+    create_config(False);
     init_scene_External(desktop_plugin);
 }
 
index cfd2fcb..624da8b 100644 (file)
@@ -679,14 +679,6 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
                         break;
                     }
                 }
-                /* Check Battery Eye program */
-                if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "Battery Eye")){
-                    if (access("/opt/battery-eye/beye", F_OK) != 0){
-                        show_problem_package(button,"'Battery Eye'");
-                        /* if not scuccess exit from wthout saving */ 
-                        break;
-                    }
-                }
                 /* Check Orrery program */
                 if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), "Orrery")){
                     if (access("/opt/maemo/usr/bin/orrery", F_OK) != 0){