UWSM-PLUGINS(3) | Library Functions Manual | UWSM-PLUGINS(3) |
NAME
UWSM-plugins - Plugins for Universal Wayland Session Manager.
DESCRIPTION
Shell plugins provide compositor-specific functions during environment preparation.
Located in ${PREFIX}/share/uwsm/plugins/ and named ${__WM_BIN_ID__}.sh, they should only contain specifically named functions.
${__WM_BIN_ID__} is derived from the item 0 of compositor command line by applying s/(^[^a-zA-Z]|[^a-zA-Z0-9_])+/_/ and converting to lower case.
It is used as plugin id and suffix in function names.
Variables available to plugins
__WM_ID__
Standard functions
load_wm_env
See code inside uwsm/main.py for more auxillary funcions.
Functions that can be added by plugins
quirks__${__WM_BIN_ID__}
called before env loading.
These functions will be called instead of standard funcions if defined:
load_wm_env__${__WM_BIN_ID__}
process_config_dirs_reversed__${__WM_BIN_ID__}
in_each_config_dir_reversed__${__WM_BIN_ID__}
process_config_dirs__${__WM_BIN_ID__}
in_each_config_dir__${__WM_BIN_ID__}
Original functions are still available for calling explicitly if combined effect is needed.
Example:
#!/bin/false # function to make arbitrary actions before loading environment quirks__my_cool_wm() { # here additional vars can be set or unset export I_WANT_THIS_IN_SESSION=yes unset I_DO_NOT_WANT_THAT # or prepare a config for compositor # or set a var to modify what sourcing uwsm/env, uwsm/env-${__WM_ID__} # in the next stage will do ... } in_each_config_dir_reversed__my_cool_wm() { # custom mechanism for loading of env files (or a stub) # replaces standard function, but we want it also # so call it explicitly in_each_config_dir_reversed "$1" # and additionally source our file source_file "${1}/${__WM_ID__}/env" }
2025-01-30 |