SOURCE CODE DOC¶
Entry Point¶
Package import¶
launcher_menus¶
Python API for Launcher menus
-
class
launcher_menus.LauncherMenu(opts=None, command=None, flag_names=None, fail='warn', **kwargs)[source]¶ Launcher Menu wrapper object with pre-defined menu options.
- Parameters
opts (
Optional[List[str]]) – list: options to be offerred by menu.command (
Optional[str]) – command to use {dmenu,bemenu,<custom>}flag_names (
Union[PathLike,dict,None]) – dict providing action: flags or path to cognate yaml.fail (
str) – ‘warn’: warn, ‘fail’: error, ‘guess’: try creating, else warn**kwargs – default values for
kwargsofmenu
-
opts¶ default options to be offerred
-
command¶ default menu command to run
-
flag_names¶ dictionary of {actions: flag_names}
-
fail¶ default failure behaviour
- Raises
TypeError –
menu() call¶
-
launcher_menus.LauncherMenu.__call__(self, opts=None, command=None, flag_names=None, fail='warn', **kwargs)¶ Call <command> menu to collect interactive information.
- Parameters
opts (
Optional[List[str]]) – list: options to be offerred by menu.command (
Optional[str]) – command to use {dmenu,bemenu,<custom>}flag_names (
Union[PathLike,dict,None]) – dict providing action: flags or path to cognate yaml.fail (
str) – ‘warn’: warn, ‘fail’: error, ‘guess’: try creating, else warnkwargs –
flag to be called at command line:
bottom =
bool: show bar at bottomgrab =
bool: show menu before reading stdin (faster)ignorecase =
bool: match items ignoring casewrap =
bool: wrap cursor selectionifne =
bool: display only if optsnooverlap =
bool: do not overlap panelslines =
int: list opts on vertical ‘lines’monitor =
int: show menu on (bemenu w/ wayland: -1: all)height =
int: height of each menu lineindex =
int: select index automaticallyprompt =
str: prompt string of menuprefix =
str: prefix added highlighted itemscrollbar =
str: display scrollbar {none,always,autohide}font =
str: font to be used format: “FONT-NAME [SIZE ]”title_background =
str: title background colortitle_foreground =
str: title foreground colornormal_background =
str: normal background colornormal_foreground =
str: normal foreground colorfilter_background =
str: filter background colorfilter_foreground =
str: filter foreground colorhigh_background =
str: highlight background colorhigh_foreground =
str: highlight foreground colorscroll_background =
str: scrollbar background colorscroll_foreground =
str: scrollbar foreground colorselected_background =
str: selected background colorselected_foreground =
str: selected foreground colorwindowid =
str: embed into windowid
- Raises
ValueError – bad scrollbar options
- Return type
Optional[str]- Returns
User’s selected opt from
optsor overridden-entered choice elseNone[Esc]
Errors¶
Error/Warnings¶
Menu errors
-
exception
launcher_menus.errors.CommandError(args, err)[source]¶ <MENU> command failed.
- Parameters
args (
list) – args called with <menu> command.err (
str) – error raised by <menu> command.
Structure¶
Themes¶
Launcher Menu Themes
-
launcher_menus.themes.custom_themes(custom_config=None)[source]¶ Read configuration file
themes.ymlfrom standard configuration locations and generate custom themes- Return type
Dict[str,LauncherMenu]
-
launcher_menus.themes.emergency_prompt= <launcher_menus.functions.LauncherMenu object>¶ Emergency prompt menu
-
launcher_menus.themes.menu= <launcher_menus.functions.LauncherMenu object>¶ Plain
menuobject.commanddefaults to the first one found to be installed.
-
launcher_menus.themes.password_prompt= <launcher_menus.functions.LauncherMenu object>¶ Password prompt menu.