Advertisement
Guest User

slideshow

a guest
Feb 9th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $# -lt 2 ]
  4. then
  5. echo
  6. echo
  7. echo "You are missing some parameters."
  8. echo
  9. echo "example: $0 *.jpg"
  10. echo
  11. exit 1
  12. fi
  13.  
  14. echo -n "Give a name to your new wallpaper slideshow: "; read showname
  15. echo -n "How many seconds do you want each image to display before switching? "; read hold
  16. echo -n "How many seconds would you like the transition to take? "; read fade
  17.  
  18. #params
  19. outfile=backgrounds.xml
  20.  
  21.  
  22. #DEBUG
  23. echo
  24. echo "Executing ..."
  25. echo "Output to $outfile"
  26.  
  27. #remove hold parameter
  28. #shift
  29. #remove fade parameter
  30. #shift
  31.  
  32. ( #all of the contents in parentheses will be output to the outfile.
  33. echo "<background>"
  34. echo " <starttime>"
  35. echo " <year>2011</year>"
  36. echo " <month>01</month>"
  37. echo " <day>01</day>"
  38. echo " <hour>00</hour>"
  39. echo " <minute>00</minute>"
  40. echo " <second>00</second>"
  41. echo " </starttime>"
  42.  
  43. while [ $# -gt 0 ]
  44. do
  45. echo
  46. echo " </transition>"
  47. echo " <duration>$fade</duration>"
  48. echo " <from>$1</from>"
  49. echo " <to>$2</to>"
  50. if [ $# -gt 1 ]
  51. then
  52. echo " <to>$1</to>"
  53. else
  54. echo " <to>$1</to>"
  55. fi
  56. echo " </transition>"
  57.  
  58. shift
  59. done
  60. echo "</background>"
  61. #Closing parenthesis marks the end of material to be output to the outfile.
  62. )>$outfile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement