Commit 558a409b authored by Jonny Lamb's avatar Jonny Lamb Committed by GitHub
Browse files

Merge pull request #36 from joukewitteveen/patch-1

Drop hardcoded dependency on a wallpaper
parents 5218638e d62eecd2
......@@ -3,6 +3,7 @@
PREFIX=@prefix@
LIBEXECDIR=$PREFIX/libexec
ABS_BUILDDIR=@abs_builddir@
DEFAULT_BACKGROUND=/usr/share/wallpapers/Hanami/contents/images/3872x2592.jpg
md5() {
cat "$1" 2> /dev/null | md5sum
......@@ -21,6 +22,11 @@ check_install() {
mkdir ~/.config > /dev/null 2>&1
if [ -z "${MAYNARD_BACKGROUND+_}" -a \
-e "$DEFAULT_BACKGROUND" ]; then
export MAYNARD_BACKGROUND="$DEFAULT_BACKGROUND"
fi
xdpyinfo > /dev/null 2>&1
if [ "$?" = "0" ]; then
# We are running under X, so let's assume this is a development
......
......@@ -43,8 +43,6 @@
extern char **environ; /* defined by libc */
#define DEFAULT_BACKGROUND "/usr/share/wallpapers/Hanami/contents/images/3872x2592.jpg"
struct element {
GtkWidget *window;
GdkPixbuf *pixbuf;
......@@ -575,14 +573,16 @@ background_create (struct desktop *desktop)
background = malloc (sizeof *background);
memset (background, 0, sizeof *background);
filename = g_getenv ("BACKGROUND");
if (filename == NULL)
filename = DEFAULT_BACKGROUND;
unscaled_background = gdk_pixbuf_new_from_file (filename, NULL);
filename = g_getenv ("MAYNARD_BACKGROUND");
if (filename && *filename)
unscaled_background = gdk_pixbuf_new_from_file (filename, NULL);
else
unscaled_background = gdk_pixbuf_new_from_xpm_data
((const char*[]){"1 1 1 1", "_ c SteelBlue", "_"});
if (!unscaled_background)
{
g_message ("Could not load background. "
"Do you have kdewallpapers installed?");
g_message ("Could not load background (%s).",
filename ? filename : "built-in");
exit (EXIT_FAILURE);
}
......
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