On this website, you will find tutorials for installing & managing software, lists of the best linux resources, and in depth guides to linux.
Join us on SlackThe Best Linux Lockscreen
Robert Washbourne - 2 years ago - themes
To be honest, the default lock screens, also known as greeters or display managers (when the lockscreen also manages the boot login), can leave looks to be desired on pretty much every Linux distribution. To fix that, we have several options - theme the lock screen you already have, change the lock screen, or login automatically and use another option such as i3lock.
This guide shows you how to change the login screen background, edit the login screen font, use a login screen gtk theme, and change your user manager. This guide has sections for most major display managers, but the GDM guide has the most detail.
Theming your lockscreen
Typically the easiest option. The options below are for a few of the most popular display managers.
GDM Display Manager
First back up the current theme:
sudo cp -v /usr/share/gnome-shell/gnome-shell-theme.gresource{,~}
Note: Ubuntu 17+ uses a GDM config that is different than the default setup. If the following setup does not work for you please comment and I will try to help. All of the scripts I link below work for me on a fresh Fedora 27 system.
Now you have a few options. If you simply want to change the font on your login manager or change the background, you can use my script:
Editing the current theme
Download the scripts on the DevPy GitHub: devpytech/scripts/gresource-extract. Then run ./extract.sh
to extract your current theme to the "theme" folder in the same folder as the extract script.
Editing the font
Edit gnome-shell.css
. Change the font to your custom font. E.g:
stage {
font-family: 'Source Sans Pro', Sans-Serif;
font-size: 14px;
color: #eeeeec;
}
Editing the background
Copy a background to the theme folder. Then edit gnome-shell.css
and change the #lockDialogGroup
section to the filename of your image. E.g:
#lockDialogGroup {
background: #2e3436 url(resource:///org/gnome/shell/theme/background.jpg);
background-size: cover;
background-repeat: none;
}
Building & enabling
Run the ./build.sh
file from DevPy's GitHub. This will create a .gresource
file in the theme folder.
Finally, override the current gresource (make sure you have backed up the current file):
sudo mv gnome-shell-theme.gresource /usr/share/gnome-shell/gnome-shell-theme.gresource
My result:
Using your GTK Theme
My favourite method is to match the GTK theme by building a gresource file.
Here are a few results for themes I have tested:
Arc
Pop
Vertex
You can build your own using my script here: devpytech/gtk-gresource.
I've included prebuilt gresource files for the following themes:
- Arc
- Arc-Dark
- EvoPop
- Pop
- Pop-dark
- Vertex
Usage:
git clone https://github.com/devpytech/gtk-gresource.git
cd gtk-gresource
# Replace Arc with the theme you want to use
./build.sh Arc
./switch.sh Arc
After a reboot the theme should show on login and lock.
LightDM Display Manager
LightDM is probably the second most popular display manager, after GDM. To install a theme, install both lightdm
and lightdm-webkit2-greeter
through your package manager. Then, navigate to /usr/share/lightdm-webkit/themes/
through the terminal or a root file manager and copy the theme files there. Once finished, enable the theme in your /etc/lightdm/lightdm-webkit2-greeter.conf
by setting webkit-theme
.
Material
Aether
Litarvan
SDDM Display Manager
SDDM is a display manager written from scratch. It's best known for being the default with KDE Plasma 5. To install an SDDM theme, simply move it to /usr/share/sddm/themes/
, making sure that the folder name is the same as the theme name. You can enable a theme by editing /etc/sddm.conf
under the [Theme]
section and changing Current
to the theme name.
Aerial
Aerial uses gifs on the lockscreen in the style of Apple TV screensavers.
Deepin
Changing your Display Manager
This option will change the way you login ... forever. Or at least until you change back. Once you have installed a display manager, the way you change to it depends on your linux distribution. On Ubuntu, run "sudo dpkg-reconfigure gdm3
" replacing gdm3 with the current display manager.
GDM
You can install GDM with the following:
Ubuntu
sudo apt install gdm3
Fedora
sudo dnf install gdm
Arch
sudo pacman -S gdm
On other distributions, try searching gdm in the package manager.
LightDM
You can install GDM with the following:
Ubuntu
sudo apt install lightdm
Fedora
sudo dnf install lightdm
Arch
sudo pacman -S lightdm
On other distributions, try searching lightdm in the package manager.
SDDM
You can install SDDM with the following:
Ubuntu
sudo apt install sddm
Fedora
sudo dnf install sddm
Arch
sudo pacman -S sddm
On other distributions, try searching sddm in the package manager.
Not Using a Display Manager At All
If you like to login with the console, you can simply disable the Display Manager services:
sudo service gdm disable
sudo service lightdm disable
If you use this option, I suggest that you install a screenlocker / screensaver to help avoid screwing up your monitor (keeping the same image on the monitor for a long time can freeze some pixels).
XScreenSaver
XScreenSaver ships with most distributions, but if you don't have it, instructions can be found here. Theming is rather rudimentary but you can change the colours by editing ~/.Xresources
.
i3lock
Probably my favourite screen locker, i3lock is simple and has many derivations to choose from. My favourite derivation is i3lock-colors to customize the look and image.
Default
My custom wallpaper conserving script
#!/bin/bash
scrot /tmp/screen.png
xwobf -s 11 /tmp/screen.png
i3lock -i /tmp/screen.png
rm /tmp/screen.png
And that's it! If you want to go back to the defaults, simply re-enable GDM or LightDM.
Thanks for reading. Feel free to share your custom login setup in the comments below.