svartalf / rust-battop Goto Github PK
View Code? Open in Web Editor NEWInteractive batteries viewer
Home Page: https://crates.io/crates/battop
License: Apache License 2.0
Interactive batteries viewer
Home Page: https://crates.io/crates/battop
License: Apache License 2.0
It would be cool if I could get a more fluent chart with --delay
option set to something like 0.5, 0.2 or 0.1, or 0.01 seconds.
If I ever finally get more serious about Rust I might implement this myself :)
It would be nice to have such binaries available
When compiling, I get a really long error message that seems to be in some dependency: error.txt
Running cargo update
seems to also update the faulty dependency.
I still get some warnings, but nothing fatal.
Hi, just tried building this on Fedora Linux 36 (Workstation Edition). It failed at building uom, and it seems to be this exact issue.
Without much experience in rust / cargo / the build system, I tried looking at Cargo.toml if there's a direct dependency on an older uom version, but there's none, right?
I'm not sure what to do, and just reporting what I experienced.
https://monosnap.com/file/QgWq6JhUNyRENLxBtXkgHTU3CLkCtp
tested some different themes in terminal and figured out that some of labels is hard to read
hash and temperature are hard to read on basically on any light theme.
percentage bar value on solarized dark
and homebrew
are barely visible.
Hi, is it possible to wrap the code into a brew formula for quick installation? Thanks.
Data race in
Iter
andIterMut
Details | |
---|---|
Package | thread_local |
Version | 0.3.4 |
URL | Amanieu/thread_local-rs#33 |
Date | 2022-01-23 |
Patched versions | >=1.1.4 |
In the affected version of this crate, {Iter, IterMut}::next
used a weaker memory ordering when loading values than what was required, exposing a potential data race
when iterating over a ThreadLocal
's values.
Crates using Iter::next
, or IterMut::next
are affected by this issue.
See advisory page for additional details.
Potential segfault in
localtime_r
invocations
Details | |
---|---|
Package | chrono |
Version | 0.4.19 |
URL | chronotope/chrono#499 |
Date | 2020-11-10 |
Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.
No workarounds are known.
See advisory page for additional details.
Running battop 0.2.2
, installed via yay -S battop
on ArchLinux 5.1.5-arch1-2-ARCH
.
Battery detected as SMP DELL GPM0365
.
Steps to reproduce:
RUST_BACKTRACE=1
does not report anything).stderr collected via -vvvvv
:
2019-05-29T11:50:25+00:00 - ERROR - Error occurred: Battery(Error { source: Os { code: 19, kind: Other, message: "No such device" }, description: None })
Error: Battery(Error { source: Os { code: 19, kind: Other, message: "No such device" }, description: None })
Potential segfault in the time crate
Details | |
---|---|
Package | time |
Version | 0.1.44 |
URL | time-rs/time#293 |
Date | 2020-11-18 |
Patched versions | >=0.2.23 |
Unaffected versions | =0.2.0,=0.2.1,=0.2.2,=0.2.3,=0.2.4,=0.2.5,=0.2.6 |
Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.
The affected functions from time 0.2.7 through 0.2.22 are:
time::UtcOffset::local_offset_at
time::UtcOffset::try_local_offset_at
time::UtcOffset::current_local_offset
time::UtcOffset::try_current_local_offset
time::OffsetDateTime::now_local
time::OffsetDateTime::try_now_local
The affected functions in time 0.1 (all versions) are:
at
at_utc
Non-Unix targets (including Windows and wasm) are unaffected.
Pending a proper fix, the internal method that determines the local offset has been modified to always return None
on the affected operating systems. This has the effect of returning an Err
on the try_*
methods and UTC
on the non-try_*
methods.
Users and library authors with time in their dependency tree should perform cargo update
, which will pull in the updated, unaffected code.
Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3. series.
No workarounds are known.
See advisory page for additional details.
First world problem: When removing the (only) battery that is installed on my system, battop crashes:
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1] 23948 abort (core dumped) battop
The terminal becomes unusable after battop crashed (random inserted characters when using the mouse, sigterm will not work).
Let me know if there is any information that is missing.
I am using Thinkpad T16 Gen 1 and I got this error
2023-09-02T03:12:01+08:00 - ERROR - Unable to find any batteries in system, exiting
Error: NoBatteries
This s the result of the command you posted
/sys/class/power_supply
cat: /sys/class/power_supply: Is a directory
/sys/class/power_supply/BAT0
cat: /sys/class/power_supply/BAT0: Is a directory
/sys/class/power_supply/BAT0/uevent
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-poly
POWER_SUPPLY_CYCLE_COUNT=4
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=15440000
POWER_SUPPLY_VOLTAGE_NOW=16094000
POWER_SUPPLY_POWER_NOW=71618000
POWER_SUPPLY_ENERGY_FULL_DESIGN=86000000
POWER_SUPPLY_ENERGY_FULL=87740000
POWER_SUPPLY_ENERGY_NOW=29100000
POWER_SUPPLY_CAPACITY=33
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=LNV-5B10W51871@�
POWER_SUPPLY_MANUFACTURER=SMP
POWER_SUPPLY_SERIAL_NUMBER= 2999
/sys/class/power_supply/BAT0/serial_number
2999
/sys/class/power_supply/BAT0/technology
Li-poly
/sys/class/power_supply/BAT0/power_now
71618000
/sys/class/power_supply/BAT0/charge_stop_threshold
100
/sys/class/power_supply/BAT0/present
1
/sys/class/power_supply/BAT0/power
cat: /sys/class/power_supply/BAT0/power: Is a directory
/sys/class/power_supply/BAT0/manufacturer
SMP
/sys/class/power_supply/BAT0/charge_control_start_threshold
0
/sys/class/power_supply/BAT0/hwmon2
cat: /sys/class/power_supply/BAT0/hwmon2: Is a directory
/sys/class/power_supply/BAT0/device
cat: /sys/class/power_supply/BAT0/device: Is a directory
/sys/class/power_supply/BAT0/energy_now
29100000
/sys/class/power_supply/BAT0/type
Battery
/sys/class/power_supply/BAT0/capacity
33
/sys/class/power_supply/BAT0/cycle_count
4
/sys/class/power_supply/BAT0/voltage_now
16094000
find: File system loop detected; ‘/sys/class/power_supply/BAT0/subsystem’ is part of the same file system loop as ‘/sys/class/power_supply’.
/sys/class/power_supply/BAT0/status
Charging
/sys/class/power_supply/BAT0/charge_behaviour
[auto] inhibit-charge force-discharge
/sys/class/power_supply/BAT0/alarm
0
/sys/class/power_supply/BAT0/model_name
LNV-5B10W51871@�
/sys/class/power_supply/BAT0/voltage_min_design
15440000
/sys/class/power_supply/BAT0/capacity_level
Normal
/sys/class/power_supply/BAT0/energy_full_design
86000000
/sys/class/power_supply/BAT0/charge_control_end_threshold
100
/sys/class/power_supply/BAT0/energy_full
87740000
/sys/class/power_supply/BAT0/charge_start_threshold
0
/sys/class/power_supply/AC
cat: /sys/class/power_supply/AC: Is a directory
/sys/class/power_supply/AC/uevent
POWER_SUPPLY_NAME=AC
POWER_SUPPLY_TYPE=Mains
POWER_SUPPLY_ONLINE=1
/sys/class/power_supply/AC/power
cat: /sys/class/power_supply/AC/power: Is a directory
/sys/class/power_supply/AC/online
1
/sys/class/power_supply/AC/device
cat: /sys/class/power_supply/AC/device: Is a directory
/sys/class/power_supply/AC/wakeup30
cat: /sys/class/power_supply/AC/wakeup30: Is a directory
/sys/class/power_supply/AC/type
Mains
/sys/class/power_supply/AC/hwmon0
cat: /sys/class/power_supply/AC/hwmon0: Is a directory
find: File system loop detected; ‘/sys/class/power_supply/AC/subsystem’ is part of the same file system loop as ‘/sys/class/power_supply’.
Whenever you're ready, I'll package and add this to our Pop repository. This seems like a very useful tool for us.
tui
is unmaintained; useratatui
instead
Details | |
---|---|
Status | unmaintained |
Package | tui |
Version | 0.6.2 |
URL | fdehau/tui-rs#654 |
Date | 2023-08-07 |
The tui
crate is no longer maintained.
Consider using the ratatui
crate instead.
See advisory page for additional details.
Out-of-bounds write in nix::unistd::getgrouplist
Details | |
---|---|
Package | nix |
Version | 0.19.1 |
URL | nix-rust/nix#1541 |
Date | 2021-09-27 |
Patched versions | ^0.20.2,^0.21.2,^0.22.2,>=0.23.0 |
Unaffected versions | <0.16.0 |
On certain platforms, if a user has more than 16 groups, the
nix::unistd::getgrouplist
function will call the libc getgrouplist
function with a length parameter greater than the size of the buffer it
provides, resulting in an out-of-bounds write and memory corruption.
The libc getgrouplist
function takes an in/out parameter ngroups
specifying the size of the group buffer. When the buffer is too small to
hold all of the reqested user's group memberships, some libc
implementations, including glibc and Solaris libc, will modify ngroups
to indicate the actual number of groups for the user, in addition to
returning an error. The version of nix::unistd::getgrouplist
in nix
0.16.0 and up will resize the buffer to twice its size, but will not
read or modify the ngroups
variable. Thus, if the user has more than
twice as many groups as the initial buffer size of 8, the next call to
getgrouplist
will then write past the end of the buffer.
The issue would require editing /etc/groups to exploit, which is usually
only editable by the root user.
See advisory page for additional details.
mach is unmaintained
Details | |
---|---|
Status | unmaintained |
Package | mach |
Version | 0.3.2 |
URL | fitzgen/mach#63 |
Date | 2020-07-14 |
Last release was almost 4 years ago.
Maintainer(s) seem to be completely unreachable.
These may or may not be suitable alternatives and have not been vetted in any way;
See advisory page for additional details.
It appears I can't check current installed version of it. it just launches
I have tested battop on Linux and I found two issues:
Just a heads up, build fails now with any version of the battery crate < 0.7.5. It might be worth bumping versions and making another release so builds work when people use the release tarball. I made a note with a sed hack on the AUR for anyone trying to grab the package there.
Nice tool by the way, thanks for your work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.