bread/examples/modules
Breadway d270ac6ff7 Namespace Hyprland events under bread.hyprland.*, keep legacy names via [compat]
normalize_hyprland() dual-emits each of its 10 flat event names
(bread.workspace.changed, bread.monitor.connected, bread.window.opened,
etc.) alongside a bread.hyprland.<rest> equivalent, so portable automation
can subscribe to bread.hyprland.* and be guaranteed compositor-specific
coverage without also matching genuinely cross-backend events like
bread.power.*. The bread.hyprland.event fallback was already namespaced
and is unaffected.

Gated behind [compat] legacy_hyprland_event_names (default true during
the deprecation window) so the old names keep firing until modules
migrate; set to false to emit only the namespaced names.
EventNormalizer::with_legacy_hyprland_event_names(bool) is a builder on
top of the existing ::new(dedup_window_ms), threaded through from config
in main.rs.

Bumps API_VERSION to 1.5.0 (additive), updates Documentation.md's
Hyprland event reference with Deprecated/Since markers and the new
[compat] option, refreshes the README config example and the
dock-workflow/git-branch-widget examples to the namespaced names, and
adds DEPRECATIONS.md tracking the deferred full removal once the window
closes.
2026-08-04 22:08:44 +08:00
..
active-window-widget.lua Will change this commit message to mean something later 2026-07-22 19:52:16 +08:00
bluetooth-toggle-widget.lua Will change this commit message to mean something later 2026-07-22 19:52:16 +08:00
cpu-temp-widget.lua Will change this commit message to mean something later 2026-07-22 19:52:16 +08:00
dock-monitors.lua Add ready-to-use example modules 2026-06-16 17:06:44 +08:00
dock-workflow.lua Namespace Hyprland events under bread.hyprland.*, keep legacy names via [compat] 2026-08-04 22:08:44 +08:00
focus-mode-widget.lua Will change this commit message to mean something later 2026-07-22 19:52:16 +08:00
git-branch-widget.lua Namespace Hyprland events under bread.hyprland.*, keep legacy names via [compat] 2026-08-04 22:08:44 +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 Will change this commit message to mean something later 2026-07-23 11:16:33 +08:00
workflow-status-widget.lua Will change this commit message to mean something later 2026-07-22 19:52:16 +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
active-window-widget.lua Shows the focused window next to the workspace pills in breadbar, via bread.widget + bread.state.watch. none
cpu-temp-widget.lua Live CPU temperature readout in breadbar's stats area, via bread.widget + bread.fs.read on a timer. edit TEMP_PATH for your hwmon layout
bluetooth-toggle-widget.lua One-click Bluetooth power toggle in breadbar's tray, via bread.widget + a click handler. none
focus-mode-widget.lua Click-to-toggle "Focus" profile that mutes audio; a widget as an action launcher, not just a readout, and stays in sync with profile changes triggered elsewhere. none (needs wpctl)
workflow-status-widget.lua Surfaces bread.workflow.list() in breadbar's tray — shows whichever workflow (e.g. dock-workflow.lua, below) is currently running or failed, hidden otherwise. none
git-branch-widget.lua Shows the repo + branch of whichever git repo the focused kitty tab is sitting in; yellow when dirty. Entirely self-contained in Lua — no adapter behind it. kitty remote control (see the module's header comment)

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.