michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
307 stars 49 forks source link

Add support for server configuration files #279

Closed michaelrsweet closed 1 year ago

michaelrsweet commented 1 year ago

Currently printer applications don't offer persistent configuration options for the server, just persistent state. The lprint and hp-printer-app snaps expose configuration settings but that doesn't help non-snapped deployments.

Add support for finding configuration files (and options) in /etc, /usr/local/etc. /Library/Application Support (macOS), $XDG_CONFIG_HOME (Linux), $HOME/Library/Application Support (macOS), $USERPROFILE/AppData/Local (Windows), $SNAP_COMMON (snaps), and $HOME/.config (others). The config filename is "PRINTERAPP.conf" (where "PRINTERAPP" is the base name of the printer application) and the format is basically:

# comment
option=value
option2=value option3=value
option4=value

The order of precedence for options is:

  1. Options set on command-line
  2. Options set in per-user directory
  3. Options set in system/snap directory
michaelrsweet commented 1 year ago

[master 872f8b7] Add support for server configuration files that set default option values (Issue #279)