Yet Another Random Wallpaper Changer

Here’s yet another utility that, yep, you guessed it, is written in perl called chreli-randomwall. As the name implies, it’s random (keyword) wallpaper changer for desktop environments such as Openbox.

Requirements

The following are required for chreli-randomwall:

  • x11-xserver-utils (needed for xrandr)
  • nitrogen

The following are required for chreli-randomwall-hsetroot:

  • x11-xserver-utils (needed for xrandr)
  • hsetroot

Installation

To install, download chreli-randomwall_1.1.20170522.deb or chreli-randomwall-hsetroot_1.0.20170527.deb and execute the following command:

Disclaimer: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

sudo /usr/bin/dpkg -i chreli-randomwall_1.1.20170527.deb

Or

sudo /usr/bin/dpkg -i chreli-randomwall-hsetroot_1.0.20170527.deb

Usage

For Openbox, add the following, for example in ~/.config/openbox/autostart:

sleep 2 && /usr/bin/chreli-randomwall &

Or

sleep 2 && /usr/bin/chreli-randomwall-hsetroot &

The above will start chreli-randomwall upon login to Openbox.

Configuration

Upon initial execution of chreli-randomwall, it will create and set defaults in ~/.config/chreli-randomwall/chreli-randomwall.conf:

# chreli-randomwall 1.1.20170527
#
# configuration file for chreli-randomwall

# interval (in seconds) to change wallpaper
# default: 300
chreli-randomwall.interval=300

# directories to search for images
#  o comma separate for multiple directories
# default: /home/cygnus/Pictures
chreli-randomwall.image.dirs=/home/cygnus/Pictures,/home/cygnus/pics

The default interval (when to change the wallpaper) is 300 seconds (5 minutes). The default directory to look for images is ~/Pictures. If there is a desire to use multiple directories, that can be accomplished by a comma separated list. Any new images that are added while chreli-randomwall is running will be used the next time it re-reads the image dir(s), which it does after it cycles though showing all the images. This could take a while depending on how many images are involved. For the impatient, the process id for chreli-randomwall can be killed off and started again; be sure to send it background.

As stated earlier, chreli-randomwall randomly change the wallpaper. Meaning that if you have 100 unique images, once you see the first one, you should not see it again until the other 99 are displayed; unless, of course, you have the same image multiple times in the directory with a different file name.

If you have multiple monitors (who doesn’t, right), chreli-randomwall will detect (via xrandr)that too and update ~/.config/nitrogen/bg-saved.cfg as shown in the example below:

[xin_-1]
file=/home/cygnus/Pictures/c62314c087379a9f2306412ca4268925.jpg
mode=0
bgcolor=#242424
[:0.0]
file=/home/cygnus/Pictures/c62314c087379a9f2306412ca4268925.jpg
mode=0
bgcolor=#242424

The current version of chreli-randomwall will show the same image on all monitors that may be configured. A future release may allow for a different image on each screen.

And that’s all I have to say about that.

This entry was posted in Geek, Linux, PERL, Scripting and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply