[GH-ISSUE #698] Hide the battry indicator when there is no battery. #8663

Closed
opened 2026-05-23 03:53:32 +01:00 by JakeStanger · 2 comments
Owner

Originally created by @Kl4rry on GitHub (Aug 10, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/698

Is your feature request related to a problem? Please describe.
I use the same ironbar config on my desktop and my laptop. On my laptop I want to use the battery indicator but it is not useful on a desktop as it has no battery.

Describe the solution you'd like
Add an option to make the battery indicator disappear when there is no battery.

Describe alternatives you've considered
I could have two different configs but that seems a bit annoying when they are 99% the same.

Originally created by @Kl4rry on GitHub (Aug 10, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/698 **Is your feature request related to a problem? Please describe.** I use the same ironbar config on my desktop and my laptop. On my laptop I want to use the battery indicator but it is not useful on a desktop as it has no battery. **Describe the solution you'd like** Add an option to make the battery indicator disappear when there is no battery. **Describe alternatives you've considered** I could have two different configs but that seems a bit annoying when they are 99% the same.
Author
Owner

@JakeStanger commented on GitHub (Aug 10, 2024):

You can use show_if for this, and only show the module if a battery is detected. Something like:

{ 
  type = "upower"
  show_if = "[ -f /sys/class/power_supply/BAT0/capacity ]"
}
<!-- gh-comment-id:2282134154 --> @JakeStanger commented on GitHub (Aug 10, 2024): You can use `show_if` for this, and only show the module if a battery is detected. Something like: ```corn { type = "upower" show_if = "[ -f /sys/class/power_supply/BAT0/capacity ]" } ```
Author
Owner

@Kl4rry commented on GitHub (Aug 10, 2024):

Thanks!

<!-- gh-comment-id:2282181057 --> @Kl4rry commented on GitHub (Aug 10, 2024): Thanks!
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#8663
No description provided.