mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 05:15:23 +01:00
[PR #1274] [CLOSED] Centralised thresholds system #2677
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#2677
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/JakeStanger/ironbar/pull/1274
Author: @JakeStanger
Created: 12/7/2025
Status: ❌ Closed
Base:
master← Head:feat/thresholds📝 Commits (2)
2887b08feat(config) : standardised thresholds system5053197refactor(volume): use standardised threshold system📊 Changes
6 files changed (+248 additions, -59 deletions)
View changed files
📝
Cargo.lock(+39 -4)📝
Cargo.toml(+6 -1)📝
docs/modules/Volume.md(+37 -31)📝
src/config/mod.rs(+2 -0)➕
src/config/thresholds.rs(+156 -0)📝
src/modules/volume.rs(+8 -23)📄 Description
Overview
This is a first draft at attempting to introduce a standardised system for configuring thresholds, ie for icon boundaries.
The system would apply to the following modules:
backlight(configure brightness icon, #1235)network_manager(configure wifi strength icon, #1233)volume(configure volume icon)The following locations would also expand to use this with future updates:
battery(configure battery icon, #935)music(configure volume icon)There may also be places I've missed.
Syntaxes
This introduces three separate syntax for configuring the thresholds in an attempt to appease everybody:
Basic
Offers pre-defined low/medium/high keywords that abstract the thresholds. The thresholds are always divided into equal thirds from
0-maxDynamic
Uses an array of dynamic length to define N number of thresholds, all equally divided from
0-max. Keys are provided in order from low-high.Manual
Uses a map to define N number of thresholds, manually specifying the lower bound for each threshold. This allows for more explicit configuration, and non-linear thresholds.
A zero threshold must be defined.
API
The struct would be placed inside the config:
Currently a single
threshold_formethod is provided:Outstanding
manualformat assumes integers are used asHashMapkeys. This may not be supported by all formats.Questions:
batterymodule existing thresholds option. What to do there?I am looking for feedback on this! This is a bit of a "throw everything at the wall and see what sticks" approach. Anything regarding anything I've thought of above, or anything else you see.
Paging @xMAC94x @Rodrigodd as both of you have open PRs pending a decision around this - feedback from the both of you on whether you think this would work for your modules would be especially valuable.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.