123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #!/bin/sh
- #Barry Kauler, for Puppy Linux v2.17. LGPL.
- #BK updated for 3.01
- #v3.94 14 dec 2007 BK updated.
- #v3.98 bugfix. w462 small mods.
- #w471 add 'cupsview'.
- #w480 bugfix if still using old cups.
- #w482 general update, now using html help viewer.
- #091126 bugfix if using seamonkey/firefox ui for cups.
- #100410 extra test for SM 2.0.4 on slow PCs. Fix samba printing.
- #100512 fix samba printing, take two. 100706 fix.
- #101221 yaf-splash fix.
- #120201 rodin.s: internationalized.
- #120225 internationalized help file. modified basichtmlviewer.
- #120329 Xdialog bug --yesno supposed to "yes" "No" buttons, but they are "OK" "Cancel".
- #130802 changed default browser.
- #140107 zigbert: gui (gtkdialog) improvements.
- export TEXTDOMAIN=cups_shell
- export TEXTDOMAINDIR=/usr/share/locale
- export OUTPUT_CHARSET=UTF-8
- #USEBROWSER="defaultbrowser"
- USEBROWSER="defaulthtmlviewer" #130802
- [ -f /usr/bin/netsurf-barewindow ] && USEBROWSER="netsurf-barewindow"
- [ -f /usr/local/bin/bareview ] && USEBROWSER="bareview" #from gtkmoz pkg.
- [ -f /usr/local/bin/cupsview ] && USEBROWSER="cupsview" #w471 from gtkmoz pkg.
- #v2.20 warning the defaultbarehtmlviewer must support css.
- #100524 note, this is now done in Woof in 3builddistro...
- #100410 fixes from rcrsn51 for samba printing...
- [ -f /etc/cups/snmp.conf ] && [ "`stat --format=%U%G /etc/cups/snmp.conf | grep 'UNKNOWN'`" != "" ] && chown root:nobody /etc/cups/snmp.conf
- if [ ! -e /usr/lib/cups/backend/smb ];then
- SMBSPOOL="`which smbspool`"
- #100512 seems have to copy smbspool and rename to smb... 100706 no, restore to symlink...
- [ "$SMBSPOOL" ] && ln -snf $SMBSPOOL /usr/lib/cups/backend/smb
- #[ "$SMBSPOOL" ] && cp -a $SMBSPOOL /usr/lib/cups/backend/smb
- fi
- [ -f /etc/opt/samba/smb.conf ] && chmod 755 /etc/opt/samba/smb.conf #need world-readable.
- [ -f /etc/samba/smb.conf ] && chmod 755 /etc/samba/smb.conf #need world-readable.
- export Puppy_Printing='<window title="'$(gettext 'Puppy Printing')'" icon-name="gtk-preferences">
- <vbox space-expand="true" space-fill="true">
- '"`/usr/lib/gtkdialog/xml_info fixed print.svg 60 "<b>$(gettext "Puppy Printing")</b>" "$(gettext "There are 2 main help sources for printing. One locally and one on the Puppy forum. If chosen, these will be shown together with the print-manager in your browser.")" `"'
- <vbox space-expand="true" space-fill="true">
- <frame '$(gettext 'Puppy Printing')'>
- <vbox border-width="10">
- <hbox space-expand="true" space-fill="true">
- <checkbox space-expand="false" space-fill="false">
- <label>"'$(gettext 'Show basic help to add a printer')'"</label>
- <variable>HELP</variable>
- </checkbox>
- <text space-expand="true" space-fill="true"><label>""</label></text>
- '"`/usr/lib/gtkdialog/xml_pixmap help.svg 35`"'
- </hbox>
- <hbox space-expand="true" space-fill="true">
- <checkbox space-expand="false" space-fill="false">
- <label>"'$(gettext 'Show extended online help for installing printers')'"</label>
- <variable>HELP_ONLINE</variable>
- </checkbox>
- <text space-expand="true" space-fill="true"><label>""</label></text>
- '"`/usr/lib/gtkdialog/xml_pixmap help_online.svg 35`"'
- </hbox>
- </vbox>
- <hbox homogeneous="true" border-width="10">
- <button image-position="2" space-expand="false" space-fill="false">
- <label>" '$(gettext 'Manage printers and printing tasks')' "</label>
- '"`/usr/lib/gtkdialog/xml_button-icon print.svg huge`"'
- <action>exit:cups</action>
- </button>
- </hbox>
- </frame>
- </vbox>
- </vbox>
- </window>'
- . /usr/lib/gtkdialog/xml_info gtk #build bg_pixmap for gtk-theme
- eval $(gtkdialog -p Puppy_Printing)
- [ "$(grep -Ei "cancel|abort" <<< "$EXIT")" ] && exit
- if [ $HELP = false ] && [ $HELP_ONLINE = false ] ;then
- #is cupsd running?...
- if [ "`pidof cupsd`" = "" ];then
- /etc/init.d/cups start
- fi
- #exec defaultbarehtmlviewer http://localhost:631/
- exec $USEBROWSER http://localhost:631/
- fi
- #show help sites
- if [ $HELP_ONLINE = true ]; then
- $USEBROWSER "http://www.murga-linux.com/puppy/viewtopic.php?p=444080#444080" &
- sleep 3
- fi
- if [ $HELP = true ] ;then
- if [ -f /usr/share/doc/cups_shell-${LANG%_*}.htm ];then #120225
- $USEBROWSER file:///usr/share/doc/cups_shell-${LANG%_*}.htm &
- else
- $USEBROWSER file:///usr/share/doc/cups_shell.htm &
- fi
- fi
- #killall cupsd
- /etc/init.d/cups stop
- #note, /us/share/ppd may not be needed anymore...
- mkdir -p /usr/share/cups/model/gutenprint/5.0 #old gutenprint pkg.
- mkdir -p /usr/share/ppd/gutenprint/5.0 #old gutenprint pkg.
- mkdir -p /usr/share/cups/model/gutenprint/5.2
- mkdir -p /usr/share/ppd/gutenprint/5.2
- #w480, need to run cups-genppd if old cups...
- CUPSVERSION=""
- [ "`which cups-config`" != "" ] && CUPSVERSION="`cups-config --version`"
- if [ "$CUPSVERSION" = "1.1.23" ];then
- /usr/lib/gtkdialog/box_splash -close never -placement top -text "`gettext \"Please wait, composing Gutenprint '.ppd' driver files...\"`" &
- X1PID=$!
- [ "`which cups-genppd.5.0`" != "" ] && cups-genppd.5.0
- [ "`which cups-genppd.5.2`" != "" ] && cups-genppd.5.2
- kill $X1PID
- fi
- sync
- #/usr/sbin/cupsd
- /etc/init.d/cups start
- sleep 4 #091126 increase.
- #defaultbarehtmlviewer http://localhost:631/
- $USEBROWSER http://localhost:631/ 2>/tmp/cups-shell-ui-fail
- #091126 seamonkey/ff already started above, for help page, but slow to startup... 100410 extra test...
- CNT=0
- while [ "`grep -E "Failed to send command|No running window found" /tmp/cups-shell-ui-fail`" ];do
- sleep 4
- $USEBROWSER http://localhost:631/ 2>/tmp/cups-shell-ui-fail
- CNT=`expr $CNT + 1`
- [ $CNT -gt 7 ] && break
- done
- #rm -rf /usr/share/cups/model/gutenprint/5.0/C
- if [ "$CUPSVERSION" = "1.1.23" ];then #w480
- rm -rf /usr/share/cups/model/gutenprint/5.0/* 2>/dev/null #old gutenprint pkg.
- rm -rf /usr/share/ppd/gutenprint/5.0/* 2>/dev/null #old gutenprint pkg.
- rm -rf /usr/share/cups/model/gutenprint/5.2/* 2>/dev/null
- rm -rf /usr/share/ppd/gutenprint/5.2/* 2>/dev/null
- fi
- ###END###
|