#!/bin/bash# Script to set a solid black background on the GDM login screen (Ubuntu's GDM).## Note: the com/ubuntu/login-screen setting only exists in Ubuntu's patched GDM.# On Fedora, Mint (LightDM/Slick Greeter) or KDE (SDDM) it has no effect, so the# script checks for it first instead of silently doing nothing.if["$EUID"-ne0];thenecho"Please run as root (use sudo)"exit1fiif!command-vdconf>/dev/null2>&1;thenecho"dconf is not installed; this script only works with GDM (GNOME's login screen)."exit1fiif!gsettingslist-schemas2>/dev/null|grep-qx'com.ubuntu.login-screen';thenecho"This login screen doesn't support com.ubuntu.login-screen (Ubuntu's GDM only)."echo"Nothing was changed."exit1fiecho"Step 1: Creating GDM dconf profile..."mkdir-p/etc/dconf/profile
cat<<EOF >/etc/dconf/profile/gdmuser-db:usersystem-db:gdmfile-db:/usr/share/gdm/greeter-dconf-defaultsEOFecho"Step 2: Creating black background configuration..."mkdir-p/etc/dconf/db/gdm.d
cat<<EOF >/etc/dconf/db/gdm.d/10-black-bg[com/ubuntu/login-screen]background-color='#000000'EOFecho"Step 3: Updating dconf database..."dconfupdate
echo"------------------------------------------------"echo"Done! Please log out or restart to see changes."echo"------------------------------------------------"