How can I change the purple background color of the lock screen on Ubuntu 17.10?

44,823

Solution 1

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

Solution 2

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.

Solution 3

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

Share:
44,823

Related videos on Youtube

Balázs Sáros
Author by

Balázs Sáros

Updated on September 18, 2022

Comments

  • Balázs Sáros
    Balázs Sáros over 1 year

    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.

  • Balázs Sáros
    Balázs Sáros over 6 years
    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.
  • George Udosen
    George Udosen over 6 years
    See my updated answer to change the lock screen image!
  • Balázs Sáros
    Balázs Sáros over 6 years
    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).
  • George Udosen
    George Udosen over 6 years
    Ok I see let me look around!
  • George Udosen
    George Udosen over 6 years
    To change the color change that hex code before the image and restart your system
  • George Udosen
    George Udosen over 6 years
    Mine says nothing to config...
  • Balázs Sáros
    Balázs Sáros over 6 years
    Already tried that but the purple lock screen (note: the lock screen, not the login screen) remains unchanged.
  • George Udosen
    George Udosen over 6 years
    Did you restart your system? Works on my end...
  • Balázs Sáros
    Balázs Sáros over 6 years
    Yes, and the login screen has changes accordingly but not the lock screen.
  • George Udosen
    George Udosen over 6 years
    On my end both have changed see the image I added!
  • Balázs Sáros
    Balázs Sáros over 6 years
    OMG, I restarted it again and now it's working properly! Thanks!
  • pomsky
    pomsky over 6 years
    "option 1" most probably won't be the same for everyone. Could you please edit your answer and mention clearly which option to choose?
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 6 years
    Small point perhaps but instead of PATH/TO/YOUR/IMAGE I would use /PATH/TO/IMAGE or something similar with a / prefix.
  • George Udosen
    George Udosen over 6 years
    @WinEunuuchs2Unix updated it, very good suggestion!
  • David Foerster
    David Foerster over 6 years
    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 and use that. Thanks.
  • David Foerster
    David Foerster over 6 years
    On another note, that's the same as Renê’s answer. Please don't duplicate existing answers.
  • Zanna
    Zanna over 6 years
    This is much better than Rene's answer which doesn't meaningfully say which option to choose
  • Balázs Sáros
    Balázs Sáros over 6 years
    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
  • Renê Barbosa
    Renê Barbosa over 6 years
    Ok! Answer edited !
  • Renê Barbosa
    Renê Barbosa over 6 years
    Balázs, I've tested with Ubuntu 17.10 and the update-alternatives thing is working fine..
  • Will I Am
    Will I Am over 6 years
    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.
  • Asifa.K
    Asifa.K over 6 years
    -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?
  • Waylon Flinn
    Waylon Flinn almost 6 years
    If you only have one option, run this command first sudo apt install ubuntu-gnome-desktop
  • Fernando Santucci
    Fernando Santucci over 5 years
    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
    Fernando Santucci over 5 years
    Maybe tweaking the Grub2 bootloader USplash theme?!
  • Tom Mercer
    Tom Mercer over 5 years
    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.
  • beruic
    beruic over 5 years
    This does not work on Ubuntu 18.04. There is only one alternative.
  • luukvhoudt
    luukvhoudt over 5 years
    At the top of the file it says "This stylesheet is generated, DO NOT EDIT", why you encourage to still edit this file?
  • Daniil Lopatin
    Daniil Lopatin over 5 years
    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.
  • Sun Bear
    Sun Bear over 4 years
    Which directory does resource:///org/gnome/shell/theme/ points to?
  • Sun Bear
    Sun Bear over 4 years
    My question was asked and answered here