bread/examples/modules
2026-07-19 03:05:57 +08:00
..
dock-monitors.lua Add ready-to-use example modules 2026-06-16 17:06:44 +08:00
dock-workflow.lua Add filesystem/git/podman/systemd adapters, git/shell hooks, bread-emit CLI, app-detection helpers 2026-07-19 03:05:57 +08:00
low-battery-warning.lua Add ready-to-use example modules 2026-06-16 17:06:44 +08:00
pause-media-on-headphone-unplug.lua Add ready-to-use example modules 2026-06-16 17:06:44 +08:00
README.md Add ready-to-use example modules 2026-06-16 17:06:44 +08:00

Example bread modules

Ready-to-use modules for common desktop automations. Unlike the snippets in ../../Examples.md (which teach the porting patterns), these are complete files you can drop in as-is.

Installing

Modules in ~/.config/bread/modules/ are auto-discovered — copy a file in and reload; no init.lua edit needed:

cp low-battery-warning.lua ~/.config/bread/modules/
bread reload

Modules

File What it does Config needed
low-battery-warning.lua Critical notification once when the battery runs low; resets on AC. none
pause-media-on-headphone-unplug.lua Runs playerctl pause when a headphone/earbud device disconnects. none (needs playerctl)
dock-monitors.lua Applies a multi-monitor layout when an external display connects, reverts when removed. edit output names/resolutions

Each module is the standard skeleton — bread.module{...}, an on_load that registers subscriptions, return M — so they double as references for writing your own. See ../../Documentation.md for the full event list and Lua API.