Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Regarding Support Multiple Types of Batteries #244

Closed
dev-onejun opened this issue Jan 3, 2024 · 0 comments
Closed

Enhancement: Regarding Support Multiple Types of Batteries #244

dev-onejun opened this issue Jan 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@dev-onejun
Copy link
Contributor

dev-onejun commented Jan 3, 2024

Describe the feature you'd like

Since (it seems that) there are a few types of laptop batteries not supported by the current battery.sh script,
I would like to add a feature to enable dracula/tmux to get a piece of information without neither upower or acpi which requires an additional installation.

Describe risks you've considered

.

Describe alternatives you've considered

.

Descriptions

Thank you for maintaining this wonderful tmux theme.

I recently joined the tmux and used the dracula theme.

However, I encountered an issue that the battery info was not presented while I configured the theme on my laptop.

Here are my device details:

$ uname -a
Linux XXX 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ ls /sys/class/power_supply
ADP1  CMB0  ucsi-source-psy-USBC000:001

$ upower -e
/org/freedesktop/UPower/devices/line_power_ADP1
/org/freedesktop/UPower/devices/battery_CMB0
/org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
/org/freedesktop/UPower/devices/DisplayDevice

The laptop manufacturer was LG, and CMB0 included the status and capacity of the battery.

Solutions

I think that the files, status and capacity, are the only unique files in the system showing information about the battery.

So, I edited line 10, which selected the battery device in the battery.sh script.

1

BAT=$(ls -d /sys/class/power_supply/*CMB* | head -1)

2

BAT=$(ls -d /sys/class/power_supply/*)

Both of them worked on my laptop.

In order to support the previous BAT, I chose the second solution. (#245)

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant