summaryrefslogtreecommitdiff
path: root/shell/maynard.c
diff options
context:
space:
mode:
authorMarco Barisione <marco.barisione@collabora.co.uk>2014-03-31 10:56:13 +0100
committerMarco Barisione <marco.barisione@collabora.co.uk>2014-03-31 12:39:08 +0100
commit0e1699086f65bd942ae051f62d3fd45deea15fd2 (patch)
tree575fa1526eb1c447541ea5d9cd15636c05368c61 /shell/maynard.c
parentca7ecf93c893fee81eb1664735e041bb7dc50415 (diff)
downloadgraynard-0e1699086f65bd942ae051f62d3fd45deea15fd2.tar.gz
graynard-0e1699086f65bd942ae051f62d3fd45deea15fd2.zip
maynard: use the background in $BACKGROUND if set
Diffstat (limited to 'shell/maynard.c')
-rw-r--r--shell/maynard.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/shell/maynard.c b/shell/maynard.c
index cb13f27..c3e45d1 100644
--- a/shell/maynard.c
+++ b/shell/maynard.c
@@ -41,7 +41,7 @@
extern char **environ; /* defined by libc */
-gchar *filename = "/usr/share/themes/Adwaita/backgrounds/morning.jpg";
+#define DEFAULT_BACKGROUND "/usr/share/themes/Adwaita/backgrounds/morning.jpg""
struct element {
GtkWidget *window;
@@ -412,11 +412,14 @@ background_create(struct desktop *desktop)
{
GdkWindow *gdk_window;
struct element *background;
+ const gchar *filename;
background = malloc(sizeof *background);
memset(background, 0, sizeof *background);
- /* TODO: get the "right" directory */
+ filename = g_getenv("BACKGROUND");
+ if (filename == NULL)
+ filename = DEFAULT_BACKGROUND;
background->pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
if (!background->pixbuf) {
g_message ("Could not load background.");