roberts
Group: Members
Posts: 4983
Joined: Oct. 2003 |
|
Posted: Mar. 26 2008,21:07 |
|
Likely that I used the Apsfilter default printer name of "lp" and yours is not.
/usr/local/bin/printing.lua is a script that I use everyday. If you can print from the command line then you can drag-n-drop text or postscript files to print. I always print to file from each application. Then when I am ready to actually print, I drag the .txt or .ps onto the printing desktop icon.
I suggest to look at the script and look at the second to last line.
Code Sample | #!/bin/lua -- (c) 2007 Robert Shingledecker -- Lua script to support printing via dfm printing icon.
function checkPrintcap() printcap,err = io.popen("ls -s /opt/printcap|awk '{print $1}'") printcapSize = printcap:read("*l") printcap:close() return printcapSize end
if checkPrintcap() == "0" then response = fltk.fl_choice("No printer found!\nSetup Printer Now?","No","Yes",NULL) if response == 1 then os.execute('aterm -T "apsfilter" -e sudo /usr/share/apsfilter/SETUP') if checkPrintcap() == "0" then os.exit(1) else os.execute('touch /tmp/printer.flag') end else os.exit(1) end end
lprTest = io.popen("ps | grep lpd | grep -v 'grep lpd'") lprCheck = lprTest:read("*l") lprTest:close() if lprCheck == nil then print("Starting lpd...") os.execute("sudo /usr/sbin/lpd") end if #arg == 1 then os.execute("lpr -h -Plp "..arg[1]) end
|
Change the os.execute to your specific needs.
|