First-party Wayle WASM plugin that shows pending system updates in the bar and a grouped dropdown for package details.
- Polls package manager output and counts pending updates.
- Displays the pending count in a Wayle bar module.
- Renders a dropdown grouped by source:
pacmanupdates (viacheckupdates)AURupdates (viayay -Qua)
- Lets you collapse or expand each group directly from the dropdown header rows.
- Supports manual refresh with middle click.
- Detection order:
checkupdatesyay
- If both are available, both groups are shown.
- If only one exists, only that source is shown.
- If neither exists, refresh returns an error:
no supported package manager found (checkupdates, yay)
- Default limits and display:
max_items = 20(override withplugin-config.max-items)- dropdown title =
System updates - title alignment = centered (
0.5) - dropdown max-height style =
50%
- Rust toolchain
wasm32-unknown-unknowntarget- At least one package source command available on host:
checkupdates- or
yay
rustup target add wasm32-unknown-unknown
cargo build --release --target wasm32-unknown-unknownArtifact:
target/wasm32-unknown-unknown/release/wayle_plugin_update.wasm
Example deploy command:
cp target/wasm32-unknown-unknown/release/wayle_plugin_update.wasm \
~/.local/share/wayle/plugins/wayle_plugin_update.wasmAdd a plugin definition in ~/.config/wayle/config.toml and add the module id to bar layout.
[[modules.plugins]]
id = "system-updates"
kind = "wasm"
wasm-path = "/home/you/.local/share/wayle/plugins/wayle_plugin_update.wasm"
# Required for host::run_command calls used by this plugin.
capabilities = ["command.exec"]
# Commands executed by this plugin. Use these as a restrictive allowlist.
command-exec-allowed-prefixes = [
"command -v",
"checkupdates",
"yay -Qua",
]
# Plugin-specific config passed to plugin_init.
plugin-config = { max-items = 40, dropdown-height-percent = 65 }
icon-name = "tb-refresh-dot-symbolic"
interval-ms = 600000
left-click = "dropdown:plugin-system-updates"
middle-click = ""
[[bar.layout]]
monitor = "*"
right = ["plugin-system-updates", "clock"]- Runtime policy precedence for this plugin is:
- use
capabilitiesandcommand-exec-allowed-prefixesfrom user config when non-empty - otherwise fallback to values declared by plugin
manifest()
- use
command.execis required because the plugin executes host commands for detection and update listing.- The three prefixes shown cover every command this plugin runs: existence checks (
command -v), pacman update list (checkupdates), and AUR update list (yay -Qua). - If both config and manifest prefix lists are empty, command execution is blocked.
If you want strict policy control, set both fields explicitly in user config. This overrides manifest fallback.
[[modules.plugins]]
id = "system-updates"
kind = "wasm"
wasm-path = "/home/you/.local/share/wayle/plugins/wayle_plugin_update.wasm"
capabilities = ["command.exec"]
command-exec-allowed-prefixes = [
"checkupdates",
"yay -Qua",
"command -v",
]You can tighten this list further, but removing required prefixes will disable corresponding update sources.
Currently supported keys in plugin-config:
max-items(integer): maximum number of package rows shown before the+N more packagesindicator is shown.dropdown-height-percent(integer): dropdown max height as a percentage of monitor height.
Behavior:
- default:
20 0means unlimited (show all rows)- other values are clamped to
1..500
dropdown-height-percent behavior:
- default:
50 - valid range:
1..100(values are clamped)
- Left click: open dropdown (if mapped in config to
dropdown:plugin-system-updates). - Middle click: trigger immediate refresh.
- Dropdown section headers (
System,AUR): toggle collapsed/expanded state.
- Empty label row with no description/action is used as separator.
- Row with label and no description is rendered as section header.
- Row with label + description is rendered as package entry.
Plugin-owned styling files:
styles/system-updates.scssbuild.rscompiles SCSS to CSS at build time.
The plugin injects classes via payload style metadata:
system-updates-pluginon bar module rootsystem-updates-dropdownon dropdown container
To restyle:
- Edit
styles/system-updates.scss. - Rebuild plugin.
- Redeploy wasm file.
From repository root:
cargo fmt --all
cargo clippy --all-targets --all-features
cargo test
cargo build --release --target wasm32-unknown-unknown- Verify
checkupdatesoryayis installed and available in PATH. - Verify
command.execcapability is enabled. - If using
command-exec-allowed-prefixes, verify required commands are permitted.
- Check Wayle logs for plugin runtime errors.
- Confirm wasm path points to the latest built artifact.
- Rebuild and redeploy after changing style or code.
- Unit tests should not depend on live host command execution.
- Seed test state (cached sources) when testing row-action toggle behavior.
src/lib.rs: plugin logic, payload building, actions, parsing, tests.styles/system-updates.scss: plugin dropdown and bar styling.build.rs: SCSS compilation into embedded CSS.