Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
50dd5fc
Add HyDEbar prompt documentation and version bump
RAprogramm Sep 25, 2025
57d84be
Merge pull request #7 from RAprogramm/eye-of-ra/add-module-with-speci…
RAprogramm Sep 25, 2025
0ca9f42
upgrade versions
RAprogramm Sep 25, 2025
3b44daf
fix: run
RAprogramm Sep 25, 2025
23d1844
style: reformat iced task batching
RAprogramm Sep 26, 2025
9603f7a
Merge pull request #8 from RAprogramm/eye-of-ra/implement-hydebar-mod…
RAprogramm Sep 26, 2025
71a24cf
Handle config watcher restart on stream close
RAprogramm Sep 26, 2025
d3d5a12
Merge pull request #9 from RAprogramm/eye-of-ra/refactor-subscription…
RAprogramm Sep 26, 2025
b0b6933
hide workflows
RAprogramm Sep 26, 2025
04b9f75
Bump sysinfo from 0.36.1 to 0.37.0
dependabot[bot] Sep 26, 2025
d01be27
Bump serde from 1.0.226 to 1.0.227
dependabot[bot] Sep 26, 2025
22b983c
Bump regex from 1.11.2 to 1.11.3
dependabot[bot] Sep 26, 2025
8753ad7
Bump pipewire from 0.8.0 to 0.9.2
dependabot[bot] Sep 26, 2025
14905c5
Refine brightness error handling
RAprogramm Sep 26, 2025
9aa42f4
Merge pull request #14 from RAprogramm/eye-of-ra/add-brightnesserror-…
RAprogramm Sep 26, 2025
6d52747
refactor: add idle inhibitor error handling
RAprogramm Sep 26, 2025
9a9ca19
Merge pull request #15 from RAprogramm/eye-of-ra/implement-idleinhibi…
RAprogramm Sep 26, 2025
d898315
Refine privacy service error handling
RAprogramm Sep 26, 2025
103b500
Merge pull request #16 from RAprogramm/eye-of-ra/introduce-privacyerr…
RAprogramm Sep 26, 2025
955589f
Merge pull request #13 from RAprogramm/dependabot/cargo/pipewire-0.9.2
RAprogramm Sep 26, 2025
a8fc2a3
Merge pull request #12 from RAprogramm/dependabot/cargo/regex-1.11.3
RAprogramm Sep 26, 2025
c640900
Merge pull request #11 from RAprogramm/dependabot/cargo/serde-1.0.227
RAprogramm Sep 26, 2025
274cca5
Merge pull request #10 from RAprogramm/dependabot/cargo/sysinfo-0.37.0
RAprogramm Sep 26, 2025
8de3258
Refactor launcher command handling
RAprogramm Sep 26, 2025
4cbdab5
Merge pull request #17 from RAprogramm/eye-of-ra/refactor-command-exe…
RAprogramm Sep 26, 2025
52a7723
Improve custom module error handling
RAprogramm Sep 26, 2025
d042b69
Merge pull request #18 from RAprogramm/eye-of-ra/refactor-custom_modu…
RAprogramm Sep 26, 2025
62d4391
Refine network backend error handling
RAprogramm Sep 26, 2025
e25e94e
Merge pull request #19 from RAprogramm/eye-of-ra/implement-caching-in…
RAprogramm Sep 26, 2025
706e84b
up deps
RAprogramm Sep 26, 2025
ebc02df
refactor: flatten modules and migrate errors
RAprogramm Sep 26, 2025
1f465c9
Fix network and privacy services for latest dependencies
RAprogramm Sep 26, 2025
f6f2dc7
Merge pull request #20 from RAprogramm/eye-of-ra/refactor-mod.rs-to-n…
RAprogramm Sep 26, 2025
f957d6f
Merge branch 'main' into eye-of-ra/fix-undeclared-lifetime-and-try-tr…
RAprogramm Sep 26, 2025
e66021b
Merge pull request #21 from RAprogramm/eye-of-ra/fix-undeclared-lifet…
RAprogramm Sep 26, 2025
38f9bd5
refactor: split project into workspace crates
RAprogramm Sep 26, 2025
71c179f
Merge pull request #22 from RAprogramm/eye-of-ra/update-workspace-str…
RAprogramm Sep 26, 2025
b882489
many errors
RAprogramm Sep 26, 2025
4856dcf
Introduce Hyprland port abstraction and client
RAprogramm Sep 26, 2025
5c6b01f
Merge pull request #23 from RAprogramm/eye-of-ra/define-hyprlandport-…
RAprogramm Sep 26, 2025
90c8b28
Handle runtime errors without panics
RAprogramm Sep 26, 2025
7f10025
Merge pull request #24 from RAprogramm/eye-of-ra/refactor-error-handl…
RAprogramm Sep 26, 2025
f64465f
Refine config watch event filtering
RAprogramm Sep 26, 2025
5edb0c9
Merge pull request #25 from RAprogramm/eye-of-ra/implement-config-err…
RAprogramm Sep 26, 2025
4ef7b6f
Add event bus with coalescing queue
RAprogramm Sep 26, 2025
ee09a5f
Update docs for hydebar workspace naming
RAprogramm Sep 26, 2025
6f3ed8a
Merge pull request #26 from RAprogramm/eye-of-ra/implement-event-bus-…
RAprogramm Sep 26, 2025
a6283e6
Merge pull request #27 from RAprogramm/eye-of-ra/update-documentation…
RAprogramm Sep 26, 2025
d25c274
Refactor GUI app to use event bus micro ticker
RAprogramm Sep 26, 2025
a0cae0d
Merge pull request #28 from RAprogramm/eye-of-ra/refactor-app-for-bus…
RAprogramm Sep 26, 2025
95b5fde
Add module context utilities for module events
RAprogramm Sep 27, 2025
5acecde
Merge pull request #29 from RAprogramm/eye-of-ra/create-modulecontext…
RAprogramm Sep 27, 2025
c6797af
Re-export module context types
RAprogramm Sep 27, 2025
67cb97a
Merge pull request #30 from RAprogramm/eye-of-ra/add-module_context-t…
RAprogramm Sep 27, 2025
6a954e9
feat: add module registration context
RAprogramm Sep 27, 2025
f15a8f3
Merge pull request #31 from RAprogramm/eye-of-ra/refactor-modules.rs-…
RAprogramm Sep 27, 2025
a9be015
Pass module event sender into GUI app
RAprogramm Sep 27, 2025
d0909cf
Merge pull request #32 from RAprogramm/eye-of-ra/implement-event-bus-…
RAprogramm Sep 27, 2025
4793039
Refactor module registration to use runtime tasks
RAprogramm Sep 27, 2025
9a825f1
Merge pull request #33 from RAprogramm/eye-of-ra/implement-register-m…
RAprogramm Sep 27, 2025
74b921b
Refactor updates module runtime handling
RAprogramm Sep 27, 2025
e4304ab
Merge pull request #34 from RAprogramm/eye-of-ra/refactor-updates-mod…
RAprogramm Sep 27, 2025
2d51722
Refactor tray module event handling
RAprogramm Sep 27, 2025
2baeb58
Merge pull request #35 from RAprogramm/eye-of-ra/implement-tray-modul…
RAprogramm Sep 27, 2025
7f47338
Refactor privacy module runtime listeners
RAprogramm Sep 27, 2025
a722984
Merge pull request #36 from RAprogramm/eye-of-ra/implement-privacy-mo…
RAprogramm Sep 27, 2025
56afc8f
Refactor settings module to use runtime-managed services
RAprogramm Sep 27, 2025
1e41b5c
Merge pull request #37 from RAprogramm/eye-of-ra/refactor-settings-mo…
RAprogramm Sep 27, 2025
b194711
Refactor system info module polling
RAprogramm Sep 27, 2025
0b0100b
Merge pull request #38 from RAprogramm/eye-of-ra/add-sender-and-polli…
RAprogramm Sep 27, 2025
77799bf
Refactor media player module for runtime tasks
RAprogramm Sep 27, 2025
18429ac
Merge pull request #39 from RAprogramm/eye-of-ra/implement-mpris-list…
RAprogramm Sep 27, 2025
5dbcc28
refactor: move custom module listener to runtime
RAprogramm Sep 28, 2025
836d23f
Merge pull request #40 from RAprogramm/eye-of-ra/implement-modulecont…
RAprogramm Sep 28, 2025
fc31611
Fix settings module imports
RAprogramm Sep 28, 2025
6110573
Merge pull request #41 from RAprogramm/eye-of-ra/refactor-settings-mo…
RAprogramm Sep 28, 2025
78bd1ab
Refactor network service backend layout
RAprogramm Sep 28, 2025
946925e
Merge pull request #42 from RAprogramm/eye-of-ra/refactor-network-mod…
RAprogramm Sep 28, 2025
e578713
Refactor GUI app module into dedicated submodules
RAprogramm Sep 28, 2025
1c6022c
Merge pull request #43 from RAprogramm/eye-of-ra/refactor-app-module-…
RAprogramm Sep 28, 2025
d717551
Refactor audio service into backend and service modules
RAprogramm Sep 28, 2025
cbe1882
Merge pull request #44 from RAprogramm/eye-of-ra/refactor-audio-servi…
RAprogramm Sep 28, 2025
c2719c5
Refactor Hyprland client adapter into modular components
RAprogramm Sep 28, 2025
41c0426
Merge pull request #45 from RAprogramm/eye-of-ra/refactor-hyprland_cl…
RAprogramm Sep 28, 2025
4a935ec
refactor: split config modules
RAprogramm Sep 28, 2025
66f9354
Refactor MPRIS service structure
RAprogramm Sep 28, 2025
0d9441f
Refactor privacy service listeners into separate modules
RAprogramm Sep 28, 2025
754de90
Merge branch 'main' into eye-of-ra/refactor-config-module-structure
RAprogramm Sep 28, 2025
81ee795
Merge pull request #46 from RAprogramm/eye-of-ra/refactor-config-modu…
RAprogramm Sep 28, 2025
2e9a936
Merge branch 'main' into eye-of-ra/refactor-mpris-module-structure
RAprogramm Sep 28, 2025
bef5179
Merge pull request #47 from RAprogramm/eye-of-ra/refactor-mpris-modul…
RAprogramm Sep 28, 2025
f1b34bb
Merge pull request #48 from RAprogramm/eye-of-ra/refactor-privacy-ser…
RAprogramm Sep 28, 2025
cd7d2ed
Refactor outputs state management
RAprogramm Sep 29, 2025
e2477d8
Merge pull request #49 from RAprogramm/eye-of-ra/add-outputs-collecti…
RAprogramm Sep 29, 2025
1dabd8b
Refactor system info module structure
RAprogramm Sep 29, 2025
a1122ba
Merge pull request #50 from RAprogramm/eye-of-ra/create-system_info-m…
RAprogramm Sep 29, 2025
8472fca
Refactor style helpers into themed modules
RAprogramm Sep 29, 2025
8ccbb41
Merge pull request #51 from RAprogramm/eye-of-ra/introduce-modular-st…
RAprogramm Sep 29, 2025
0d3ede3
Refactor tray service into helper modules
RAprogramm Sep 29, 2025
7ff1828
Merge pull request #52 from RAprogramm/eye-of-ra/create-tray-icon-and…
RAprogramm Sep 29, 2025
ca09d50
Refactor updates module architecture
RAprogramm Sep 29, 2025
14a5386
Merge pull request #53 from RAprogramm/eye-of-ra/create-updates-modul…
RAprogramm Sep 29, 2025
77651e9
Bump thiserror from 1.0.69 to 2.0.16
dependabot[bot] Sep 29, 2025
127bdd4
Bump serde_with from 3.14.1 to 3.15.0
dependabot[bot] Oct 6, 2025
e2fa06b
Bump sysinfo from 0.37.0 to 0.37.2
dependabot[bot] Oct 6, 2025
3bc169c
Merge pull request #57 from RAprogramm/dependabot/cargo/sysinfo-0.37.2
RAprogramm Oct 7, 2025
e2f15d1
Merge pull request #54 from RAprogramm/dependabot/cargo/thiserror-2.0.16
RAprogramm Oct 7, 2025
9e603a9
Merge pull request #56 from RAprogramm/dependabot/cargo/serde_with-3.…
RAprogramm Oct 7, 2025
55a5fe3
docs: add clean architecture design document
RAprogramm Oct 7, 2025
733c65a
refactor: implement clean architecture - battery, clock modules, remo…
RAprogramm Oct 7, 2025
bf01d57
refactor: replace thiserror with masterror error handling
RAprogramm Oct 7, 2025
842f3fa
refactor: migrate from thiserror to masterror
RAprogramm Oct 7, 2025
66b42ae
wip: update modules to use generic Module trait
RAprogramm Oct 7, 2025
89a7f22
fix: restore EventSender/EventReceiver and fix imports
RAprogramm Oct 7, 2025
09f0129
fix: resolve module trait compatibility issues
RAprogramm Oct 7, 2025
4554a89
fix: resolve tray view and BluetoothState visibility
RAprogramm Oct 7, 2025
40571a3
init
RAprogramm Oct 8, 2025
454db84
fix: resolve compilation errors and update dependencies
RAprogramm Oct 8, 2025
9ded955
fix: resolve compilation and runtime test failures
RAprogramm Oct 8, 2025
8037c48
test: add comprehensive test coverage for app_launcher and clipboard …
RAprogramm Oct 8, 2025
16e5026
feat: add enable-broken-tests feature flag
RAprogramm Oct 8, 2025
7ed2561
fix: resolve closure lifetime error in sync_ops test
RAprogramm Oct 8, 2025
5a1742e
fix: resolve import and enum errors in broken tests
RAprogramm Oct 8, 2025
5a3069e
fix: resolve all compilation errors in broken tests suite
RAprogramm Oct 8, 2025
9df340e
fix: resolve all compilation errors in broken tests suite (#59)
RAprogramm Oct 8, 2025
3fefeb3
Merge branch 'main' of https://github.com/RAprogramm/hydebar
RAprogramm Oct 8, 2025
3b8a0e4
Migrate to official pop-os/iced (#60)
RAprogramm Oct 8, 2025
6c388c6
Merge branch 'main' of https://github.com/RAprogramm/hydebar
RAprogramm Oct 8, 2025
cb7b104
docs: add comprehensive roadmap and comparison documentation
RAprogramm Oct 8, 2025
983e391
#61 feat: add preset color themes (#71)
RAprogramm Oct 8, 2025
4c3789e
chore: apply cargo +nightly fmt formatting
RAprogramm Oct 8, 2025
be0c3c8
#62 feat: add smooth menu animations (#72)
RAprogramm Oct 8, 2025
92df6ac
#70: modernize README (#73)
RAprogramm Oct 8, 2025
4c4f2d4
docs: add comprehensive documentation guides (#74)
RAprogramm Oct 8, 2025
e5bb796
#68: add baseline performance metrics
RAprogramm Oct 8, 2025
1175019
#68: optimize Config sharing with Arc
RAprogramm Oct 8, 2025
7a89c89
#68: document Arc<Config> optimization results
RAprogramm Oct 8, 2025
e080dcc
#68: complete clone analysis and optimization summary
RAprogramm Oct 8, 2025
2668f33
Merge branch '68-performance-optimization'
RAprogramm Oct 8, 2025
a6fa7db
feat: implement notification center with D-Bus integration
RAprogramm Oct 8, 2025
1e6c97e
feat: add screenshot and recording module
RAprogramm Oct 8, 2025
6d4b999
Merge branch '64-screenshot-recording' into main
RAprogramm Oct 8, 2025
b803522
feat: enhance module UX with WiFi strength % and Bluetooth quick connect
RAprogramm Oct 8, 2025
570fe05
Merge branch '69-module-improvements' into main
RAprogramm Oct 8, 2025
9aef6e1
docs: update documentation for Phase 3 features
RAprogramm Oct 8, 2025
8bc3154
Merge branch '70-documentation-update' into main
RAprogramm Oct 8, 2025
127b23a
feat: add weather module with wttr.in API integration
RAprogramm Oct 8, 2025
218daa4
feat: integrate weather with clock and migrate to OpenWeatherMap API
RAprogramm Oct 8, 2025
ccc7bab
Merge branch '66-weather-widget' into main
RAprogramm Oct 8, 2025
6d80a91
chore: apply clippy automatic fixes
RAprogramm Oct 8, 2025
e1052d2
chore: fix majority of clippy warnings (57 → 40 errors)
RAprogramm Oct 8, 2025
21d2f31
chore: remove redundant #[must_use] attributes (40 → 31 errors)
RAprogramm Oct 8, 2025
9f769f6
chore: fix final clippy warnings (31 → 0 errors)
RAprogramm Oct 8, 2025
da60239
fmt
RAprogramm Oct 15, 2025
0e9f2fb
chore(deps): bump iced from `521a04d` to `8cbf2b7` (#80)
dependabot[bot] Oct 15, 2025
5b40e3a
chore(deps): bump clap from 4.5.48 to 4.5.49 (#76)
dependabot[bot] Oct 15, 2025
9ab7723
chore(deps): bump masterror from 0.24.17 to 0.24.19 (#79)
dependabot[bot] Oct 15, 2025
84193b2
chore(deps): bump reqwest from 0.12.23 to 0.12.24 (#78)
dependabot[bot] Oct 15, 2025
c3371d1
chore(deps): bump flexi_logger from 0.31.4 to 0.31.7 (#77)
dependabot[bot] Oct 15, 2025
d4db397
81 (#82)
RAprogramm Oct 16, 2025
0e368ef
#83 feat: implement custom calendar widget for clock module
RAprogramm Oct 16, 2025
250fd77
#83 feat: implement custom calendar widget for clock module (#84)
RAprogramm Oct 16, 2025
5ee22e8
#83 fix: remove unused clock view and fix clippy warnings
RAprogramm Oct 16, 2025
3223719
#83 fix: increase calendar menu width to fit all 7 days
RAprogramm Oct 16, 2025
55b2693
#83 merge: calendar implementation with width fix
RAprogramm Oct 16, 2025
50a7951
#83 fix: align weekday headers with calendar grid columns
RAprogramm Oct 16, 2025
e40265e
#83 fix: calendar menu sizing and alignment
RAprogramm Oct 16, 2025
5ee1b98
#83 fix: restore calendar header visibility
RAprogramm Oct 16, 2025
784dfeb
#85 feat: add keyboard navigation infrastructure
RAprogramm Oct 16, 2025
8b84dce
#85 feat: implement module navigation and visual focus indicator
RAprogramm Oct 16, 2025
10427dc
#85 feat: implement Enter to activate focused module
RAprogramm Oct 16, 2025
1297816
fix: improve weather module error messages
RAprogramm Oct 16, 2025
99673a0
chore(deps): bump iced from `8cbf2b7` to `7bb364e` (#90)
dependabot[bot] Oct 20, 2025
4b56c2e
chore(deps): bump clap from 4.5.49 to 4.5.50 (#89)
dependabot[bot] Oct 20, 2025
ea3febd
Update README.md
RAprogramm Nov 4, 2025
58f10e3
chore(deps): bump clap from 4.5.50 to 4.5.51 (#94)
dependabot[bot] Nov 4, 2025
15ec444
chore(deps): bump serde_with from 3.15.0 to 3.15.1 (#91)
dependabot[bot] Nov 4, 2025
c5fdf44
chore(deps): bump iced from `7bb364e` to `783d764` (#92)
dependabot[bot] Nov 4, 2025
2b4a343
chore(deps): bump masterror from 0.24.19 to 0.25.1 (#93)
dependabot[bot] Nov 4, 2025
b44b82c
chore(deps): bump clap from 4.5.51 to 4.5.52 (#97)
dependabot[bot] Nov 18, 2025
fd28232
chore(deps): bump iced from `783d764` to `b788625` (#96)
dependabot[bot] Nov 18, 2025
ffc47d3
chore(deps): bump serde_with from 3.15.1 to 3.16.0 (#95)
dependabot[bot] Nov 18, 2025
d7eb751
chore(deps): bump clap from 4.5.52 to 4.5.53 (#98)
dependabot[bot] Dec 20, 2025
da46750
chore(deps): bump log from 0.4.28 to 0.4.29 (#100)
dependabot[bot] Dec 20, 2025
c656f9b
chore(deps): bump serde_with from 3.16.0 to 3.16.1 (#101)
dependabot[bot] Dec 20, 2025
083adc9
chore(deps): bump iced from `b788625` to `10db38f` (#102)
dependabot[bot] Dec 20, 2025
324f5a5
chore(deps): bump reqwest from 0.12.24 to 0.12.25 (#103)
dependabot[bot] Dec 20, 2025
0d98c88
chore(deps): bump serde_json from 1.0.145 to 1.0.149 (#111)
dependabot[bot] Feb 13, 2026
6802ccb
chore(deps): bump iced from `10db38f` to `176589f` (#110)
dependabot[bot] Feb 13, 2026
03f907a
chore(deps): bump reqwest from 0.12.25 to 0.13.1 (#109)
dependabot[bot] Feb 13, 2026
f33c43b
chore(deps): bump tempfile from 3.23.0 to 3.24.0 (#107)
dependabot[bot] Feb 13, 2026
f222fa1
chore(deps): bump uuid from 1.18.1 to 1.19.0 (#105)
dependabot[bot] Feb 13, 2026
e557475
chore(deps): bump chrono from 0.4.42 to 0.4.43
dependabot[bot] Feb 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ updates:
schedule:
interval: weekly

# NPM
- package-ecosystem: npm
directory: "/website"
schedule:
interval: weekly

# GitHub Actions
- package-ecosystem: github-actions
directory: "/"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
crates/*/Cargo.lock
vendor
.claude
11 changes: 11 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
trailing_comma = "Never"
brace_style = "SameLineWhere"
struct_field_align_threshold = 20
wrap_comments = true
format_code_in_doc_comments = true
struct_lit_single_line = false
max_width = 99
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
reorder_imports = true
unstable_features = true
186 changes: 186 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# HydeBar Architecture

**Professional, Clean, Event-Driven Architecture for Hyprland**

## Philosophy

> Modules provide DATA and LOGIC, not UI.
> GUI layer renders based on data.
> Communication through Event Bus.

## Layer Structure

```
┌──────────────────────────────────────┐
│ hydebar-proto │
│ - Config types │
│ - Protocol definitions │
│ - Shared data structures │
└──────────────┬───────────────────────┘
┌──────────────▼───────────────────────┐
│ hydebar-core │
│ ┌────────────────────────────────┐ │
│ │ Modules (Business Logic ONLY) │ │
│ │ - battery: BatteryData │ │
│ │ - clock: ClockData │ │
│ │ - workspaces: WorkspaceData │ │
│ │ ... │ │
│ └────────────────────────────────┘ │
│ ┌────────────────────────────────┐ │
│ │ Event Bus │ │
│ │ - Module events │ │
│ │ - State changes │ │
│ └────────────────────────────────┘ │
│ ┌────────────────────────────────┐ │
│ │ Services │ │
│ │ - DBus, IPC, Hyprland socket │ │
│ └────────────────────────────────┘ │
└──────────────┬───────────────────────┘
│ Events only
┌──────────────▼───────────────────────┐
│ hydebar-gui │
│ ┌────────────────────────────────┐ │
│ │ View Layer │ │
│ │ - Renders modules to Elements │ │
│ │ - Styling, theming │ │
│ │ - User interactions │ │
│ └────────────────────────────────┘ │
│ ┌────────────────────────────────┐ │
│ │ App State │ │
│ │ - Subscribes to core events │ │
│ │ - Handles user actions │ │
│ └────────────────────────────────┘ │
└──────────────┬───────────────────────┘
┌──────────────▼───────────────────────┐
│ hydebar-app │
│ - Main entry point │
│ - Wiring everything together │
└──────────────────────────────────────┘
```

## Module Design Pattern

### Core Module (NO GUI!)

```rust
// hydebar-core/src/modules/battery.rs

/// Module data - pure state, no UI
#[derive(Debug, Clone)]
pub struct BatteryData {
pub capacity: u8,
pub charging: bool,
pub icon: BatteryIcon,
pub time_remaining: Option<Duration>,
pub power_profile: PowerProfile,
}

/// Module events
#[derive(Debug, Clone)]
pub enum BatteryEvent {
StatusChanged(BatteryData),
ProfileChanged(PowerProfile),
LowBattery(u8),
}

/// Module - business logic only
pub struct Battery {
data: BatteryData,
sender: EventSender<BatteryEvent>,
}

impl Battery {
pub fn data(&self) -> &BatteryData {
&self.data
}

pub fn set_power_profile(&mut self, profile: PowerProfile) {
// Logic here
self.sender.send(BatteryEvent::ProfileChanged(profile));
}
}
```

### GUI View (iced rendering)

```rust
// hydebar-gui/src/views/battery.rs

pub fn render_battery(data: &BatteryData) -> Element<Message> {
row![
icon(data.icon),
text(format!("{}%", data.capacity)),
if data.charging {
icon(Icons::Lightning)
}
]
.spacing(4)
.into()
}

pub fn render_battery_menu(data: &BatteryData) -> Element<Message> {
column![
text(format!("Battery: {}%", data.capacity)),
text(format!("Time: {:?}", data.time_remaining)),
// Power profile buttons
power_profile_selector(data.power_profile)
]
}
```

## Event Flow

```
User clicks → GUI sends Message → App updates Module →
Module publishes Event → Event Bus → GUI subscribes → Re-render
```

Example:
```
1. User clicks "Change Power Profile"
2. GUI: Message::Battery(BatteryAction::SetProfile(Performance))
3. App: battery.set_power_profile(Performance)
4. Module: sender.send(BatteryEvent::ProfileChanged(Performance))
5. GUI subscription receives event → update() → re-render
```

## Benefits

### ✅ Clean Separation
- Core = logic, no dependencies on GUI
- GUI = rendering, no business logic
- Easy to test each layer

### ✅ No Circular Dependencies
- Core never imports GUI types
- GUI imports Core data types only
- Uni-directional data flow

### ✅ Modularity
- Easy to add new modules
- Modules are independent
- Can reuse core in different GUIs (CLI, web, etc.)

### ✅ Performance
- Event-driven updates (only what changed)
- iced GPU acceleration
- Efficient rendering

### ✅ Maintainability
- Clear responsibility boundaries
- Easy to debug
- Professional codebase

## Migration Steps

1. **Define data structures** in core modules
2. **Remove GUI dependencies** from core
3. **Create view functions** in GUI layer
4. **Wire event bus** properly
5. **Test each module** independently

## Example: Complete Battery Module

See `docs/examples/battery-module.md` for full implementation example.
Loading