Created
August 28, 2020 21:45
-
-
Save Dih5/28fa63a0a76681bdaad0d20ee27fae47 to your computer and use it in GitHub Desktop.
Set a random wallpaper in MATE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# path to the wallpaper directory | |
rep="$HOME/wallpapers" | |
# list of files (assumed images) | |
images=("${rep}/"*) | |
# Random position | |
choice=$((${RANDOM} % ${#images[@]})) | |
# Set the image as wallpaper (note quotes are expected) | |
dconf write /org/mate/desktop/background/picture-filename "'${images[${choice}]}'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment