I am running Arch-linux and Openbox. Arch-linux has been fully updated today.

I can power on and off my printer, a HP LaserJet 2200, using a shell script & keyboard shortcuts associated with the script.

I need to intercept any system command to print to this print queue and use it to trigger the shell script to turn the printer on, automatically.

How can I detect any print job sent to a specific print queue and then run the shell script at this time? (I have 2 or three printers so it has to be able to detect the specific print queue to turn on the right printer)

  • I suppose I could run a cron job to look at the print queue every 30 secs or so but that seems inelegant. – Kes Feb 20 '19 at 12:16
  • or I could recompile one of the core print packages to also run my script but I don't know which one, or much about C which it may well be written in – Kes Feb 21 '19 at 12:16
  • I can now also get the printer status off the HP LaserJet printer JetDirect network card using SNMP v2 and the snmpwalk command. When I'm able to trigger a script when something arrives in the print queue I'm going to be able to turn the printer on automatically and then query the printer until it is idle to turn the printer off once the job is complete. Still can't figure out how to trigger the script though – Kes Feb 22 '19 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.