Skip to content
daniel edited this page Jun 25, 2021 · 6 revisions

/bootstrap-plugins/ask - ask for input

Config parameters

Name Description Default Value
RPI_ASK_METHOD the asking method (One of: read, dialog, zenity)
RPI_ASK_QUESTIONn question number n (starting from 0)
RPI_ASK_DEFAULTn preset answer to question n
RPI_ASK_VARIABLEn name of variable to store answer to question n
RPI_ASK_ARGUMENTSn method specific arguments to pass to method (s. manual of specific method for possible arguments)

Distfiles

none

Examples

RPI_BOOTSTRAP_PLUGINS+=("ask") to append the plugin or RPI_BOOTSTRAP_PLUGINS=( ... "ask" ... ) to place at some position in the current list.

ask user for current mood and store answer in RPI_MOOD variable, default answer is preset

RPI_ASK_QUESTION0="How are you?"
RPI_ASK_VARIABLE0="RPI_MOOD"
RPI_ASK_DEFAULT0="I'm fine!"

ask user for mood but use dialog (TUI) instead of read (CLI)

RPI_ASK_QUESTION0="How are you?"
RPI_ASK_VARIABLE0="RPI_MOOD"
RPI_ASK_METHOD="dialog"

ask user for mood and pass custom parameters to zenity

RPI_ASK_QUESTION0="How are you?"
RPI_ASK_VARIABLE0="RPI_MOOD"
RPI_ASK_ARGUMENTS0="--entry,--entry-text=totally\ fine,--title=the\ big\ questions..."

Tests

TODO

Clone this wiki locally