Commit d62eecd2 authored by Jouke Witteveen's avatar Jouke Witteveen

Set a default background image

Rename the BACKGROUND environment variable to MAYNARD_BACKGROUND and
set it to a default image if the variable is not set and the default
image exists.
parent 5be23a8b
......@@ -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
......
......@@ -573,8 +573,8 @@ background_create (struct desktop *desktop)
background = malloc (sizeof *background);
memset (background, 0, sizeof *background);
filename = g_getenv ("BACKGROUND");
if (filename)
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
......
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