Index: configure.ac
===================================================================
--- configure.ac	(Revision 73450)
+++ configure.ac	(Arbeitskopie)
@@ -29,6 +29,7 @@
    ecore-input >= 1.2.99 \
    ecore-imf >= 1.2.99 \
    ecore-imf-evas >= 1.2.99 \
+   x11 >= 1.4.3 \
    "
 
 PKG_CHECK_MODULES([TERMINOLOGY], [${requirements}])
Index: AUTHORS
===================================================================
--- AUTHORS	(Revision 73450)
+++ AUTHORS	(Arbeitskopie)
@@ -1 +1,2 @@
 Carsten Haitzler (Rasterman) <raster@rasterman.com>
+Leif Middelschulte (T_UNIX) <leif.middelschulte@gmail.com>
Index: src/bin/main.c
===================================================================
--- src/bin/main.c	(Revision 73450)
+++ src/bin/main.c	(Arbeitskopie)
@@ -449,6 +449,9 @@
         retval = EXIT_FAILURE;
         goto end;
      }
+   // Use background color defined by Xresources
+   if (config->res_background)
+     background_apply_xresources(o, config);
    theme_auto_reload_enable(o);
    elm_object_content_set(conform, o);
    evas_object_show(o);
Index: src/bin/options_wallpaper.c
===================================================================
--- src/bin/options_wallpaper.c	(Revision 73450)
+++ src/bin/options_wallpaper.c	(Arbeitskopie)
@@ -7,14 +7,16 @@
 #include "options_wallpaper.h"
 
 void
-options_wallpaper(Evas_Object *opbox, Evas_Object *term __UNUSED__)
+options_wallpaper(Evas_Object *opbox, Evas_Object *term)
 {
    Evas_Object *o;
+   Config *config = termio_config_get(term);
 
-   o = elm_label_add(opbox);
+   o = elm_check_add(opbox);
    evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   elm_object_text_set(o, "Not Implemented Yet.");
+   elm_object_text_set(o, "Use plain background as defined in XResource file");
+   elm_check_state_pointer_set(o, &config->res_background);
    evas_object_show(o);
    elm_box_pack_end(opbox, o);
 }
Index: src/bin/config.c
===================================================================
--- src/bin/config.c	(Revision 73450)
+++ src/bin/config.c	(Arbeitskopie)
@@ -3,7 +3,7 @@
 #include <Elementary.h>
 #include "config.h"
 
-#define CONF_VER 1
+#define CONF_VER 2
 
 #define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;}
 
@@ -73,6 +73,8 @@
    EET_DATA_DESCRIPTOR_ADD_BASIC
      (edd_base, Config, "background", background, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC
+     (edd_base, Config, "res_background", res_background, EET_T_UCHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC
      (edd_base, Config, "wordsep", wordsep, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC
      (edd_base, Config, "scrollback", scrollback, EET_T_INT);
@@ -237,6 +239,7 @@
              config->scrollback = 2000;
              config->theme = eina_stringshare_add("default.edj");
              config->background = NULL;
+             config->res_background = EINA_FALSE;
              config->translucent = EINA_FALSE;
              config->jump_on_change = EINA_TRUE;
 	     config->jump_on_keypress = EINA_TRUE;
Index: src/bin/config.h
===================================================================
--- src/bin/config.h	(Revision 73450)
+++ src/bin/config.h	(Arbeitskopie)
@@ -24,6 +24,7 @@
    } helper;
    const char       *theme;
    const char       *background;
+   Eina_Bool         res_background;
    const char       *wordsep;
    int               scrollback;
    int               vidmod;
Index: src/bin/utils.c
===================================================================
--- src/bin/utils.c	(Revision 73450)
+++ src/bin/utils.c	(Arbeitskopie)
@@ -2,6 +2,8 @@
 #include "utils.h"
 
 #include <Edje.h>
+#include <X11/Xresource.h>
+#include <X11/Xlib.h>
 
 Eina_Bool
 theme_apply(Evas_Object *edje, const Config *config, const char *group)
@@ -50,3 +52,34 @@
    edje_object_signal_callback_add
      (edje, "edje,change,file", "edje", theme_reload_cb, NULL);
 }
+
+void
+background_apply_xresources(Evas_Object *edje, const Config *config)
+{
+   XrmDatabase db;
+   XrmValue value;
+   int i, j;
+   Display *dpy = NULL;
+   char rtype[64], buf[3];
+   unsigned long rgb[3];
+   Evas_Object *bg_rect = NULL;
+
+   // Fetch X Resource from the server
+   dpy = XOpenDisplay(NULL);
+   if (!dpy || !(db = XrmGetStringDatabase(XResourceManagerString(dpy))))
+     return;
+   if (XrmGetResource(db, "background", "Background", &rtype, &value))
+     {
+        for (i = 1, j = 0; i < (value.size - 1); i+=2, j++)
+          {
+             snprintf(buf, 3, "%s", &value.addr[i]);
+             rgb[j] = strtoul(buf, NULL, 16);
+          }
+     }
+   XCloseDisplay(dpy);
+
+   // Tell the theme that we'd like to use Xresource bg
+   edje_object_signal_emit(edje, "xres,on", "terminology");
+   bg_rect = edje_object_part_object_get(edje, "base");
+   edje_object_color_class_set(edje, "background", rgb[0], rgb[1], rgb[2], 255, 0, 0, 0, 0, 0, 0, 0, 0);
+}
Index: src/bin/utils.h
===================================================================
--- src/bin/utils.h	(Revision 73450)
+++ src/bin/utils.h	(Arbeitskopie)
@@ -10,4 +10,5 @@
 
 void theme_auto_reload_enable(Evas_Object *edje);
 
+void background_apply_xresources(Evas_Object *edje, const Config *config);
 #endif
Index: data/themes/default.edc
===================================================================
--- data/themes/default.edc	(Revision 73450)
+++ data/themes/default.edc	(Arbeitskopie)
@@ -1,3 +1,12 @@
+color_classes {
+   color_class {
+      name: "background";
+      color: 48 48 48 255;
+      color2: 48 48 48 0;
+      color3: 48 48 48 0;
+   }
+}
+
 collections {
    
 //////////////////////////////////////////////////////////////////////////////
@@ -44,7 +53,7 @@
          part { name: "base"; type: RECT;
             mouse_events: 1;
             description { state: "default" 0.0;
-               color: 48 48 48 255;
+               color_class: "background";
             }
             description { state: "translucent" 0.0;
                inherit: "default" 0.0;
Index: data/themes/mild.edc
===================================================================
--- data/themes/mild.edc	(Revision 73450)
+++ data/themes/mild.edc	(Arbeitskopie)
@@ -1,3 +1,12 @@
+color_classes {
+   color_class {
+      name: "background";
+      color: 48 48 48 255;
+      color2: 48 48 48 0;
+      color3: 48 48 48 0;
+   }
+}
+
 collections {
    group { name: "terminology/background";
       parts {
@@ -4,7 +13,7 @@
          part { name: "base"; type: RECT;
             mouse_events: 1;
             description { state: "default" 0.0;
-               color: 48 48 48 255;
+               color_class: "background";
             }
             description { state: "translucent" 0.0;
                inherit: "default" 0.0;
