3 # We need our sj function...
6 # Get the PID of the running setbg process
7 setbgPID=$(sj setbg | awk '{print $2}')
9 # Check to make sure it's not blank, meaning no setbg process running
10 if [ -s "$setbgPID" ]; then
11 echo "There is no setbg process running"
15 # Check to see if setbgPID has multiple processes. Multiple processes
16 # should never happen but if we get more than one PID back then they
17 # will be listed side by side with spaces, so check that.
18 echo $setbgPID | grep -q ' '
21 echo "There are multiple setbg processes???"
25 setbgPicture=$(cat ~/.setbg)
26 rm "$setbgPicture" && kill -USR1 $setbgPID