Add ready-to-use example modules
examples/modules/ ships complete, drop-in bread modules for common desktop automations (low-battery warning, pause-media-on-headphone-unplug, dock-monitors) plus a README on installing them. Complements Examples.md, which teaches the porting patterns. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
13f54ad4ca
commit
c47d50d16e
4 changed files with 108 additions and 0 deletions
28
examples/modules/README.md
Normal file
28
examples/modules/README.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Example bread modules
|
||||
|
||||
Ready-to-use modules for common desktop automations. Unlike the snippets in
|
||||
[`../../Examples.md`](../../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:
|
||||
|
||||
```sh
|
||||
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`](../../Documentation.md) for the full
|
||||
event list and Lua API.
|
||||
Loading…
Add table
Add a link
Reference in a new issue