xsaneshell 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/sh
  2. #8.06.11 rodin.s: i18n
  3. export TEXTDOMAIN=xsaneshell #usr_sbin2
  4. export TEXTDOMAINDIR=/usr/share/locale
  5. export OUTPUT_CHARSET=UTF-8
  6. COMMOUT="`cat /etc/sane.d/dll.conf | grep '^#[a-zA-Z0-9]' | tr '#' ' ' | tr '\n' ' '`"
  7. export Xsane='
  8. <window title="'$(gettext 'Frontend for Xsane')'" icon-name="gtk-preferences">
  9. <vbox space-expand="true" space-fill="true">
  10. <frame>
  11. <vbox space-expand="true" space-fill="true">
  12. '"`/usr/lib/gtkdialog/xml_info scale scanner.svg 60 "$(gettext "<b>When Xsane starts, your scanner (if it is connected and turned on) should be autodetected.</b>")" "$(gettext "However, some entries in the drivers list (/etc/sane.d/dll.conf) are commented-out. These are:")" "<i>$COMMOUT</i>" "$(gettext "If your scanner is one of these, then Xsane will not auto-detect it. - in that case, click 'Quit' button and open 'dll.conf' in a text editor and uncomment the appropriate entry.")"`"'
  13. <text height-request="5" space-expand="false" space-fill="false"><label>""</label></text>
  14. <expander>
  15. <vbox border-width="10">
  16. <text xalign="0" use-markup="true"><label>"'$(gettext "Xsane may be a bit 'insane' when detecting a SCSI scanner. There are various things that you may have to do:
  17. 1. Run 'sane-find-scanner' in a terminal window.
  18. 2. Make sure 'sg' module is loaded.
  19. 3. Specify the device on the commandline,
  20. ex: <b># xsane microtek2:/dev/sg3</b>
  21. 4. or maybe a symbolic link,
  22. ex: <b># ln -s /dev/sg3 /dev/scanner</b>")'"</label></text>
  23. <hseparator></hseparator>
  24. </vbox>
  25. <label>'$(gettext 'About SCSI drives')'</label>
  26. </expander>
  27. <text xalign="1" use-markup="true" wrap="false"><label>"'$(gettext "To continue and run Xsane, please choose the scanner type.")'"</label></text>
  28. </vbox>
  29. <hbox space-expand="false" space-fill="false">
  30. <button image-position="2">
  31. '"`/usr/lib/gtkdialog/xml_button-icon plug_usb.svg huge`"'
  32. <label>USB</label>
  33. <action>EXIT:10</action>
  34. </button>
  35. <button image-position="2">
  36. '"`/usr/lib/gtkdialog/xml_button-icon plug_parallel.svg huge`"'
  37. <label>"'$(gettext 'Parallel')'"</label>
  38. <action>EXIT:11</action>
  39. </button>
  40. <button image-position="2">
  41. '"`/usr/lib/gtkdialog/xml_button-icon plug_scsi.svg huge`"'
  42. <label>SCSI</label>
  43. <action>EXIT:12</action>
  44. </button>
  45. </hbox>
  46. </frame>
  47. <hbox space-expand="false" space-fill="false">
  48. <button>
  49. '"`/usr/lib/gtkdialog/xml_button-icon quit`"'
  50. <label>"'$(gettext 'Quit')'"</label>
  51. </button>
  52. </hbox>
  53. </vbox>
  54. </window>'
  55. . /usr/lib/gtkdialog/xml_info gtk #build bg_pixmap for gtk-theme
  56. RETVAL="`gtkdialog -p Xsane`"
  57. eval "$RETVAL"
  58. case $RETVAL in
  59. *10*)
  60. #modprobe scanner
  61. #2.6 kernel does not have module 'scanner'. instead relies on libusb.
  62. echo
  63. ;;
  64. *11*)
  65. modprobe parport_pc
  66. ;;
  67. *12*)
  68. modprobe sg
  69. ;;
  70. *)
  71. exit
  72. ;;
  73. esac
  74. sleep 1
  75. exec xsane