Repository navigation
Conversation
Co-authored-by: AnPod <AnPod@users.noreply.github.com>
Co-authored-by: AnPod <AnPod@users.noreply.github.com>
e6bff07 to
4c597a1
Compare
chessing234
left a comment
There was a problem hiding this comment.
please fix discovery parsing before adding this setup command.
| # driverless:ipp://EPSON._ipp._tcp.local/ipp/print "Epson ..." "Epson ... IPP Everywhere" "" | ||
| driverless_entries() { | ||
| LC_ALL=C driverless list 2>/dev/null | awk ' | ||
| /^driverless:/ { |
There was a problem hiding this comment.
please parse the actual driverless list format: upstream prints "driverless:ipp://..." en "Epson" "Epson ..., driverless, ..." ..., including quotes around the first field, so ^driverless: matches none of its rows. running this command against that fixture reports no printers and exits 1; please cover a real quoted discovery line and extract the unquoted uri before passing it to lpadmin.
|
| [[ -n $queue ]] || queue=printer | ||
|
|
||
| echo "Adding $queue via IPP Everywhere ($uri)" | ||
| sudo lpadmin -p "$queue" -E -v "$uri" -m everywhere |
There was a problem hiding this comment.
Existing queues can be redirected
If a discovered printer advertises a description that becomes the name of an existing queue, this call changes that queue’s destination instead of creating a new one. A printer on the LAN could thereby receive future jobs intended for the existing queue. The wizard selects a sole discovered printer without prompting; check for a name collision before changing the destination.
How this was verified: The advertised description becomes the queue name, and the selected URI reaches lpadmin -p ... -v without a collision check.
| /^"driverless:/ { | ||
| uri = $2 | ||
| sub(/^driverless:/, "", uri) | ||
| name = $6 |
There was a problem hiding this comment.
Version changes duplicate queues
The discovered description includes the cups-filters version, and this code uses that description as the queue name. After a cups-filters upgrade, running discovery again can create a second permanent queue for the same printer. Use a name that does not depend on versioned display text.
| # driverless list lines look like: | ||
| # "driverless:ipp://EPSON._ipp._tcp.local/ipp/print" en "Epson" "Epson ..., driverless, ..." "" | ||
| driverless_entries() { | ||
| LC_ALL=C driverless list 2>/dev/null | awk -F '"' ' |
There was a problem hiding this comment.
Discovery failures look like empty searches
If driverless list fails, such as when the binary is missing, its error is hidden and the wizard reports that no printers were found. That sends users toward network troubleshooting instead of the local setup failure. Report discovery errors separately from a successful search with no results.
| sudo lpadmin -p "$queue" -E -v "$uri" -m everywhere | ||
| sudo lpadmin -p "$queue" -o printer-error-policy=retry-job |
There was a problem hiding this comment.
|
Thanks for this. One product question, plus a small guard I'd add. Overlap with cups-browsed. Existing-queue guard. if lpstat -p "$queue" >/dev/null 2>&1; then
echo "omarchy-setup-printer: a queue named $queue already exists; remove it first or pick another name" >&2
return 1
fi |
Summary
Fixes #13023
Network printer setup preferred brand/universal filters; IPP Everywhere is the modern default.
Change
omarchy setup printer+ Setup menu + FAQ-m everywhereTest plan
cups-ipp-everywhere-test.sh,cups-hardening-test.sh