Skip to content

Instantly share code, notes, and snippets.

@jelera
Created December 5, 2014 03:27
Show Gist options
  • Save jelera/2b61766b18c4ef99fd21 to your computer and use it in GitHub Desktop.
Save jelera/2b61766b18c4ef99fd21 to your computer and use it in GitHub Desktop.
MATE Desktop Wallpaper Changer
#!/bin/bash
###############################################################################
##
## Name : mate_wallpaper_changer
## Usage : ./mate_wallpaper_changer
## Description : This script will randomly change the wallpaper image in the
## MATE Desktop, using a set interval.
##
## Last Updated : Thu 04 Dec 2014 09:23:46 PM CST
##
## Notes : It's recommended to run automatically at startup.
##
## Author : Jose Elera Campana <https://github.com/jelera>
##
## License : Copyright (c) 2014 Jose Elera Campana
## The MIT License
##
###############################################################################
while true; do
# SETTINGS
INTERVAL=360 # Time in seconds
WALLPAPER_DIR="$HOME/Pictures/Wallpapers"
# This will randomly select an image from the wallpaper directory
WALLPAPER_IMG=$(ls -d -1 $WALLPAPER_DIR/*.* | shuf -n1)
# Finally, setting the image as the current wallpaper
gsettings set org.mate.background picture-filename "$WALLPAPER_IMG"
sleep $INTERVAL
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment