mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1353] [MERGED] feat(bar): auto select/hide widget based on value #1344
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1353
Author: @CtByte
Created: 3/16/2025
Status: ✅ Merged
Merged: 4/3/2025
Merged by: @LGUG2Z
Base:
master← Head:widget_auto_select📝 Commits (1)
9037fcbfeat(bar): auto select/hide widget based on value📊 Changes
11 files changed (+914 additions, -241 deletions)
View changed files
📝
komorebi-bar/src/bar.rs(+91 -56)📝
komorebi-bar/src/config.rs(+12 -0)📝
komorebi-bar/src/main.rs(+4 -0)📝
komorebi-bar/src/render.rs(+15 -0)📝
komorebi-bar/src/selected_frame.rs(+27 -4)📝
komorebi-bar/src/widgets/battery.rs(+39 -18)📝
komorebi-bar/src/widgets/cpu.rs(+29 -10)📝
komorebi-bar/src/widgets/memory.rs(+31 -11)📝
komorebi-bar/src/widgets/network.rs(+252 -88)📝
komorebi-bar/src/widgets/storage.rs(+49 -15)📝
schema.bar.json(+365 -39)📄 Description
This commit adds new settings to some widgets that allows to auto select/hide them based on their current values.
The cpu/memory/network/storage widgets get a setting that auto selects the widget if the current value/percentage is over a value.
The battery widget gets a setting that auto selects the widget if the current percentage is under a value.
The storage widget gets a setting that auto hides the disk widget if the percentage is under a value.
https://github.com/user-attachments/assets/546fdd10-dbc8-464c-8fcb-813dc46c1dc7
Also added 2 new settings (auto_select_fill and auto_select_text) to the theme, in order to select the fill and
text colors of an auto selected widget.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.