Change linux login screen

How do I change login screen theme or background in Ubuntu 20.04?

How can I change the Ubuntu 20.04 login screen theme or background? In the previous version 19.10, I can change it from the CSS file under Yaru theme but now there is no CSS file.

The answer is to install vanilla-gnome-default-settings. This will set the GDM theme to Gnome stock, and also give you the option of continuing to use Yaru as your theme or the stock stock Gnome theme.

I haven’t tested this on 20.04, but I believe my answer here for how to do this on 21.10 should work on 20.04, and it doesn’t require installing any third-party scripts or extracting gresource files: askubuntu.com/a/1396066/84581

3 Answers 3

In previous versions of Ubuntu since its introduction of gdm3 for login greeter, the style sheet file is directly available to edit.

/usr/share/gnome-shell/theme/ubuntu.css #for Ubuntu 18.04 /usr/share/gnome-shell/theme/Yaru/gnome-shell.css` #for Ubuntu 19.10 

are the files being used as alternatives.

The name of alternatives is gdm3.css .

for Ubuntu 20.04 the equivalent to above is gdm3-theme.gresource

$ update-alternatives --config gdm3-theme.gresource There are 3 choices for the alternative gdm3-theme.gresource (providing /usr/share/gnome-shell/gdm3-theme.gresource). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource 15 auto mode 1 /usr/local/share/gnome-shell/theme/focalgdm3.gresource 0 manual mode 2 /usr/share/gnome-shell/gnome-shell-theme.gresource 10 manual mode 3 /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource 15 manual mode Press to keep the current choice[*], or type selection number: 

from the core files of Ubuntu, the config for gdm is

stylesheetName: 'gdm3.css', themeResourceName: 'gdm3-theme.gresource', 

the above means that one needs to edit the file gdm3.css inside the .gresource file from the above update-alternatives result. Or install some other .gresource files which have the compatibility for Ubuntu 20.04. for example in above output you have the choice of

. /gnome-shell/gnome-shell-theme.gresource 

as an alternative. If you trust some other (external sources) .gresource files that have the compatibility for Ubuntu 20.04, You can install them as an alternative and use it.

for example, you can extract the gdm3.css and see the color that is configured for login screen background.

run the below commands one by one

gresource extract /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource /org/gnome/shell/theme/gdm3.css > $HOME/gdm3.css gedit $HOME/gdm3.css 

Editing this content with your required content and recompiling it to create new .gresource file is required. After which you can install this new .gresource file as an alternative and select it.

Читайте также:  Removing files linux command

How to extract and compile?

Disclimer: this link is only for Idea. Proper making and configuration is required for getting things to work for Ubuntu 20.04 Otherwise system will be bricked. Please note that this post is quite older and contents vary from Ubuntu 20.04.

Also note that the package libglib2.0-dev is required to compile the .gresource file.

Well, seems the process is very heavy just for changing the login screen background, rite? what if you want to change the background Image or color of the Login screen frequently?

Workaround
for changing login background with Image/ Color/ Gradient Horizontal/Vertical with a script.

you can download the ubuntu-gdm-set-background file via command line

wget -qO - https://github.com/PRATAP-KUMAR/ubuntu-gdm-set-background/archive/main.tar.gz | tar zx --strip-components=1 ubuntu-gdm-set-background-main/ubuntu-gdm-set-background 

Once you downloaded the script ubuntu-gdm-set-background .

Make sure you have installed the required package, libglib2.0-dev-bin .
If not installed, Install it with the command

sudo apt install libglib2.0-dev-bin 

background with image
background with color
background with gradient horizontal ( requires two valid hex color inputs)
background with gradient vertical ( requires two valid hex color inputs)

tip: be ready with valid hex color code in place of below example like #aAbBcC or #dDeEfF . Change them to your preferred hex color codes. you may choose colors from https://www.color-hex.com/

sudo ./ubuntu-gdm-set-background --image /home/user/backgrounds/image.jpg sudo ./ubuntu-gdm-set-background --color \#aAbBcC sudo ./ubuntu-gdm-set-background --gradient horizontal \#aAbBcC \#dDeEfF sudo ./ubuntu-gdm-set-background --gradient vertical \#aAbBcC \#dDeEfF sudo ./ubuntu-gdm-set-background --reset ./ubuntu-gdm-set-background --help 

try Ctrl + Alt + F1 to go the gdm screen to see the change.

If change does not appear, then restart gdm with below command

sudo systemctl restart gdm 

Источник

How to Change Login Screen Background in Ubuntu 22.04 [Another Script]

Want to change the background wallpaper or just set another color for Ubuntu Gnome login screen? Here’s how to do the trick in Ubuntu 22.04!

As you may know, the GDM background is not easy to modify since GNOME hard-coded the CSS into a .gresource file. Some scripts has been created in github to deal with it, but so far there’s no universal one that works on all Linux (or even all Ubuntu) editions.

I was waiting for the graphical GTK4 tool Login Manager, however, it never works and even breaks the login screen when I tried it in Fedora Workstation.

Change Login Screen Background in Ubuntu 22.04

For those still waiting for the maintainers to update their scripts, this one has been tested and works good in Ubuntu 22.04.

