* some consts
* change: use sysinfo's swap calculation for windows
I'll add an additional field for committed in a separate PR which shows
the previous value.
* refactor: flatten process config field
* other: clean up some doc formatting using indoc and breaklines
* fix broken test
* remove default as that breaks things for now
* add test
* more tests
* refactor: simplify some config -> constraints code
* iteratively progress...
* update bcr; this might need testing since I removed some old proc code
* widget side
* fix battery
* fix widget tests with bandaid for now
The issue was that the calculations assume a certain ratio for CPU
legends.
* add some tests
* bump up
* fix proc drawing issues
So with the proc widget in certain places, there would be a panic during
constraint determination.
Looks like back when I wrote this I made some gross assumptions about
certain things. In particular, the problem here was that the search
added an additional "one" height, so that needs to be accounted for
after we removed the "doubling" code.
* tests
* fix tests
* reorganize tests
* clippy
* fix cross tests not working
* fix builds for android
* fix sort function
* Try macros
* Revert "Try macros"
This reverts commit 93c7306f8a.
* use next_help_heading instead
* test
* Revert "test"
This reverts commit 017a1702b3.
* Reapply "test"
This reverts commit 23c09d3828.
* use foldl instead :)
* a word
* different conditionals
* update docs, change ordering
* more formatting stuff
* clean up Cargo.toml
* some small cleanup
* refactor: group together similar args in the help generation and code
This groups together related arguments in both the help text and the
code itself.
* update changelog
* clippy
* builder pattern instead
Make sure that bcachefs mounts are also displayed in the disks widget.
bcachefs is a file system that will be included in the upcoming Linux
v6.7 kernel. Briefly tested this and it works on my system.
* refactor: group together some canvas files
* rename file
* more shuffling around
* fmt
* more shuffling
Going to flatten widgets in another PR.
* some docs
* naming
* fmt
* refactor: iteratively detect ASCII and build string when truncating
* more tests
* test going by usize
* Revert "test going by usize"
This reverts commit 4fe71260e7.
* Add gpu util, power and procs.
Consolidated gpu calls into `data_harvester`.
Changed config flag from `enable_gpu_memory` to `enable_gpu`.
Added GPU utilization to the cpu widget.
Added GPU process memory usage and utilization percentage to the proc widget.
Added key binds for gpu process toggling.
Added GPU power usage to the battery widget.
Added bounds check to battery widget header.
Show battery widget header when `gpu_enable`.
Added feature flag `legacy-functions` to `nvml-wrapper`.
updated config file(s).
updated help text.
updated docs.
* Code Review:
Remove GPU util from cpu widget
Remove GPU power from battery widget
Use reference for gpu widgets_to_harvest
Extract match arm to function for feature gate
* Code Review: add gmem% toggle
* Do not poll gpu temp when filtered
* Code Review Two Changes:
adjust doc wordings
remove extra references
remove extra widget harvest checks
init proc gpu values
use convert_temp_unit for gpu temp
* Fixed uninlined args
First ran this, and fixed a few more similar issues by hand
```
cargo clippy --workspace --fix --benches --tests --bins -- -A clippy::all -W clippy::uninlined_format_args
```
Note that in a few cases, format args were passed by ref - which is actually a tiny perf hit - compiler would not be able to optimize them.
* revert change here
since it contains a non-inlineable variable I'm not a fan of using it partially here
* revert
given the other formats above/below I would prefer keeping it like this
---------
Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
* deps: use clap 4.4.0 to remove is-terminal
* fmt
* appease clippy
* fmt again
* Revert "deps: use clap 4.4.0 to remove is-terminal"
This reverts commit 78aa6ec848.
* add zfs io counters for linux and freebsd
* ci
* freebsd clippy
* code review: remove dead code for zfs feature gate of freebsd iocounters and squash if statement in zfs_io_counters
* bug: fix core dump if the terminal is closed
The cause was:
- bottom thinks it's panicking if the terminal is closed.
- The panic hook tried to print out to the terminal - but the terminal
was closed! It would unwrap and thus panic even harder.
- To solve this, we just make the panic hook calls not unwrap, since
honestly if they fail it's whatever as far as I understand it.
* update changelog
* update documentation and support either numerical times or human times for time_delta and default_time_value
* update docs
* give more human times on error
The clap matches/config struct was taken in as a reference when building
the App structure. However, we do not need to keep these around after
this, so we can instead take ownership of the match/config and drop it
after to save a bit of memory.
clap v4 apparently changed it so arguments are not sorted by default
like before - this manually sorts the arguments beforehand to achieve
the same effect.
* other: use f32 for process percentage values
This cuts down memory by a tiny bit, and we don't need a full f64 for
percentage values.
* fix for macos and windows
* feature: also check coretemp on Linux when gathering temps
* update changelog
* add comment
* add logic to check thermal zone if there are no hwmon entries
* cleanup
* handle duplicates between hwmon and thermal zone
* Revert "handle duplicates between hwmon and thermal zone"
This reverts commit 402606cc62f27ba196ef2ade6a669ae84aedf0e0.
* cleanup
* back to running thermal zone if no hwmon
* prevent failure cases
* temp logging
* name refactoring
* port dupe name logic to hwmon
* Cleanup, add fallback to sensor name
* more tests
* Fix log
* update changelog
* cleanup and more tests
* ci: add a build check for aarch64-linux-android
* appease clippy
* use 1.67.0 for Android due to NDK issue
* remove sparse since it is default now for 1.70 and causes issues with older versions anyway
* refactor: redo how we do some processes between different OSes
* cleanup
* more cleanup
* windows
* freebsd
* clean up linux more, fix broken FreeBSD import
* some more cleanup to remove some big imports
* other: enforce unused_imports lint again
I think there shouldn't be any issues with enforcing this now...
* set up cfg block so the logging feature doesn't break clippy
* some cleanup + comments
* bug: when getting Linux temps, don't bail ASAP if they fail
This meant that if hwmon failed, it would never try and get temperatures
from thermal or GPU. The same is true for thermal failing leading to GPU
never running.
* update docs
This just simplifies the logic around ctrl-c and termination logic and
event loop logic to something simpler and without the need for timeouts
and/or atomics.
Instead, we just make termination an event sent by ctrl-c and use the
same receiver for event handling to react to it and break the loop.