Guest User

Untitled

a guest
Mar 10th, 2011
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. 1 #!/bin/bash
  2. 2 export DIR='/home/karkusha/Pictures/Pictures/'
  3. 3 export NUMBER=$RANDOM
  4. 4 export TOTAL=0
  5. 5 for f in `ls $DIR`
  6. 6 do
  7. 7 let "TOTAL += 1"
  8. 8 done
  9. 9 let "NUMBER %= TOTAL"
  10. 10 export CURRENT=0
  11. 11 for f in `ls $DIR`
  12. 12 do
  13. 13 if [ $CURRENT = $NUMBER ]
  14. 14 then
  15. 15 /usr/bin/gconftool-2 -t string -s /desktop/gnome/background/picture_filename $DIR/$f
  16. 16 break
  17. 17 fi
  18. 18 let "CURRENT += 1"
  19. 19 done
  20. ~
Advertisement
Add Comment
Please, Sign In to add comment