Читайте также:  Domination client для linux

1. Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to install the required library:

sudo apt install libglib2.0-dev-bin

2. Now, paste the command below and hit run to download the script via wget:

wget -qO - https://github.com/PRATAP-KUMAR/ubuntu-gdm-set-background/archive/main.tar.gz | tar zx --strip-components=1 ubuntu-gdm-set-background-main/ubuntu-gdm-set-background

3. OK, now use command to change login screen background image:

sudo ./ubuntu-gdm-set-background --image /PATH/TO/YOUR/IMAGE

Tip: instead of typing file path manually, you may just drag & drop image file into terminal to insert its path

Or set another background color via command (replace #aAbBcC to your desired value):

sudo ./ubuntu-gdm-set-background --color \#aAbBcC

or set gradient color background via (replace horizontal to vertical as you want):

sudo ./ubuntu-gdm-set-background --gradient horizontal \#aAbBcC \#dDeEfF

As the terminal output indicates, press Ctrl+Alt+F1 (switch back via Ctrl+Alt+F2) to verify the changes or just restart your computer after saving your work.

Move the script to your PATH:

If you would like to use the script regularly, run the command below to move to “/usr/local/bin”:

sudo mv ~/ubuntu-gdm-set-background /usr/local/bin

Then, you may use the command at any time at any working directory via (change —image to —color or —gradient accordingly):

sudo ubuntu-gdm-set-background --image /PATH/TO/IMAGE

Known issue

As far as I know, it will NOT work if you do not type (or drop’n’drop) the FULL path to image. The last sudo command in previous picture didn’t work, as I navigated to image folder and type file name directly without path.

And if you use a remote image without pasting to local disk first, it may break your login screen so you’ll see the error screen as the bottom image shows.

How to Restore:

The script has a —reset option to restore the original blank background. To use it, just run:

sudo ./ubuntu-gdm-set-background --reset

Or use this command if you’ve move it into your PATH:

sudo ubuntu-gdm-set-background --reset

If the login screen is broken with error “Oh, no! Something has gone wrong …”, press Ctrl+Alt+F3 (~ F6) (right Ctrl+F3 ~ F6 for Virtualbox VM) to get into tty console. Then type username and password one by one to login, and run the previous reset command to restore.

permalink

Ji m

I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

One response to How to Change Login Screen Background in Ubuntu 22.04 [Another Script]

I used to run this and use an image file of /Pictures/current_wallpaper. This was a symlink to an image. On logout I’d run a script that picked another image from a list of login images and reset the symlink. This used to work in that every time I logged out I’d get a new background image. This no longer works. Not sure why. Perhaps it’s not following the symlink anymore. Maybe it makes a copy of the image file somewhere. Also, any way to get this to be essentially the lock screen?

Читайте также:  Запустить службу печати linux

Источник

Changing the Login Screen Background in Ubuntu 22.04 & 20.04

The login screen is the first thing you see when booting up your Ubuntu system, and customizing its background can add a personal touch to your overall desktop experience. In this article, we will explore a powerful tool called “ubuntu-gdm-set-background” available on GitHub, which allows users to easily change the login screen background in Ubuntu. By following this step-by-step guide, you will be able to personalize your login screen with your preferred image.

Step 1: Installation of ubuntu-gdm-set-background

To begin, we need to install the “ubuntu-gdm-set-background” tool. Follow these steps to proceed:

sudo apt install libglib2.0-dev-bin 

Now download the script that will help you with setting up the login screen background wallpaper on Ubuntu systems.

wget -qO - https://github.com/PRATAP-KUMAR/ubuntu-gdm-set-background/archive/main.tar.gz | tar zx --strip-components=1 ubuntu-gdm-set-background-main/ubuntu-gdm-set-background 

To find out the command help run the following command:

./ubuntu-gdm-set-background --help 

Step 2: Change the Login Screen Background

You can set an image, solid color, and horizontal or vertical gradient color at the Ubuntu login screen running with Genome display manager (GDM).

Use one of the following commands to change the login screen background of your choice:

    Set an image – Use the following command to set an image to the login background.

sudo ./ubuntu-gdm-set-background --image /home/user/backgrounds/image.jpg 
sudo ./ubuntu-gdm-set-background --color \#aAbBcC 
sudo ./ubuntu-gdm-set-background --gradient horizontal \#aAbBcC \#dDeEfF 
sudo ./ubuntu-gdm-set-background --gradient vertical \#aAbBcC \#dDeEfF 
sudo ./ubuntu-gdm-set-background --reset 

Here are a few screenshots of the login screen after setting up with the above commands.

Changing the Login Screen Background in Ubuntu Changing the Login Screen Background in Ubuntu Changing the Login Screen Background in Ubuntu

Conclusion

Customizing the login screen background in Ubuntu can significantly enhance the visual appeal of your system. With the “ubuntu-gdm-set-background” tool, changing the login screen background has become more accessible and user-friendly. By following the step-by-step guide outlined in this article, you can easily personalize your login screen with an image of your choice. Remember to experiment with different images to find the perfect match for your Ubuntu desktop environment. Enjoy the customized login experience!

Источник

Оцените статью
Adblock
detector