D.A.B.Tv0.0.17 Tutorial API DABT Tools ↗ GitHub ↗

tui.config.get

tui.config.get KEY [DEFAULT]

Prints the saved value of a setting.

Parameters

  • KEY: setting name, e.g. theme or my.option.
  • DEFAULT: printed when KEY is not stored. Default: empty.

Output: the value, without a trailing newline.

Notes

  • A key stored with an empty value prints the empty value, not DEFAULT.
  • Reads the in-memory store. The file is read once when the library is sourced; call tui.config.load to pick up outside edits.

Example

if [[ "$(tui.config.get my.autosave 1)" == 1 ]]; then save_now; fi

See also: tui.config.set, tui.config.keys