reworked menu definition in config file to be more elegant and more flexible
This commit is contained in:
@@ -17,41 +17,54 @@ ReportToSyslog=false
|
||||
# run in foreground [default: false; legal: true, false]
|
||||
Foreground=false
|
||||
|
||||
# menu commands for the main menu
|
||||
# format: <text to be displayed>, <command to be executed>
|
||||
MenuCommand="You can say A, echo A"
|
||||
MenuCommand="Or you can say B, echo B"
|
||||
|
||||
# sub menu for the main menu
|
||||
# format: <name to be displayed>, <menu name>
|
||||
SubMenu="A menu, menu1"
|
||||
|
||||
# sub menu commands
|
||||
# option names must start with the name of a defined menu
|
||||
# format: see menu commands
|
||||
menu1_MenuCommand="p, echo P"
|
||||
menu1_MenuCommand="q, echo Q"
|
||||
# display name for the main menu [default: lcdexec HOST]
|
||||
#DisplayName=lcdexec
|
||||
|
||||
|
||||
# main menu definition
|
||||
[MainMenu]
|
||||
# the Entry=... lines (one for each menu entry) tell it is a menu definition
|
||||
Entry=CmdA
|
||||
Entry=CmdB
|
||||
Entry=MenuC
|
||||
|
||||
# definition of a command
|
||||
[CmdA]
|
||||
# name to display in the menu instead of the section name
|
||||
DisplayName="You can say A"
|
||||
# the exec=... line tells that it is a command
|
||||
Exec="echo a"
|
||||
|
||||
[CmdB]
|
||||
DisplayName="Or you can say B"
|
||||
Exec="echo b"
|
||||
|
||||
# definition of a menu
|
||||
# a menu contains an Entry=... line for each menu entry
|
||||
[MenuC]
|
||||
DisplayName="A menu"
|
||||
Entry=CmdP
|
||||
Entry=CmdQ
|
||||
|
||||
[CmdP]
|
||||
DisplayName=P
|
||||
Exec="echo P"
|
||||
|
||||
[CmdQ]
|
||||
DisplayName=Q
|
||||
Exec="echo Q"
|
||||
|
||||
|
||||
# Ideally lcdexec should be re-written so that menu definitions
|
||||
# look somewhat like:
|
||||
#
|
||||
#[Menu]
|
||||
#Type=Menu
|
||||
#Entry=SubMenu1
|
||||
#Entry=SubMenu2
|
||||
#
|
||||
#[SubMenu1]
|
||||
#Type=Action
|
||||
#Exec=/bin/program to execute with parameters
|
||||
#
|
||||
#[SubMenu2]
|
||||
#Type=Action
|
||||
#Exec=/bin/otherprogram with parameters
|
||||
#
|
||||
# Further Extensions:
|
||||
# - shell selectable in command sections
|
||||
# - type definitions instead implicit depending on Exec/Entry
|
||||
# (the latter only as fallback)
|
||||
# - use input for parameters e.g. IP-Adresses, Sliders
|
||||
# - display result if a command on Screen
|
||||
# e.g. Exec="ifconfig ${IF} ${IP} netmask ${MASK} broadcast ${BCAST}"
|
||||
# where
|
||||
# - ${IF} is the result of a selection input screen
|
||||
# - ${IP}, ${MASK}n ${BCAST} are the results of IP input screens
|
||||
# - display result if a command on the display
|
||||
# - jump to other menus depending on the output/result of a command
|
||||
|
||||
# EOF
|
||||
|
||||
Reference in New Issue
Block a user