began theme Conky
authorVlad <vlad@gas.by>
Thu, 26 Aug 2010 09:11:57 +0000 (12:11 +0300)
committerVlad <vlad@gas.by>
Thu, 26 Aug 2010 09:11:57 +0000 (12:11 +0300)
applet/data/external_themes/conky.xml
applet/src/Makefile.am
applet/src/livewp-config.c
applet/src/livewp-config.h
applet/src/livewp-conky.c [new file with mode: 0644]
applet/src/livewp-conky.h [new file with mode: 0644]
applet/src/livewp-scene.c

index 232fcd5..e82768c 100644 (file)
@@ -1,6 +1,6 @@
 <theme>
     <name>Conky</name>
-    <exec_path>/usr/bin/conky -d</exec_path>
+    <exec_path>/usr/bin/conky</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 13344eb..81ff2f4 100644 (file)
@@ -7,7 +7,9 @@ SOURCE_FILES = livewp-main.c \
               livewp-dbus.c livewp-dbus.h \
               livewp-actor.c livewp-actor.h \
               livewp-exthemes.c livewp-exthemes.h \
-              livewp-scene.c livewp-scene.h
+              livewp-scene.c livewp-scene.h \
+              livewp-conky.c livewp-conky.h
+
 
 
 bin_PROGRAMS = livewp
index e8ccf93..2eb151b 100644 (file)
@@ -62,7 +62,12 @@ fill_priv(Animation_WallpaperPrivate *priv)
     GSList *store = priv->extheme_list;
     while (store){
         if (!strcmp(priv->theme, g_hash_table_lookup(store->data, "name"))){
-            priv->scene_func = (gpointer)&init_scene_External;
+            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;
             priv->hash_theme = store->data;
             break;
         }
index ff9b892..4fd4d20 100644 (file)
@@ -39,6 +39,7 @@ void init_scene_Accel(AWallpaperPlugin *desktop_plugin);
 void init_scene_Video(AWallpaperPlugin *desktop_plugin);
 void init_scene_External(AWallpaperPlugin *desktop_plugin);
 void init_scene_theme(AWallpaperPlugin *desktop_plugin);
+void init_scene_Conky(AWallpaperPlugin *desktop_plugin);
 gint read_config(Animation_WallpaperPrivate *priv); 
 void save_config(Animation_WallpaperPrivate *priv); 
 void fill_priv(Animation_WallpaperPrivate *priv);
diff --git a/applet/src/livewp-conky.c b/applet/src/livewp-conky.c
new file mode 100644 (file)
index 0000000..48e5ae0
--- /dev/null
@@ -0,0 +1,30 @@
+/*vim: set sw=4 ts=4 et: */
+/*
+ * This file is part of Live Wallpaper (livewp)
+ * 
+ * Copyright (C) 2010 Vlad Vasiliev
+ * Copyright (C) 2010 Tanya Makova
+ *       for the code
+ * 
+ * This software is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+*/
+/*******************************************************************************/
+#include "livewp-conky.h"
+void 
+init_scene_Conky(AWallpaperPlugin *desktop_plugin){
+    init_scene_External(desktop_plugin);
+}
+
diff --git a/applet/src/livewp-conky.h b/applet/src/livewp-conky.h
new file mode 100644 (file)
index 0000000..3161521
--- /dev/null
@@ -0,0 +1,27 @@
+/*vim: set sw=4 ts=4 et: */
+/*
+ * This file is part of Live Wallpaper (livewp)
+ * 
+ * Copyright (C) 2010 Vlad Vasiliev
+ * Copyright (C) 2010 Tanya Makova
+ *       for the code
+ * 
+ * This software is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+*/
+/*******************************************************************************/
+#include "livewp-common.h"
+void init_scene_Conky(AWallpaperPlugin *desktop_plugin);
+void init_scene_External(AWallpaperPlugin *desktop_plugin);
index aaddd85..4e35d86 100644 (file)
@@ -225,6 +225,7 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){
         *view = NULL,
         *strwin = NULL,
         *strview =NULL;
+    gint i;
     Window  id_xwindow;
     if (!desktop_plugin->priv->visible)
         return;
@@ -257,12 +258,18 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){
     }
     g_free(run_string);
     if (window_name){
-        sleep(2);
-        id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), 
-            RootWindow( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), XDefaultScreen( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window))),
-            window_name);
-        set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),  id_xwindow, desktop_plugin->priv->view);
         gtk_widget_destroy(desktop_plugin->priv->window);
+        /* Try 10 searching of window */
+        for (i=0; i<10; i++){
+            sleep(1);
+            id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), 
+                RootWindow( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), XDefaultScreen( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window))),
+                window_name);
+            if (id_xwindow >1){
+                set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),  id_xwindow, desktop_plugin->priv->view);
+                break;
+            }
+        }
     }
 }
 /*******************************************************************************/