Reputation: 79
What I need to do, is execute a python program/script in conjunction with user presses print, and not let the print job spool before this program quits.
Reason is that the print driver is not open source, and I need to change user settings (in this case a department id and password), that normally is per/user, but as this is a kiosk(different users with the same account) I need to make sure to reset, and prompt user before print jobs is spooled, so that different users won't pick up each others jobs.
I have created a program to handle the settings, I only need a way to start it, and not let the spool job start before the user has finished the program/settings.
I've tried to search/google this but can't really find an answer, do I need to spool the job through a cups filter first or if their is smarter way to handle this?
Upvotes: 3
Views: 1974
Reputation: 79
I found the perfect solution for my problem. tea4cups, it acts as wrapper for cups. And using a tea4cups prehook solved my issue.
I run into some issues though, so I note them here if someone is coming down the same road.
#! /usr/bin/env python
into:
#! /usr/bin/env python2
prehook_popUp : su $TEAUSERNAME -c "DISPLAY=:0.0 python /usr/share/candepid/PopUp.py"
Upvotes: 3