HowTo: randomize LightDM / XFCE v4.x login screen wallpaper images.
For fans of the lightweight and highly configurable linux desktop environment XFCE, with it's default Greeter managed by LightDM, it's a frustrating fact of reality that there is no built in way to randomize the login screen image. This simple perl script and directory layout will provide that service using a cron job. The process will copy a random image file from a directory that contains a pool of images into a 'publish' directory; as
background.jpg. XFCE then uses that image as the background for the login screen once configured.
The basic premise of this procedure will be:
- populate some directory with images you want to use for login backgrounds.
- setup a cron job to run a script to copy a random image from the source directory into a
- XFCE will use that image as the login screen background image.
An example project for configuring randomized login screens for XFC can be found here
Single vs Multi User system and encrypted
- Single-user systems that do not use encrypted home directories you can use a directory within your home directory (i.e.
- Multi-user systems that use a program like variety will need to use a user-group level directory location. (i.e.
- Single-user and Multi-user system that use encrypted home directories will need to use a user-group level directory location (i.e.
Examples will assume a multi-user system with encrypted home directories.
clone the example project to an appropriate directory:
# a global directory space cd /opt # # clone the project sudo git clone firstname.lastname@example.org:karlredman/LoginWallpaper-XFCE-Variety.git # # set permissions on the project directory sudo chown -R root:users LoginWallpaper-XFCE-Variety
add images to the image directory
- Add whatever
jpgimages you deem worthy / safe to be on a login screen. For this example the images you add will go into
- Do verify that your images belong to
usersgroup -change as necessary
run the project script to seed the
- seed the file
cp $(/opt/LoginWallpaper-XFCE-Variety/mbin/print_random_file.pl /opt/LoginWallpaper-XFCE-Variety/Variety) /opt/LoginWallpaper-XFCE-Variety/Greeter/background.jpg
- verify the file exists -troubleshoot...
Configure LightDM Greeter via the GUI interface
- start the greeter config app using one of these methods:
- via the GUI menu for
LightDM GTK Greeter settings
- name may vary based on linux desktop distribution
- via command line
- via the GUI menu for
- the name
Save the setting and exit the app
test and debug
If you are having issues try to run the command manually.
add cron job
- open cron in your default editor:
- add the job (example)
# change to wallpaper every 10 min */10 * * * * cp $(/opt/LoginWallpaper-XFCE-Variety/mbin/print_random_file.pl /opt/LoginWallpaper-XFCE-Variety/Variety) /opt/LoginWallpaper-XFCE-Variety/Greeter/background.jpg
Variety as the image source:
Variety is a wallpaper background manager that is available for several linux distributions and is compatible with several desktop managers. One of the options
variety offers is the ability to manage your login greeter image.
- open variety preferences and navigate to
Login Screen Supportcheckbox
- specify the image directory (i.e. /opt/LoginWallpaper-XFCE-Variety/Variety)
Oldest comments (0)