About Me

My photo
Kalyan Kumar Pasupuleti B-Tech(Information Technology). • AWS Certified Solutions Architect - Associate • RedHat Certified Engineer(RHCE) • Directory Services and Authentication Certificate of Expertise(LDAP) • Red Hat SELinux Policy Administration Certificate of Expertise(SELinux) • Network Services Security Certificate of Expertise (Network Services) • RedHat Certified Virtualization Administrator(RHCVA) • Red Hat Certified Security Specialist (RHCSS) Working as Cloud DevOps engineer

Thursday, April 28, 2011

Howto random background images in GDM3 - debian 6


Configure GDM3 to display random images from directory upon login screen.

A way to random background images in GDM3 - Debian 6. Should be applicable to other distributions, the only difference being configuration file paths.

If you know of a simpler approach please let us know.

PRECAUTION: I'm just a newbie customizing a family laptop, this may not work, or slow down or expose your system in ways i do not understand.
Follow procedure at your own risk.


1- Creating PostLogin bash script. #as root

cp /etc/gdm3/PostLogin/Default.sample /etc/gdm3/PostLogin/Default

2- Editing PostLogin bash script, this will take a random image from directory and make it the background image #as root

Add the following to /etc/gdm3/PostLogin/Default and adjust the path to point your images directory.
   
#change background image
dir='/your/image/directory'
file=`/bin/ls -1 "$dir" | sort --random-sort | head -1`
path=`readlink -f "$dir/$file"` # Converts to full path
cp $path /wherever/you/want/background.jpg

3- Create the background image and change permissions for all users to change background image when logging out.

touch /wherever/you/want/background.jpg
chmod 777 /wherever/you/want/background.jpg #do not know if this is necessary

4- Editing GDM3 configuration file #as root

edit /etc/gdm3/greeter.gconf-defaults

Uncomment the following line and change background image path

/desktop/gnome/background/picture_filename      /wherever/you/want/background.jpg

Optionally uncomment:
/desktop/gnome/background/picture_options       zoom

And adjust config file to your likings.

5- Restarting GDM3

invoke-rc.d gdm3 reload

/etc/init.d/gdm3 restart

No comments:

Post a Comment