Change Login Background (or Sync User Wallpaper) in Ubuntu MATE 22.04

Boring with the default login screen background? Here’s how to set a new one, or make it use the desktop wallpaper in Ubuntu MATE 22.04.

Ubuntu MATE 22.04 by default uses lightdm display manager to handle its login screen. However, it does not provides any configuration options to customize the things. So, I’m here to write this tutorial to help!

Change login screen background

The default theme of LightDM in Ubuntu MATE 22.04 is Arctica Greeter. It has some configuration options through dconf database. And, user can access them by doing following steps one by one.

  1. Firstly, press Ctrl+Alt+T on keyboard to open a terminal window.
  2. When terminal opens, run command to install dconf-editor, a graphical tool to edit dconf database.
    sudo apt install dconf-editor

    On brand new system, sudo apt update is required to run first to fresh package cache

  3. Normal user account does not have the permission to access the dconf options for Arctica Greeter. User has to first run command in terminal to add lightdm user to the control list:
    xhost SI:localuser:lightdm
  4. Finally, launch dconf editor via user lightdm by running command:
    sudo -u lightdm dconf-editor
  5. When the tool opens, navigate to org/ArcticaProject/arctica-greeter, and do:
    • click background.
    • turn off ‘Use default value’.
    • input file path of a new photo image as ‘Custom value’.

Switch to slick greeter

As you see, the default theme is inconvenient every time you want to change something. Importantly, sync login screen with user background wallpaper does not work due to bug.

For choice, you can switch to slick greeter, another theme with quite similar layout, easy to use settings options, and possibility to draw user background (with a custom script).

  1. Firstly, press Ctrl+Alt+T key combination on keyboard to open a terminal window.
  2. When terminal opens, run command to install the slick greeter package:
    sudo apt install slick-greeter

  3. Then, edit the ‘/etc/lightdm/lightdm.conf‘ config file by running command:
    sudo pluma /etc/lightdm/lightdm.conf

    When file opens, add new line greeter-session=slick-greeter (or change the value if that line exists) and save it.

  4. When done, you can now search for and open Control Center, click on Login Window and type user password to open the configuration dialog.

As you can see, it’s now easy to change the login screen background. And, set ‘Yaru-MATE-dark‘ GTK and icon themes if you would like to restore the original appearance.

Remember: you need to restart computer for the first time using a new LightDM theme.

Custom script to draw user backgrounds

As mentioned, the “Draw user backgrounds” function does not work out-of-the-box due to bug. Thankfully, someone has made a script to workaround the issue, which works in my case in Ubuntu MATE 22.04.

  1. Firstly, press Ctrl+Alt+T on keyboard to open a terminal. When it opens, run command to create and edit the script:
    sudo pluma /usr/local/bin/msd-background-helper

    When file opens, paste the lines below and save it:

    #!/bin/bash
    #
    # Sets the following:
    # [org.freedesktop.DisplayManager.AccountsService]
    # BackgroundFile
    # [User]
    # Background
    # in /var/lib/AccountsService/users/$USER
    
    function setuserbackground(){
    	export USERBACKGROUND=`gsettings get org.mate.background picture-filename | tail -c +2 | head -c -2`
    
    	dbus-send --system --print-reply \
    	--dest=org.freedesktop.Accounts \
    	--type=method_call \
    	/org/freedesktop/Accounts/User`id -u` \
    	org.freedesktop.Accounts.User.SetBackgroundFile string:"$USERBACKGROUND"
    
    	dbus-send --system --print-reply \
    	--dest=org.freedesktop.Accounts \
    	/org/freedesktop/Accounts/User`id -u` \
    	org.freedesktop.DBus.Properties.Set \
    		string:org.freedesktop.DisplayManager.AccountsService \
    		string:BackgroundFile \
    		variant:string:"$USERBACKGROUND"
    }
    
    setuserbackground
    
    dbus-monitor --profile "type='signal',interface='ca.desrt.dconf.Writer',path='/ca/desrt/dconf/Writer/user',arg0path='/org/mate/desktop/background/'" |
    while read -r line; do
    	setuserbackground
    done

  2. After saving the file, add executable permission by running command:
    sudo chmod +x /usr/local/bin/msd-background-helper
  3. Finally, create a .desktop file under autostart folder via command:
    sudo pluma /etc/xdg/autostart/msd-background-helper.desktop

    And paste the following lines when file opens:

    [Desktop Entry]
    Type=Application
    Name=MATE Settings Daemon Background Helper
    Comment=Sets the user background in AccountsService on MATE
    Exec=/usr/local/bin/msd-background-helper
    OnlyShowIn=MATE;
    X-MATE-Autostart-enabled=true

After all, restart your computer and enjoy!

Add lightdm to user group

Photo image files in your user folders may NOT work for the login screen due to permission issue. For choice, you can either copy the files into /usr/share/backgrounds or grant permission by adding lightdm to your user group.

To do so, press Ctrl+Alt+T on keyboard to open terminal, and run command:

sudo gpasswd --add lightdm $USER

That’s all. Enjoy!

Exit mobile version