41

Recently I installed Ubuntu 17.10 which comes with Gnome as the default DE and I like it a lot but cannot figure out how to change the purple background of the lock screen (when typing in the password).

lockscreen image

I've tried reconfiguring GDM but it seems to be different and it only affects the login screen.

If there is no solution I'm interested in ANY workaround because this purple drives me crazy but I don't want to drop GNOME entirely just because of this. Any help is highly appreciated.

George Udosen
  • 36,677

3 Answers3

31

From these steps here, you can change both the image and the background colour:

  1. Move your favorite image to /usr/share/backgrounds:

    • It's better to move the image you want to set as login background to system pictures folder: /usr/share/backgrounds. To do so, open terminal via Ctrl+Alt+T, then either run command:

      sudo cp /PATH/TO/IMAGE /usr/share/backgrounds/
      
  2. Edit the css file that define GDM login background:

    • Open terminal (Ctrl+Alt+T) and run command to edit file /etc/alternatives/gdm3.css, which is linked to /usr/share/gnome-shell/theme/gdm3.css:

      # Make backup first before editing
      sudo cp /etc/alternatives/gdm3.css /etc/alternatives/gdm3.css.bakup
      sudo nano /etc/alternatives/gdm3.css
      

      enter image description here

  3. When the file opens, go to menu (right after ‘Save’ button) -> find and find out following section:

    #lockDialogGroup {
      background: #2c001e url(resource:///org/gnome/shell/theme/noise-texture.png);
      background-repeat: repeat; }
    

    change the lines into:

    #lockDialogGroup {
       background: #000000 url(file:///usr/share/backgrounds/Aardvark_Wallpaper_Grey_4096x2304.png);
       background-repeat: no-repeat;
       background-size: cover;
       background-position: center; }
    

    Replace Aardvark_Wallpaper_Grey_4096x2304.png with your picture file name, and or change the hex colour code ##2c001e to the color of your choice.Here I used black.

    enter image description here

Lockscreen background:

enter image description here

Note: Backup all files before changing them

George Udosen
  • 36,677
  • 3
    Thanks, but this is only changing the login screen and not the lock screen. If there is a way to show that every time I suspend my laptop that's good enough but the preferred way would be to change the lock screen. I know there's a config file for that but I'm unable to find it. – Balázs Sáros Nov 29 '17 at 22:25
  • See my updated answer to change the lock screen image! – George Udosen Nov 29 '17 at 22:33
  • Sadly that's still not that. You can change the "overlaying" image but nut the purple color when you type in the password (as seen in the included picture). – Balázs Sáros Nov 29 '17 at 22:36
  • Ok I see let me look around! – George Udosen Nov 29 '17 at 22:38
  • To change the color change that hex code before the image and restart your system – George Udosen Nov 29 '17 at 22:56
  • 1
    Already tried that but the purple lock screen (note: the lock screen, not the login screen) remains unchanged. – Balázs Sáros Nov 29 '17 at 23:06
  • Did you restart your system? Works on my end... – George Udosen Nov 29 '17 at 23:06
  • 1
    Yes, and the login screen has changes accordingly but not the lock screen. – Balázs Sáros Nov 29 '17 at 23:08
  • On my end both have changed see the image I added! – George Udosen Nov 29 '17 at 23:08
  • 1
    OMG, I restarted it again and now it's working properly! Thanks! – Balázs Sáros Nov 29 '17 at 23:16
  • Small point perhaps but instead of PATH/TO/YOUR/IMAGE I would use /PATH/TO/IMAGE or something similar with a / prefix. – WinEunuuchs2Unix Nov 30 '17 at 02:12
  • @WinEunuuchs2Unix updated it, very good suggestion! – George Udosen Nov 30 '17 at 05:10
  • In my dual-monitor setup, the above CSS mod put the wallpaper half on the left monitor and half on the right monitor. This will probably not work unless I get a dual-monitor wallpaper. – Will I Am Dec 06 '17 at 02:10
  • The Lock Screen is ok! However the Splash Screen keep purple on boot. Do you know how change that purple background color? I think not to be in GDM. – Fernando Santucci Aug 19 '18 at 15:12
  • Maybe tweaking the Grub2 bootloader USplash theme?! – Fernando Santucci Aug 19 '18 at 15:33
  • I'm experiencing "the purple lock screen (note: the lock screen, not the login screen) remains unchanged. "

    I'm using real GNOME, so my lockDialogGroup is using a dark grey color, not the hideous Ubuntu purple. This is used for the login login screen, and it is indeed grey, GNOME default. However, lock login screen is still ugly purple. I find no Ubuntu purple (2c001e) anywhere in my gdm3.css file. It must be controlled from somewhere else, or Ubuntu purple has changed.

    – Tom Mercer Aug 27 '18 at 02:51
  • 2
    At the top of the file it says "This stylesheet is generated, DO NOT EDIT", why you encourage to still edit this file? – luukvhoudt Oct 26 '18 at 10:04
  • 1
    For Ubuntu 18.04! I did changes and was not able to start gnome session. It gives me error: "GLib: g_hash_table_find: assertion 'version == hash_table->version' failed" (found by running command journalctl -r). I didn't make a copy, my fault. I stopped gnome session sudo service gdm stop and checked alternatives for gdm3.css (sudo update-alternatives --config gdm3.css). There was only one provided by Ubuntu. So I added one more: sudo update-alternatives --install /usr/share/gnome-shell/theme/gdm3.css gdm3.css /usr/share/gnome-shell/theme/gnome-shell.css 2000 and started gnome session. – Daniil Lopatin Oct 26 '18 at 15:07
  • Which directory does resource:///org/gnome/shell/theme/ points to? – Sun Bear Oct 01 '19 at 15:14
  • My question was asked and answered here – Sun Bear Oct 01 '19 at 16:32
4

Run: sudo update-alternatives --config gdm3.css and choose the option 1 (or the one with the path to gnome-shell.css file) as seen below:

command

Reboot and Ok, you're good to go.

1

In a shell, type:

sudo update-alternatives --config gdm3.css

You will get a screen asking for alternative gdm3.css. Select the one with gnome-shell.css.

For example mine is

Eliah Kagan
  • 117,780
Hari
  • 137