Blog Posts:

Changing Login Background of Gnome

Most of the Debian Gnome distributions have a blank or solid colored login panel background. Now there's no option in the Tweak Tool or Settings to change, so you need to do it manually by modifying the gnome-shell.css & other files.


Code:
WORKDIR=~/tmp/gdm-login-background
GST=/usr/share/gnome-shell/gnome-shell-theme.gresource
GSTRES=$(basename $GST)

mkdir -p $WORKDIR
cd $WORKDIR
mkdir theme

for r in `gresource list $GST`; do
  gresource extract $GST $r >$WORKDIR$(echo $r | sed -e 's/^\/org\/gnome\/shell\//\//g')
done

cd theme
cp "$IMAGE" ./

echo "
#lockDialogGroup {
  background: #2e3436 url(resource:///org/gnome/shell/theme/$(basename $IMAGE));
  background-size: cover;
  background-repeat: no-repeat;
}" >>gnome-shell.css

echo '<?xml version="1.0" encoding="UTF-8"?>
<gresources>
  <gresource prefix="/org/gnome/shell/theme">' >"${GSTRES}.xml"
for r in `ls *.*`; do
  echo "    <file>$r</file>" >>"${GSTRES}.xml"
done
echo '  </gresource>
</gresources>' >>"${GSTRES}.xml"

glib-compile-resources "${GSTRES}.xml"

sudo mv "/usr/share/gnome-shell/$GSTRES" "/usr/share/gnome-shell/${GSTRES}.backup"
sudo mv "$GSTRES" /usr/share/gnome-shell/

rm -r $WORKDIR

if [ "$CREATED_TMP" = "1" ]; then
  rm -r ~/tmp
fi
Save it as "login-background.sh" && Put this code on /home/ or /root/ .

Choose any jpeg image background you want and move it to the same directory.

Open up terminal & type:

IMAGE=~/Image.jpg sh login-background.sh

Now type this command:

service gdm restart
Or restart your system. You'll see the Login Background has been changed.


Credits:

https://unix.stackexchange.com/questions/310923/how-to-customize-gnome-login-screen-in-debian
https://bbs.archlinux.org/viewtopic.php?id=197036

No comments:

Post a Comment