Skip to content

Add vbattery and hbattery prompt items#649

Open
jose1711 wants to merge 1 commit intoIlanCosman:mainfrom
jose1711:battery_item
Open

Add vbattery and hbattery prompt items#649
jose1711 wants to merge 1 commit intoIlanCosman:mainfrom
jose1711:battery_item

Conversation

@jose1711
Copy link
Copy Markdown
Contributor

@jose1711 jose1711 commented Apr 1, 2026

Two new items for displaying battery status:

  • vbattery: font icons with 11 charge levels, separate charging/discharging icon sets and color alerts for low/critical
  • hbattery: block bar with 5 levels using integer bucketing

Both items share common configuration under tide_battery_* (method, thresholds, critical/low colors) while each has its own tide_<item>_bg_color and tide_<item>_color.

Supported backends: upower (default), sysfs, termux.

Description

Motivation and Context

Closes #294

Screenshots (if appropriate)

obrázok

How Has This Been Tested

Added both items to left prompt items on a laptop running on battery. Verified visually. Tested via littlecheck.py.

  • I have tested using Linux.
  • I have tested using MacOS.

Checklist

  • I am ready to update the wiki accordingly.
  • I have updated the tests accordingly.

@jose1711 jose1711 requested a review from IlanCosman as a code owner April 1, 2026 16:37
@jose1711
Copy link
Copy Markdown
Contributor Author

jose1711 commented Apr 1, 2026

This also extends #578 (however lacks percentage which could be added separately)

@jose1711 jose1711 force-pushed the battery_item branch 2 times, most recently from 8e66d75 to 422c262 Compare April 1, 2026 16:46
Two new items for displaying battery status:
  - `vbattery`: font icons with 11 charge levels, separate charging/discharging
                icon sets and color alerts for low/critical
  - `hbattery`: block bar with 5 levels using integer bucketing

Both items share common configuration under `tide_battery_*`
(method, thresholds, critical/low colors) while each has its own
`tide_<item>_bg_color` and `tide_<item>_color`.

Supported backends: upower (default), sysfs (with customizable battery
name), termux.
@Martian-0007
Copy link
Copy Markdown

Perhaps fish could do a toggle in a variable for the percentage display?
If I understood the code correctly, you're already polling for it anyway

Either way, thanks a lot for the work

@jose1711
Copy link
Copy Markdown
Contributor Author

Perhaps fish could do a toggle in a variable for the percentage display? If I understood the code correctly, you're already polling for it anyway

Either way, thanks a lot for the work

Thank you. Instead of a toggle I was thinking of adding a separate item (pbattery?). This way user can choose whether he/she wants to see just the icon, numeric value or both.

@Martian-0007
Copy link
Copy Markdown

Wouldn't a separate item also add another separator? I like the combination of icon and value, as it helps with orientation at a glance.

iirc p10k also uses a little clock for time (maybe I just haven't tampered with the config of tide enough to find that yet)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add battery item

2 participants