battop is an interactive viewer, similar to top, htop and other *top utilities,

but about the batteries installed in your notebook

battop

battop is an interactive viewer, similar to top, htop and other *top utilities, .

Features

  • Cross-platform (Linux, MacOS, FreeBSD and DragonflyBSD are supported and Windows is on the way)
  • Supports multiple batteries in case your notebook have them
  • It is free
  • Usually it just works!

battop is backed by a Rust crate battery which provides unified cross-platform information about system batteries.
Check it out, if you want to gather the same information for your application!

Installation

Arch linux

Install package from AUR with your favorite AUR helper:

$ yay -S battop

From sources

Clone the repo and run

$ cargo build --release

Other

Prebuilt binaries for Linux, FreeBSD and MacOS can be downloaded from the GitHub releases page.

Usage

Simply running the battop command in your terminal should do the thing.

Left and right arrows can be used to switch between different system batteries (if available).

Run the battop -h command to see the additional available options.

License

battop is double-released under the Apache License, Version 2.0 or the MIT License.

Donations

If you appreciate my work and want to support me, you can do it here

Issues

Collection of the latest Issues

github-actions[bot]

github-actions[bot]

0

Data race in Iter and IterMut

Details
Package thread_local
Version 0.3.4
URL https://github.com/Amanieu/thread_local-rs/issues/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.

github-actions[bot]

github-actions[bot]

0

Potential segfault in localtime_r invocations

Details
Package chrono
Version 0.4.19
URL https://github.com/chronotope/chrono/issues/499
Date 2020-11-10

Impact

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.

Workarounds

No workarounds are known.

References

See advisory page for additional details.

github-actions[bot]

github-actions[bot]

0

Potential segfault in the time crate

Details
Package time
Version 0.1.44
URL https://github.com/time-rs/time/issues/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

Impact

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.

Patches

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.

Workarounds

No workarounds are known.

References

time-rs/time#293

See advisory page for additional details.

github-actions[bot]

github-actions[bot]

0

Out-of-bounds write in nix::unistd::getgrouplist

Details
Package nix
Version 0.19.1
URL https://github.com/nix-rust/nix/issues/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.

foundObjects

foundObjects

0

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.

svartalf

svartalf

C-enhancement
8

This is a tracking issue for Windows support.

Main problem is that termion backend for tui dependency does not support Windows terminals.

Another option for tui - crossterm supports Windows and should be considered as a replacement.

mmstick

mmstick

C-enhancement
8

Whenever you're ready, I'll package and add this to our Pop repository. This seems like a very useful tool for us.

lozhn

lozhn

C-enhancement
3

Hi, is it possible to wrap the code into a brew formula for quick installation? Thanks.

Versions

Find the latest versions by id

Information - Updated Jun 23, 2022

Stars: 199
Forks: 6
Issues: 13

Coloring terminal output

term-painter is a cross-platform library for coloring UI terminals

Coloring terminal output

gpg-tui is a Terminal User Interface for GnuPG

Terminal User Interface for gpg provides but it tries to bring a more interactive approach to key management

gpg-tui is a Terminal User Interface for GnuPG
Linux

1.3K

In terminal graphical metrics for your *nix system written in Rust

Optional CPU, Memory, Network, and Disk usage charts

In terminal graphical metrics for your *nix system written in Rust

[email protected] starter kit for beacon termination

Capture beacon data from the browser, divert beacon request payloads to a log endpoint, and avoid putting load on your own infrastructure

Compute@Edge starter kit for beacon termination

Simple terminal interface for blocking websites via the /etc/hosts file

The binary is fully statically linked against musl-libc, so it should work

Simple terminal interface for blocking websites via the /etc/hosts file

A terminal filter to colorize output

pipecolor is a terminal filter to colorize output

A terminal filter to colorize output

Tuikit is a TUI library for writing terminal UI applications

Support non-fullscreen mode as well as fullscreen mode

Tuikit is a TUI library for writing terminal UI applications
CLI

781

A Terminal User Interface for Taskwarrior

Unless otherwise specified, you will need to install taskwarrior first

A Terminal User Interface for Taskwarrior
CLI

249

Ttyper is a terminal-based typing test built with Rust and tui-rs

For usage instructions, you can run ttyper --help

Ttyper is a terminal-based typing test built with Rust and tui-rs

Terminal plotting library for using in Rust CLI applications

Should work well in any unicode terminal with monospaced font

Terminal plotting library for using in Rust CLI applications
Facebook Instagram Twitter GitHub Dribbble
Privacy