Custom wallpaper by user name

Discussions on Python, Bash, Perl, etc.
Post Reply
micklang
Posts: 10
Joined: Wed May 17, 2017 11:27 pm
Location: London, UK
Contact:

Custom wallpaper by user name

Post by micklang » Mon May 22, 2017 11:03 am

Have you ever wanted custom wallpaper based on userid? Well, now you can!

The config file is: /opt/jcdx/sbin/j**x-wallpaper

As this is a python file, you'll want to point out how to identify a human. Place this entry near the top, just below the function called getsite():

human = os.getlogin() # Used to determine who is loggin in-- for determining custom wallpaper

Then, under the below variable:

site = getsite()

Add the below code for each group of users:

# begin code for custom wallpaper
if str(human) in ('andre','chip'): # add users here for the cool j**x wallpaper
os.system("/usr/bin/Esetroot -scale /var/opt/jcdx/images/wallpaper/7051/jcdx-v7-purple-wide.png")
quit();




If you have multiple wallpapers that require different ones for different sizes, create more of the same code blocks for the above.

If this does not work, make sure that one of the modules that are imported at the beginning are reflected as below:

import gtk
import os

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest