A GUI to change the login-screen background.
( bash script, using zenity )
#!/bin/bash
mybg="/usr/share/backgrounds/mybackground"
schemadir="/usr/share/glib-2.0/schemas"
configfile="$schemadir/30_ubuntu-mate.gschema.override"
tmpfile="$XDG_RUNTIME_DIR/wallpaper$$"
trap "rm $tmpfile &>/dev/null" INT TERM EXIT
if ! grep "background='$mybg'" "$configfile" &>/dev/null
then
pkexec sed -i "s|background=.*|background='$mybg'|g" "$configfile"
pkexec glib-compile-schemas "$schemadir/."
fi
eom "$mybg" &
sleep 1
cp "$(zenity --title LoginBackgroundSelector --file-selection )" "$tmpfile" || exit
pkexec cp "$tmpfile" "$mybg"
eom "$mybg"
It works perfectly but I am not completely satisfied with my use of 'pkexec' here. Any suggestions are welcome.