Skip to content

Add vbattery and hbattery prompt items - #28

Open
jose1711 wants to merge 1 commit into
plttn:mainfrom
jose1711:battery_item_plttn
Open

Add vbattery and hbattery prompt items#28
jose1711 wants to merge 1 commit into
plttn:mainfrom
jose1711:battery_item_plttn

Conversation

@jose1711

@jose1711 jose1711 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

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.

Description

Motivation and Context

Closes #

Screenshots (if appropriate)

obr谩zok

How Has This Been Tested

  • 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.

@plttn plttn self-assigned this Apr 17, 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 (with customizable battery
name), termux.
@plttn
plttn force-pushed the battery_item_plttn branch from 900a67e to e134b15 Compare April 18, 2026 19:02
@plttn

plttn commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Hey @jose1711, apologies for the delay here. Would you mind if we reshaped this a little bit to be a single battery icon with a tide_battery_style vertical|horizontal picker?

@plttn plttn left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing @jose1711!

Few thoughts:

  1. This currently won't work on macOS because upower doesn't exist on macOS.
  2. There's no command -q guard around upower so it fails loudly.

Asks:

  • Can we please add a guard around upower so it fails nicely?
  • Can we add support for macOS? pmset -g batt
  • Nice to have: turn it into a single item, using tide_battery_style <horizontal|vertical> to switch to avoid duplicated logic that needs to stay in sync.

set -f bat_status (cat $battery_name/status)[1]
end
end
case '*'

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will error on macOS because we don't have a guard here.

set -f bat_status (cat $battery_name/status)[1]
end
end
case '*'

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well.

Additionally, if combined into a single item with a switcher for style, this avoids duplicating logic in case it needs to be updated in the future

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.

2 participants