I am setting up an unattended, automated printing setting. At some point the printer might run out of paper, ink, or experience some other error. I have a Canon iP4500 which on macOS communicates these kinds of errors back to the user interface. With Ubuntu/Lubuntu I have not seen such an interface.
Is there any way to get the (last) CUPS error programmatically?
I've tried
lpstat -p
(which will say something like "Printing page 1, 36%" when there is no paper)lpc status
lpq
(which says "iP4500-series is ready and printing")- and dug around http://localhost:631/printers/Canon-iP4500-series, i.e. the CUPS web interface
I really don't care how "programmatically" is implemented, i.e. Python, Bash, parsing the CUPS web interface -- anything really. It just needs to be automated.