[PR #1345] feat(config): dynamic hot reloading #8343

Open
opened 2026-05-23 02:57:19 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/ironbar/pull/1345
Author: @JakeStanger
Created: 1/25/2026
Status: 🔄 Open

Base: masterHead: feat/hot-reload


📝 Commits (1)

  • 3d28aa0 feat(config): dynamic hot reloading

📊 Changes

48 files changed (+862 additions, -188 deletions)

View changed files

📝 docs/Configuration guide.md (+3 -0)
📝 docs/Development guide.md (+1 -1)
📝 src/bar.rs (+151 -60)
📝 src/clients/outputs.rs (+6 -6)
📝 src/config/common.rs (+4 -4)
src/config/diff.rs (+215 -0)
src/config/hot_reload.rs (+287 -0)
📝 src/config/layout.rs (+1 -1)
📝 src/config/marquee.rs (+1 -1)
📝 src/config/mod.rs (+57 -3)
📝 src/config/profiles.rs (+3 -3)
📝 src/config/truncate.rs (+2 -2)
📝 src/dynamic_value/dynamic_bool.rs (+1 -1)
📝 src/ipc/server/bar.rs (+1 -2)
📝 src/ipc/server/style.rs (+2 -1)
📝 src/main.rs (+57 -35)
📝 src/modules/battery.rs (+2 -2)
📝 src/modules/bindmode.rs (+1 -1)
📝 src/modules/bluetooth/config.rs (+7 -7)
📝 src/modules/brightness.rs (+3 -3)

...and 28 more files

📄 Description

At long last, config hot reloading! This introduces a config diffing system that tries to minimise the amount of reloading that needs to take place, according to the following rules:

  • Monitors switching from single <--> multiple bars will perform a full reload of all bars.
  • Bars with non-module configuration changes (ie changing position etc), or a change to the number of modules are fully reloaded.
  • Changes at a module level replace just that module.

This means that you can add, remove and change entire monitor configurations, individual bars, and modules and Ironbar will do its best to minimise the impact.

Hot-reloading does not currently support top-level config options other than bar and monitors. Some of these are likely to never be supported but this still requires exploration.

This also adds a new top-level hot_reload option, which takes two formats:

  • hot_reload: <true/false> - enables/disables for both config and styles.
  • hot_reload.config and hot_reload.style which can be used to toggle each system separately.

The code for this is still a little messy and prototypal, and I'm not sure I've caught every edge case yet, so leaving as draft for now. This does work for the most part though, so publishing for others to test and play with.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/ironbar/pull/1345 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 1/25/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feat/hot-reload` --- ### 📝 Commits (1) - [`3d28aa0`](https://github.com/JakeStanger/ironbar/commit/3d28aa04c9ed3668c20365a502753a30f0a8ee95) feat(config): dynamic hot reloading ### 📊 Changes **48 files changed** (+862 additions, -188 deletions) <details> <summary>View changed files</summary> 📝 `docs/Configuration guide.md` (+3 -0) 📝 `docs/Development guide.md` (+1 -1) 📝 `src/bar.rs` (+151 -60) 📝 `src/clients/outputs.rs` (+6 -6) 📝 `src/config/common.rs` (+4 -4) ➕ `src/config/diff.rs` (+215 -0) ➕ `src/config/hot_reload.rs` (+287 -0) 📝 `src/config/layout.rs` (+1 -1) 📝 `src/config/marquee.rs` (+1 -1) 📝 `src/config/mod.rs` (+57 -3) 📝 `src/config/profiles.rs` (+3 -3) 📝 `src/config/truncate.rs` (+2 -2) 📝 `src/dynamic_value/dynamic_bool.rs` (+1 -1) 📝 `src/ipc/server/bar.rs` (+1 -2) 📝 `src/ipc/server/style.rs` (+2 -1) 📝 `src/main.rs` (+57 -35) 📝 `src/modules/battery.rs` (+2 -2) 📝 `src/modules/bindmode.rs` (+1 -1) 📝 `src/modules/bluetooth/config.rs` (+7 -7) 📝 `src/modules/brightness.rs` (+3 -3) _...and 28 more files_ </details> ### 📄 Description At long last, config hot reloading! This introduces a config diffing system that tries to minimise the amount of reloading that needs to take place, according to the following rules: - Monitors switching from single <--> multiple bars will perform a full reload of all bars. - Bars with non-module configuration changes (ie changing position etc), or a change to the number of modules are fully reloaded. - Changes at a module level replace just that module. This means that you can add, remove and change entire monitor configurations, individual bars, and modules and Ironbar will do its best to minimise the impact. Hot-reloading does not currently support top-level config options other than `bar` and `monitors`. Some of these are likely to never be supported but this still requires exploration. This also adds a new top-level `hot_reload` option, which takes two formats: - `hot_reload: <true/false>` - enables/disables for both config and styles. - `hot_reload.config` and `hot_reload.style` which can be used to toggle each system separately. --- The code for this is still a little messy and prototypal, and I'm not sure I've caught every edge case yet, so leaving as draft for now. This does work for the most part though, so publishing for others to test and play with. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#8343
No description provided.