[GH-ISSUE #1030] better battery icons #7344

Closed
opened 2026-05-23 02:54:00 +01:00 by JakeStanger · 3 comments
Owner

Originally created by @Kommynct on GitHub (Jun 6, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1030

I want to be able to use different icons for upower based on the battery state and whether or not it's charging, on waybar I have this setup with nerdfonts

"format-icons": {
      "charged": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"],
      "charging": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅" ],
      "discharging": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹" ],
      "full": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"],
      "plugged": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"]

this gives accurate icons no matter the battery state and percentage combination without a separate icon needed for all possible battery states. This would be nice to have on the upower module.

i think waybars implementation should just be copy-pasted, for icon setup it is perfect in my eyes.

Originally created by @Kommynct on GitHub (Jun 6, 2025). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1030 I want to be able to use different icons for upower based on the battery state and whether or not it's charging, on waybar I have this setup with nerdfonts ``` "format-icons": { "charged": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"], "charging": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅" ], "discharging": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹" ], "full": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"], "plugged": ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"] ``` this gives accurate icons no matter the battery state and percentage combination without a separate icon needed for all possible battery states. This would be nice to have on the upower module. i think waybars implementation should just be copy-pasted, for icon setup it is perfect in my eyes.
Author
Owner

@JakeStanger commented on GitHub (Jun 6, 2025):

Are you able to expand on this please? As you've not filled out the feature request issue template, I'm missing a lot of the information I'd normally ask for. it's not clear what the actual usecase is here, and I'm not interested in blindly copying Waybar.

<!-- gh-comment-id:2949232393 --> @JakeStanger commented on GitHub (Jun 6, 2025): Are you able to expand on this please? As you've not filled out the feature request issue template, I'm missing a lot of the information I'd normally ask for. it's not clear what the actual usecase is here, and I'm not interested in blindly copying Waybar.
Author
Owner

@Kommynct commented on GitHub (Jun 6, 2025):

Yes, sorry, I often lack clarity.

So, the way it works currently in waybar is that these icons are programatically determined, you write

{icon}

and you get something from the list above, just as an example,

`discharging": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹" ],

each icon in the sequence depicts less and less charge, you might be thinking "how does it know what percentage is to what icon" and that's simple, they have to be placed in order, and they evenly take up an equal amount of the storage, so, one could have

discharging": ["󰂎", "󰁺" ],

and then the icon would change at the 50% mark

This makes it so that you can have a gradual decrease with enough icons, it also makes it so that you can have different icons for different situations, for example,

I want my charging icon to have a lightning bolt to the right of it, but I still want it to take up one monospace character, so, the charging icons are unique

here's a screenshot since github mangles the icons:

Image

full is kind of a silly dummy one, but the rest kind of just make intuitive sense I hope, I hope that helps.

also some of these should be simplified

full is multiple icons because some batteries report full at less than 100%. Charged is a synonym and should be merged with it

plugged means it's not charging but is plugged in and is not at 100% (rare but it covers all cases)

<!-- gh-comment-id:2949250849 --> @Kommynct commented on GitHub (Jun 6, 2025): Yes, sorry, I often lack clarity. So, the way it works currently in waybar is that these icons are programatically determined, you write {icon} and you get something from the list above, just as an example, `discharging": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹" ], each icon in the sequence depicts less and less charge, you might be thinking "how does it know what percentage is to what icon" and that's simple, they have to be placed in order, and they evenly take up an equal amount of the storage, so, one could have discharging": ["󰂎", "󰁺" ], and then the icon would change at the 50% mark This makes it so that you can have a gradual decrease with enough icons, it also makes it so that you can have different icons for different situations, for example, I want my charging icon to have a lightning bolt to the right of it, but I still want it to take up one monospace character, so, the charging icons are unique here's a screenshot since github mangles the icons: ![Image](https://github.com/user-attachments/assets/cd31ae1d-95b1-448f-9885-e4e66d4bc10b) full is kind of a silly dummy one, but the rest kind of just make intuitive sense I hope, I hope that helps. also some of these should be simplified full is multiple icons because some batteries report full at less than 100%. Charged is a synonym and should be merged with it plugged means it's not charging but is plugged in and is not at 100% (rare but it covers all cases)
Author
Owner

@JakeStanger commented on GitHub (Sep 7, 2025):

Closing as resolved due to #1125 and #1126

<!-- gh-comment-id:3264018096 --> @JakeStanger commented on GitHub (Sep 7, 2025): Closing as resolved due to #1125 and #1126
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#7344
No description provided.