I was mostly just using the time crate for local log debugging and just to avoid converting seconds to h/m/s.
This PR makes it so we are only using it for local log debugging.
A loooooong time ago (wow, it's been 4 years apparently...), I made the brilliant (/s) decision to use both lib.rs and main.rs because I was trying to add tests in the tests folder that needed private access to some functions in the src - and at the time, the only way I could think of doing so was exposing bottom as a library and a binary.
This isn't necessarily bad, but for my use case, it's pretty unnecessary nowadays (since I've moved all my tests back into the source files) and adds complexity in looking for certain things, so it's high time we move things around and remove lib.rs. I also took the time to clean up some weird code I spotted along the way.
* other: organize some utility function files
* deps: remove kstring
* refactor: some naming changes
* refactor: some more small refactoring/naming changes
* simplify to_cell to return a Cow
* enable lints
bottom doesn't have an MSRV, but if we can still build on older versions
of Rust then I'm all for it. The updated clap versions didn't bring
anything interesting so there's no real issue for me to downgrade IMO.
* 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
* 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
* 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