I would change it to something like this (when reading, look for a
dollar sign $ immediately in the start of a each line, if you can't find
one, it means the break was misplaced):

$#!/bin/bash
$#Start of script. Copy the line above too.

$wallpaper_directory_path="${HOME}/Images/Wallpapers"
$time_for_each_change="10m"

$while true
$do
$selected_file_path="${wallpaper_directory_path}/$(shuf --head-count="1"
<<< "$(ls "${wallpaper_directory_path}")")"
$wait
$while [[ ! "$(file --brief --mime-type "${selected_file_path}")" =~
^image/.* ]]
$do
$selected_file_path="${wallpaper_directory_path}/$(shuf --head-count="1"
<<< "$(ls "${wallpaper_directory_path}")")"
$wait
$done
$mateconftool-2 -t string -s /desktop/mate/background/picture_filename
"${selected_file_path}"
$sleep "${time_for_each_change}"
$done

$exit
$# End of script.

Reply via email to