I'm trying to set a random image as the Gnome background for thecurrent user using bash.What I have found out:To set the wallpaper I can use:gconftool-2 --type string --set /desktop/gnome/background/picture_filename path_to_file.jpg;To get the path to a random wallpaper I can use:find /usr/share/backgrounds/scenery/ | grep jpg | shuf -n1;The problem is: How do I put this two commands together to change thewallpaper?
How to randomly change the Gnome background image using bash?
bash;gnome
The bash construct $(command) will expand into the output ofcommand. You could use it thusly:gconftool-2 --type string \  --set /desktop/gnome/background/picture_filename \  $(find /usr/share/backgrounds/scenery/ | grep jpg | shuf -n1)Note that I kept your find command exactly as you put it in yourquestion, but perhaps it would be better expressed asfind path -type f -name '*.jpg'.