Bash Script to Set Random XScreensaver as background

Posted on Wednesday the 10th of October, 2007 at 12:39 pm in Linux

This short bash script will randomly select a screensaver and display it in your background window, so you can have a random screensaver background instead of having to select a particular. Obviously you will need to have Xscreensaver installed for it to work.

  1. !/bin/bash
  2. files=(/usr/lib/xscreensaver/*) # Look for files in the XScreensaver folder n=${#files[@]} # For aesthetics "${files[RANDOM % n]}" -root & # Choose a random screensaver and execute it in the root window.

Related posts

  1. ZipFile posted the following on October 19, 2008 at 2:06 am.

    Thanx for script

    Reply to ZipFile

Leave a reply

:) :D :( :o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: ;) :!: :?: :idea: :arrow: :| :mrgreen: