December 4, 2015

A Gnome 3 Script to Change Your Desktop's Wallpaper Every 5 Minutes

This is a Gnome 3 script to change your desktop's wallpaper every 5 minutes.

Copy this script to your ${HOME}/bin directory. Remember to make this script eXecutable.

Create a wallpaper directory in your Pictures directory and add your pictures.

Add the line "*/5 * * * * ${HOME}/bin/wallpaper.sh" to your crontab. It is set to run every 5 minutes. Enjoy!



#! /bin/bash

# crontab: run every 5 minutes
# MIN HR DOM MON DOW CMD
# */5   *  *   *   *   ${HOME}/bin/wallpaper.sh

DIR=${HOME}/Pictures/wallpaper

file_list=(${DIR}/*)
X=$[ $RANDOM % ${#file_list[@]} ]

DISPLAY=:0 gsettings set org.gnome.desktop.background picture-uri file://${file_list[${X}]}

The script is free, but explanations will cost extra.

No comments:

Post a Comment