Skip to content

Instantly share code, notes, and snippets.

@51114u9
Last active October 28, 2020 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 51114u9/a7491ab9be6e65ce2521a3a66cf8ecdf to your computer and use it in GitHub Desktop.
Save 51114u9/a7491ab9be6e65ce2521a3a66cf8ecdf to your computer and use it in GitHub Desktop.
Script to change desktop background in XFCE desktop
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# make this script executable and add it to the folder /etc/cron.hourly
path="/media/data/background"
if [ -d "$path" ]; then
filename=$(find $path -type f | shuf -n 1)
if [ -n "$filename" ]; then
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image -s $filename
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment