UWSM-PLUGINS(3)
π NAME π
UWSM-plugins β Plugins for Universal Wayland Session Manager. This is the UWSM-PLUGINS(3) page from the Library Functions Manual, and bestie, weβre about to make plugins make sense. π¦
β¨ DESCRIPTION β¨
Okay so shell plugins are the little helpers that provide compositor-specific functions during environment preparation. Theyβre located in ${PREFIX}/share/uwsm/plugins/ and named ${__WM_BIN_ID__}.sh, and they should only contain specifically named functions β like, the guest list is strict, no random functions crashing the party. π
${__WM_BIN_ID__} is derived from item 0 of compositor command line by applying s/(^[^a-zA-Z]|[^a-zA-Z0-9_])+/_/ and converting to lower case.
Itβs used as plugin id and suffix in function names. Periodt. π
π Variables available to plugins π
__WM_ID__β compositor ID, effective first argument ofstart.__WM_ID_UNIT_STRING__β compositor ID escaped for systemd unit name.__WM_BIN_ID__β processed first item of compositor argv.__WM_DESKTOP_NAMES__β:-separateddesktop names fromDesktopNames=of entry and-DCLI argument.__WM_FIRST_DESKTOP_NAME__β first of the above.__WM_DESKTOP_NAMES_LOWERCASE__β same as__WM_DESKTOP_NAMES__, but in lower case.__WM_FIRST_DESKTOP_NAME_LOWERCASE__β first of the above.__WM_DESKTOP_NAMES_EXCLUSIVE__β(true|false)indicates that__WM_DESKTOP_NAMES__came from CLI argument and are marked as exclusive.__OIFS__β contains shell default field separator (space, tab, newline) for convenient restoring.
πΈ Standard functions πΈ
load_wm_envβ standard function for loading env files.process_config_dirsβ iterates over XDG Config hierarchy and system part of XDG Data hierarchy (decreasing priority).process_config_dirs_reversedβ (called byload_wm_env), same asprocess_config_dirsbut in reverse (increasing priority).in_each_config_dir_reversedβ called byprocess_config_dirs_reversedfor each config dir as$1, loadsuwsm/env,uwsm/env.d/*,uwsm/env-${desktop},uwsm/env-${desktop}.d/*files.in_each_config_dirβ called byprocess_config_dirsfor each config dir as$1, does nothing ATM.source_fileβ sources$1file if exists, providing messages for log.
See code inside uwsm/main.py for more auxiliary functions.
π§ Functions that can be added by plugins π§
quirks__${__WM_BIN_ID__}β called before env loading.
These functions will be called instead of standard functions 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"
}
Okay thatβs the whole page, bestie β footer energy is 2026-10-15 and UWSM-PLUGINS(3) from the Library Functions Manual. Now go make a plugin and slay π
β¨π«Ά
π¦ where this page comes from
- arch rolling: uwsm 0.27.1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms