feat(battery): add option to set unlimited time remaining icon/text#670
feat(battery): add option to set unlimited time remaining icon/text#670stylebending wants to merge 4 commits intoamnweb:mainfrom
Conversation
|
Hi! Thanks for the PR. We recently moved from Cerberus to Pydantic for validation files. Please check the new battery validation schema format. |
Thanks for pointing that out! I've updated the battery validation schema and the widget's |
Video-Nomad
left a comment
There was a problem hiding this comment.
This works as described, however my problem with this change is that we are adding an icon to the status_icons but it's not a status icon {icon} . It's a separate {time_remaining}. It does not have specific styling like other icons. It's more similar to charging_options to be honest, so it might be a better idea to expand this and make something like:
time_remaining_options:
time_format: <- Standard python time formatting string like "%H:%M:%S"
unlimited_icon: <- Unlimited icon
We can't really move current time_remaining_natural as it will break configurations, but time_format can be overridden by it if it's true. Ideally it would go to the same time_remaining_options.
@amnweb What do you think about this?
|
@Video-Nomad I'm fine with any option you choose since I only have a battery device when I mock one D |
|
@stylebending So I guess to not overcomplicate this too much and since we already have battery:
type: "yasb.battery.BatteryWidget"
options:
time_remaining_natural: False
time_remaining_unlimited_icon: "\u221e" |
|
@Video-Nomad Thanks for taking a look at this again! I've made these changes:
I believe this is ready now, if there's anything else that needs to be changed, I would love to hear it. |
Hi! This PR addresses the request in Discussion #663.
I’ve added a new configurable icon,
icon_unlimited, to the battery widget'sstatus_icons. This allows users to choose between the default "unlimited" text or the infinity icon "∞" (or any other string/icon) for a cleaner taskbar look.Changes:
icon_unlimitedtoDEFAULTSandVALIDATION_SCHEMA._get_time_remainingto pull the value dynamically from the user's configuration.