Written by: | ![]() michelsaey |
Score: 13 votes: 17 Format: Article |
Wallpaper changer in mate
You can change your wallpaper automatically in mate by writing a bash script.
I marked the ones in red where to put your variables.
-open your editor (ex. pluma)
- copy and paste the following and edit your variables (one variable for the seconds between wallpapers to change and the other one is the location where the wallpapers located at. Note: the .jpg files may not have spaces in the filename.
# Script to randomly set Background from files in a directory
while true;do
# specify how long to wait in seconds between changes
sleep 3600
# Directory Containing Pictures
DIR="/home/michel/Wallpapers"
# Command to Select a random jpg file from directory
# Delete the *.jpg to select any file but it may return a folder
PIC=$(ls $DIR/*.jpg | shuf -n1)
# Command to set Background Image
mateconftool-2 -t string -s /desktop/mate/background/picture_filename $PIC
done
-save the file and name it in a way that it means something to you with .sh extension for example wallpaper_changer.sh
-open a terminal and go to the file's dir
-make the file executable by typing: chmod 700 wallpaper_changer.sh
-then type: sh wallpaper_changer.sh &
-You may want to add the command 'sh /home/username/wallpaper_changer.sh &' to your startup applications
Tags: wallpaper changer mate
Created: 6 years ago.
Last edited: 6 years ago.
Reviewed: 6 years ago.
Comments | |||
1 year ago |
![]() mfc0609 |
Just wanted to say thank you. Was getting frustrated trying to get this seemingly simple task done for Mint 18 (Sarah) 64bit Mate found this page and Trapper333's "slightly altered script" worked like a charm. | |
3 years ago |
![]() michelsaey |
I stopped using Mate a long time ago in favor of Xfce so my apologies for not be able to updating this script here in the comments. Many thanks for those who had updated this script when something changes in Mate. The users of Mate are thankful for that. ;-) |
|
4 years ago |
![]() Trapper333 |
I tried momist's suggestion of "Variety" in LM17 64bit MATE and it worked well for me. Lots of options too. I also tried this slightly altered script and it worked as a basic wallpaper changer in LM17 with MATE: # Script to randomly set Background from files in a directory while true;do # Directory Containing Pictures DIR="/home/me/mypics" # Make sure spaces do not break our script. IFS=' ' # Command to Select a random jpg file from directory # Delete the *.jpg to select any file but it may return a folder PIC=$(ls $DIR/*.jpg | shuf -n1) # Command to set Background Image gsettings set org.mate.background picture-filename $PIC # specify how long to wait in seconds between changes sleep 600 done #Save the script above as a script. I simply named it wallpaper_changer.sh #-make the file executable by typing: chmod 700 /home/me/where-it-is/wallpaper_changer.sh #-then type: sh /home/me/where-it-is/wallpaper_changer.sh & #-You may want to add the command '/home/me/where-it-is/wallpaper_changer.sh &' to your startup applications I much prefer 'Variety'. |
|
5 years ago |
![]() Ikem |
To change the wallpaper on the shell I use this command: gsettings set org.mate.background picture-filename "$PICTURE" |
|
5 years ago |
![]() momist |
OK, for those looking here hoping for a solution. Linux Mint 15 Olivia with MATE desktop. The program "Variety" works for me. http://peterlevi.com/variety/how-to-install/ |
|
5 years ago |
![]() momist |
Hmm, Can anyone please suggest how this can be adapted for Mint 15 Olivia MATE? The scripts given don't work for me, and I suspect that this is down to changes in the way the desktop background is set in MATE. @ dark-sun, Your script gives me this in the terminal: wallpaper_changer.sh: 16: wallpaper_changer.sh: mateconftool-2: not found wallpaper_changer.sh: 17: wallpaper_changer.sh: mateconftool-2: not found @ triplemaya, yours gives this: ~ $ Usage: gsettings [--schemadir SCHEMADIR] set SCHEMA[:PATH] KEY VALUE Set the value of KEY to VALUE Arguments: SCHEMADIR A directory to search for additional schemas SCHEMA The name of the schema PATH The path, for relocatable schemas KEY The key within the schema VALUE The value to set |
|
6 years ago |
![]() herbie643 |
Perfect, just what I was looking for. | |
6 years ago |
![]() yves910 |
Thanks ! |
Other tutorials from michelsaey
- Shutdown/Restart - Get rid of authentication during shutdown/restart
- Check HP printer or multifunctional ink level
- Reduce swappines
- Use 'Windows-key' for opening main menu instead of 'Alt-F1' in Mate
- Change ugly fonts in Firefox (KDE)
- Run pulseaudio systemwide
- Change file permissions with chmod
- Change Font Type and Color of Panel Clock in Mate
- Stop Firefox asking to save tabs
- Speed up Firefox
- Speed up system menus in Xfce