I know there's Ubuntu Tweak, but if I remember correctly, it was discontinued a while back. Didn't wanna try using it on my laptop just in case that screws it up.
-
Would you give consideration to accepting one of the two answers below or critiquing improvements to either one to make them acceptable? – WinEunuuchs2Unix May 14 '18 at 22:48
2 Answers
This solution will change the lock-screen wallpaper and the logon wallpaper (greeter screen) at the same time.
Note: In Ubuntu 18.04 only the lock screen wallpaper is changed. A different technique will be required to change the login wallpaper.
gksu gedit /usr/share/glib-2.0/schemas/10_unity_greeter_background.gschema.override
Then add the lines below:
[com.canonical.unity-greeter]
draw-user-backgrounds=false
background='/home/user_name/Pictures/picture_name.png'
In my example change /home/user_name/Pictures/picture_name.png to whatever directory and file name you want to use. Note .jpg file formats are also accepted.
Next compile the schema using:
sudo glib-compile-schemas /usr/share/glib-2.0/schemas
The final step is to log-out or reboot.
This works in Ubuntu 16.04 but I haven't tested it in Ubuntu 16.10 please respond via comment if you know for sure. Thanks.
You can use Nautilus to view wallpaper images and right click to change login screen and lock screen wallpaper: (Nautilus can set desktop wallpaper. How can it set login and lock screen wallpaper?).
Sample screen:
- 102,282
-
I had to run
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/afterwards to make the changes take effect (Ubuntu 16.04). – sigalor Mar 03 '17 at 22:00 -
The compile step is in the link referenced at the bottom of the answer. I thought it was in this answer too but might have been removed with an edit roll back. Thanks for bringing it to my attention. – WinEunuuchs2Unix Mar 03 '17 at 22:46
-
@sigalor I've added the missing step. Thanks again for letting me know and helping out others in the community. – WinEunuuchs2Unix Mar 03 '17 at 23:58
-
-
-
@OrganicMarble Can you point me to a link on setting up Unity-Greeter in 18.04 or probably 17.10 too right? – WinEunuuchs2Unix May 14 '18 at 22:44
-
@WinEunuuchs2Unix My setup is Ubuntu w/ LXDE on top of it. When I upgraded to 18.04, I just installed lightdm and it brought unity-greeter with it. It seems that other times I've had to install lightdm and unity-greeter separately. – Organic Marble May 14 '18 at 22:47
-
@OrganicMarble Will lightdm break gdm? The "Ubuntu" sign on works now and it uses gdm right? The "Unity" sign on works fine too without lightdm. – WinEunuuchs2Unix May 14 '18 at 22:50
-
You have to either run gdm or lightdm. When you install lightdm a screen appears that gives you the choice. I haven't tried to switch back to gdm but I think it would be OK. I don't really recall why I install lightdm, it's just part of my standard setup now. – Organic Marble May 14 '18 at 22:51
-
1@OrganicMarble My inclination is to make the script dynamic. If it sees gdm it'll add an extra routine to compile the gdm login screen wallpaper. It would still compile the lightdm login/login screen no matter what I guess. I need to experiment with it a bit I guess... – WinEunuuchs2Unix May 14 '18 at 22:55
Introduction
The general idea here is that one must somehow change the image of either login screen or lock screen. Now, since we can switch to either one, there are two ways to approach the task:
- Lock screen shows user's background. We could change user image and go to lock screen, and once screen is unlocked - restore user's original background.
- Alter the login screen and use that instead of lock screen.
End result is the same: you will end up with one image on your desktop, and another on whatever lock-screen method you use. Both approaches use scripts instead of doing all the steps manually, so keep in mind - standard rules for scripting apply: they must be saved in a specific location and made executable with chmod +x /path/to/script command
Temporarily altering user background
For the task #1 , I've written a perl script to do the task, which is on GitHub. Basic idea here is to use it as
./lockscreen_background.pl /home/user/some_picture.jpg
This command can be either bound to a keyboard shortcut via System Settings -> Keyboard - > Shortcuts -> Custom, or can be used via command-line. The script was slightly slow , at least in my tests, but does the job. If you want to have more "dynamic" approach, here's what I personally use for shortcut command:
bash -c "zenity --file-selection | xargs --no-run-if-empty ./bin/perl/lock_screen_background.pl"
That calls up a file chooser dialog, and passes the file you selected to the perl script. Of course, that implies you have to choose an image each time, but at least you don't have to edit shortcut definition each and every single time.
Altering login-screen and using it instead of lock screen
For the task #2, the idea is to alter login screen (or greeter, which is the technical term for login screen) background and use dm-tool switch-to-greeter command. That's what WinEunuuchs2Unix's answer does. Of course that way is far longer and of course there exist scripts for the task. I've written one in the past for this askubuntu answer: https://askubuntu.com/a/694370/295286 It is also available on GitHub
Usage is also similar:
./chgreeterbg.sh /home/user/Pictures/some_cool_image.jpeg && dm-tool switch-to-greeter
The use of this script is much more extensible: you can alter the login-screen background for whatever purpose you like. Many commercial and educational facilities use "banner" wallpapers to display warnings or organization's logo, and this script can be well used for that purpose
- 105,154
- 20
- 279
- 497
