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 kwargs of menu

opts

default options to be offerred

command

default menu command to run

flag_names

dictionary of {actions: flag_names}

fail

default failure behaviour

Raises
menu(opts=None, command=None, flag_names=None, fail='warn', **kwargs)[source]

Call menu

Return type

Optional[str]

exception launcher_menus.MenuError[source]

<MENU> errors Base.


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.

exception launcher_menus.errors.FlagNameNotFoundError(command, flag)[source]

Flag not found for <menu> in menu-cfgs/<menu>.yml, nor provided via **flags or config_yml.

Parameters
  • command (str) – command that was unsed as <menu>.

  • flag (str) – flag that was not identified from yml file.

exception launcher_menus.errors.MenuError[source]

<MENU> errors Base.

exception launcher_menus.errors.UsageError(args, err)[source]

Usage error described by <menu> command.

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.yml from 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 menu object.

command defaults to the first one found to be installed.

launcher_menus.themes.password_prompt = <launcher_menus.functions.LauncherMenu object>

Password prompt menu.