Hello !
I have a script that helps me to reconfigure printers and sets them by default depending of their location, department, etc...
The problem is that I can't set the ~/.cups/lpoptions by using lpoptions -d default_printer. To run the command, I use a function that I found and that executes it as the logged user.
Hide contentShow content
If I execute the command as test:
launchctl asuser 502 sudo -u myuser /usr/bin/lpoptions -d default_printer, it does nothing. The lpoptions file is not populated. Even if I run the command line locally, it doesn't work. It only works if I run the script or the command line as the specific local user.
Any help is welcome !