Common configuration files

From sigrok
Jump to: navigation, search

This page sketches out a design for configuration files that can be read from and written to by libsigrok, and used by various frontends.

  • All applications should take -C argument.
    • If filename, load config from filename.
    • Else load standard config file and use argument as section name.
  • Use default $XDG_CONFIG_HOME/sigrok or ~/.config/sigrok config directory
  • Syntax GKeyFile:
    • [sections]
    • # comments
    • key = value
    • liberal with whitespace,
  • <application>.conf
  • Store fixed settings in [default] section.
    • Put here only by apps that can do something like "save config", "remember settings" -- and only if the user specifically selects such a function.
  • Store last used settings in [last] section.
  • Can store decoder settings.
  • Keys are sr_config_info id string.
  • Example settings:
driver = atten-pps3xxx
conn = /dev/ttyUSB1
ocp = on
output_channel = independent
output_voltage_max[CH1] = 12.00
output_current_max[CH1] = 0.020
output_enabled[CH1] = yes