From 0e1699086f65bd942ae051f62d3fd45deea15fd2 Mon Sep 17 00:00:00 2001 From: Marco Barisione Date: Mon, 31 Mar 2014 10:56:13 +0100 Subject: maynard: use the background in $BACKGROUND if set --- shell/maynard.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'shell') 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."); -- cgit v1.3.1