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
  • 35,970
  • 13
  • 99
  • 121
Balázs Sáros
  • 533
  • 1
  • 4
  • 6

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

Gaurav Kumar
  • 105
  • 3
George Udosen
  • 35,970
  • 13
  • 99
  • 121
  • 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](https://askubuntu.com/questions/1043426/how-can-i-access-org-gnome-shell-theme-which-is-referred-to-in-the-ubuntu-css) – 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.

Renê Barbosa
  • 307
  • 2
  • 3
  • 10
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
  • 116,445
  • 54
  • 318
  • 493
Hari
  • 137
  • 2
  • Could you please post text files, dialogue messages, and program output listings as text, not as images? To achieve the latter two you can either 1) select, copy & paste the dialogue text or terminal content or 2) [save the program output to a file](//askubuntu.com/q/420981/175814) and use that. Thanks. – David Foerster Nov 30 '17 at 09:34
  • 3
    On another note, that's the same as [Renê’s answer](/a/981630/175814). Please don't duplicate existing answers. – David Foerster Nov 30 '17 at 09:35
  • 2
    This is much better than Rene's answer which doesn't meaningfully say which option to choose – Zanna Nov 30 '17 at 10:33
  • Please note that on Ubuntu 17.10 there is no such option. Only ubuntu.css and this is a way less flexible solution than George's – Balázs Sáros Nov 30 '17 at 12:11
  • Balázs, I've tested with Ubuntu 17.10 and the update-alternatives thing is working fine.. – Renê Barbosa Nov 30 '17 at 18:48
  • 1
    -1. This doesn't allow one to change the purple background, as far as I can tell. Perhaps more detail (especially on the outcome?) would aid clarity here? – starbeamrainbowlabs Jan 02 '18 at 18:30
  • This does not work on Ubuntu 18.04. There is only one alternative. – beruic Sep 24 '18 at 23:31