scannerwizard.sh 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #!/bin/sh
  2. #Scanner Wizard (c) Barry Kauler 2003 www.goosee.com/puppy
  3. #2007 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
  4. #SCRIPT NOT FINISHED
  5. #this script creates /etc/scanner, which has format driver[:device].
  6. #note, we could also have /dev/scanner linked to device.
  7. #display window with driver info...
  8. #dillo "file:///usr/share/doc/sane/sane-backends.htm" &
  9. defaultbrowser "http://www.mostang.com/sane/sane-backends.html" &
  10. sleep 1
  11. STATUSabaton="off"
  12. STATUSagfafocus="off"
  13. STATUSapple="off"
  14. STATUSartec="off"
  15. STATUSartec_eplus48u="off"
  16. STATUSas6e="off"
  17. STATUSavision="off"
  18. STATUSbh="off"
  19. STATUScanon="off"
  20. STATUScanon630u="off"
  21. STATUScanon_pp="off"
  22. STATUScoolscan="off"
  23. STATUScoolscan2="off"
  24. STATUSepson="off"
  25. STATUSfujitsu="off"
  26. STATUSgt68xx="off"
  27. STATUShp="off"
  28. STATUShpsj5s="off"
  29. STATUSibm="off"
  30. STATUSleo="off"
  31. STATUSma1509="off"
  32. STATUSmatsushita="off"
  33. STATUSmicrotek="off"
  34. STATUSmicrotek2="off"
  35. STATUSmustek="off"
  36. STATUSmustek_pp="off"
  37. STATUSmustek_usb="off"
  38. STATUSnec="off"
  39. STATUSpie="off"
  40. STATUSplustek="off"
  41. STATUSricoh="off"
  42. STATUSs9036="off"
  43. STATUSsceptre="off"
  44. STATUSsharp="off"
  45. STATUSsm3600="off"
  46. STATUSsnapscan="off"
  47. STATUSsp15c="off"
  48. STATUSst400="off"
  49. STATUStamarack="off"
  50. STATUSteco1="off"
  51. STATUSteco2="off"
  52. STATUSteco3="off"
  53. STATUSumax="off"
  54. STATUSumax1220u="off"
  55. STATUSumax_pp="off"
  56. if [ -e /etc/scanner ];then
  57. #/etc/scanner may have a format of drive:device...
  58. CURRENTSCANNER="`cat /etc/scanner | cut -f 1 -d ":"`"
  59. # STATUS$CURRENTSCANNER="on"
  60. case "$CURRENTSCANNER" in
  61. abaton ) STATUSabaton="on" ;;
  62. agfafocus ) STATUSagfafocus="on" ;;
  63. apple ) STATUSapple="on" ;;
  64. artec ) STATUSartec="on" ;;
  65. artec_eplus48u ) STATUSartec_eplus48u="on" ;;
  66. as6e ) STATUSas6e="on" ;;
  67. avision ) STATUSavision="on" ;;
  68. bh ) STATUSbh="on" ;;
  69. canon ) STATUScanon="on" ;;
  70. canon630u ) STATUScanon630u="on" ;;
  71. canon_pp ) STATUScanon_pp="on" ;;
  72. coolscan ) STATUScoolscan="on" ;;
  73. coolscan2 ) STATUScoolscan2="on" ;;
  74. epson ) STATUSepson="on" ;;
  75. fujitsu ) STATUSfujitsu="on" ;;
  76. gt68xx ) STATUSgt68xx="on" ;;
  77. hp ) STATUShp="on" ;;
  78. hpsj5s ) STATUShpsj5s="on" ;;
  79. ibm ) STATUSibm="on" ;;
  80. leo ) STATUSleo="on" ;;
  81. ma1509 ) STATUSma1509="on" ;;
  82. matsushita ) STATUSmatsushita="on" ;;
  83. microtek ) STATUSmicrotek="on" ;;
  84. microtek2 ) STATUSmicrotek2="on" ;;
  85. mustek ) STATUSmustek="on" ;;
  86. mustek_pp ) STATUSmustek_pp="on" ;;
  87. mustek_usb ) STATUSmustek_usb="on" ;;
  88. nec ) STATUSnec="on" ;;
  89. pie ) STATUSpie="on" ;;
  90. plustek ) STATUSplustek="on" ;;
  91. ricoh ) STATUSricoh="on" ;;
  92. s9036 ) STATUSs9036="on" ;;
  93. sceptre ) STATUSsceptre="on" ;;
  94. sharp ) STATUSsharp="on" ;;
  95. sm3600 ) STATUSsm3600="on" ;;
  96. snapscan ) STATUSsnapscan="on" ;;
  97. sp15c ) STATUSsp15c="on" ;;
  98. st400 ) STATUSst400="on" ;;
  99. tamarack ) STATUStamarack="on" ;;
  100. teco1 ) STATUSteco1="on" ;;
  101. teco2 ) STATUSteco2="on" ;;
  102. teco3 ) STATUSteco3="on" ;;
  103. umax ) STATUSumax="on" ;;
  104. umax1220u ) STATUSumax1220u="on" ;;
  105. umax_pp ) STATUSumax_pp="on" ;;
  106. esac
  107. fi
  108. RESULTOK="`Xdialog --wmclass "scannerwizard" --title "Puppy scanner wizard" --stdout \
  109. --radiolist "Read doc window then choose scanner driver..." 28 65 4 \
  110. "abaton" "Abaton" $STATUSabaton \
  111. "agfafocus" "Agfa, Siemens" $STATUSagfafocus \
  112. "apple" "Apple" $STATUSapple \
  113. "artec" "Artec/Ultima, BlackWidow,Plustek" $STATUSartec \
  114. "artec_eplus48u" "Artec/Ultima, Medion(etc),Trust,Memorex,Umax" $STATUSartec_eplus48u \
  115. "as6e" "Artec/Ultima" $STATUSas6e \
  116. "avision" "Avision, HP,Minolta,Mitsubishi,Fujitsu" $STATUSavision \
  117. "bh" "Bell and Howell" $STATUSbh \
  118. "canon" "Canon" $STATUScanon \
  119. "canon630u" "Canon" $STATUScanon630u \
  120. "canon_pp" "Canon" $STATUScanon_pp \
  121. "coolscan" "Nikon" $STATUScoolscan \
  122. "coolscan2" "Nikon" $STATUScoolscan2 \
  123. "epson" "Epson" $STATUSepson \
  124. "fujitsu" "Fujitsu" $STATUSfujitsu \
  125. "gt68xx" "Mustek, Plustek,Artec,Boeder,PkdBell,Medion,Trust,Lexmark,Genius" $STATUSgt68xx \
  126. "hp" "Hewlett Packard, Photosmart/scanner" $STATUShp \
  127. "hpsj5s" "Hewlett Packard" $STATUShpsj5s \
  128. "ibm" "IBM, Ricoh" $STATUSibm \
  129. "leo" "LEO, Across Technologies, Genius" $STATUSleo \
  130. "ma1509" "Mustek" $STATUSma1509 \
  131. "matsushita" "Panasonic" $STATUSmatsushita \
  132. "microtek" "Microtek, Agfa" $STATUSmicrotek \
  133. "microtek2" "Microtek, Vobis,Scanport" $STATUSmicrotek2 \
  134. "mustek" "Mustek, Trust,Primax" $STATUSmustek \
  135. "mustek_pp" "Mustek, Medion(etc),Targa,Trust,Viviscan,Cybercom,Gallery" $STATUSmustek_pp \
  136. "mustek_usb" "Mustek, Trust" $STATUSmustek_usb \
  137. "nec" "NEC" $STATUSnec \
  138. "pie" "PIE, Devcom,Adlib" $STATUSpie \
  139. "plustek" "Plustek, Primax,Genius,Aries,B-Scan,Mustek,HP,Epson,Umax,Compaq,Canon" $STATUSplustek \
  140. "ricoh" "Ricoh" $STATUSricoh \
  141. "s9036" "Siemens" $STATUSs9036 \
  142. "sceptre" "Sceptre, Komodo" $STATUSsceptre \
  143. "sharp" "Sharp" $STATUSsharp \
  144. "sm3600" "Microtek" $STATUSsm3600 \
  145. "snapscan" "Agfa, Benq,Guillemot,Mitsubishi,Epson" $STATUSsnapscan \
  146. "sp15c" "Fijitsu" $STATUSsp15c \
  147. "st400" "Siemens" $STATUSst400 \
  148. "tamarack" "Tamarack" $STATUStamarack \
  149. "teco1" "Relisys, Actown,Dextra" $STATUSteco1 \
  150. "teco2" "Relisys, Primax" $STATUSteco2 \
  151. "teco3" "Relisys, Plustek,Piotech,Trust" $STATUSteco3 \
  152. "umax" "Umax, Linotype Hell,Vobis,Edge,Epson,Escom,Escort,Genius,Nikon" $STATUSumax \
  153. "umax1220u" "Umax" $STATUSumax1220u \
  154. "umax_pp" "Umax" $STATUSumax_pp 2> /dev/null`"
  155. STATUSRET=$?
  156. if [ $STATUSRET -eq 0 ];then
  157. echo -n "$RESULTOK" > /etc/scanner
  158. Xdialog --wmclass "scannerwizard" --title "Puppy scanner wizard" \
  159. --infobox "SCRIPT NOT FINISHED. DOESN'T ACTUALLY DO ANYTHING!" \
  160. 8 50 10000 2> /dev/null
  161. fi