GUI to Change Background Arctica Greeter (Login Screen) on Ubuntu-MATE 22.04

Marvellous! Thanks ! Oh yes, that was exactly what I needed, you're awesome :smiley:

EDIT: improved code

#!/bin/bash

exec &>/dev/null
source "$HOME/.config/user-dirs.dirs"

text1="Login Background Changer"
text2="Select Background for Login"
mybg="/usr/share/backgrounds/mybackground"
schemadir="/usr/share/glib-2.0/schemas"
configfile="$schemadir/30_ubuntu-mate.gschema.override"

tmpfile="$XDG_RUNTIME_DIR/delete_me_$$"
cleanup()
{
	rm $tmpfile
	sudo -k
}
trap "cleanup" INT TERM EXIT

zenity --title="$text1" --password | sudo -S true || exit

if ! grep "background='$mybg'" "$configfile"
then
	sudo sed -i "s|background=.*|background='$mybg'|g" "$configfile"
	sudo glib-compile-schemas "$schemadir/."
fi

eom "$mybg" &

sleep 1
cp "$(zenity --title="$text2" --file-selection --filename="$XDG_PICTURES_DIR/*")" "$tmpfile" || exit
sudo cp "$tmpfile" "$mybg"

eom "$mybg"

P.S.:
b.t.w. are you the same misko that composed my favourite laptopbackground ?
(i've gratefully been using this for years now) :slight_smile:

3 Likes