Commit 0e169908 authored by Marco Barisione's avatar Marco Barisione
Browse files

maynard: use the background in $BACKGROUND if set

parent ca7ecf93
......@@ -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.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment