Commit Graph

57 Commits

Author SHA1 Message Date
Clement Tsang
5cf17f6015
other: flatten process config struct and clean up help text (#1395)
* 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
2024-01-21 05:47:13 -05:00
Clement Tsang
975e3d776b
refactor: move some files around in prep for a future options refactor (#1393)
* some formatting

* refactor: move some files around in prep for a bigger config/options refactor
2024-01-18 18:46:00 -05:00
Clement Tsang
be4fa27b84
refactor: convert layout creation tests back to being unit tests (#1392) 2024-01-16 23:47:05 -05:00
Clement Tsang
dd66ae774c
refactor: simplify some config -> constraints code (#1383)
* 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
2024-01-15 04:19:18 -05:00
Clement Tsang
c242b4aff3
refactor: move around some configuration code again (#1371) 2024-01-01 17:39:10 -05:00
Clement Tsang
228da99489
refactor: move around configuration-related files (#1370)
* rename general utils file

* refactor: move around some configuration files

* more shuffling around

* fix some ugly formatting
2024-01-01 17:20:40 -05:00
Clement Tsang
ecb6faa089
refactor: restructure canvas file folder structure (#1368)
* 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
2024-01-01 05:19:52 -05:00
Justin Martin
e4a6e751ec
feature: Add gpu proc info (#1276)
* 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
2023-11-19 23:54:15 -05:00
Yuri Astrakhan
1e16456d5f
chore: Minor cleanup - remove un-needed ident qualifiers (#1307)
Keep code a bit tidier and consistent (i.e. if an identifier already has a `use` entry above, why in some cases still prove a full path to it?)
2023-10-22 22:29:03 -04:00
Clement Tsang
e8f6d4853a
other: appease clippy after Rust 1.72.0 (#1281)
* 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.
2023-08-24 20:26:46 -04:00
Clement Tsang
cc3833289f
feature: support human times for rate (#1221) 2023-06-23 03:42:16 -04:00
Clement Tsang
2e5d59f84d
other: clean up some cfg usage (#1205)
* other: convert some cfg if

* fix
2023-06-13 01:25:20 -04:00
Clement Tsang
dae65bcd56
bug: fix certain custom column combinations causing issues (#1140)
* docs: update some docs related to processes

* bug: temp bandaid on column feature to avoid dupes issue
2023-05-09 19:20:34 -04:00
Clement Tsang
3618449d42
deps: update clap to 4.x (#1107)
* deps: update clap to 4.x

* changelog

* fix test

* add gpu feature/flag test
2023-04-21 00:07:34 -04:00
Clement Tsang
e61e5f2af6
deps: Switch to using hashbrown for general hashmap usage (#1092)
* deps: replace fxhash with hashbrown + ahash

* replace std hashmap with hashbrown + ahash

* fmt

* some more fmt
2023-04-12 00:03:27 -04:00
Clement Tsang
e8ae1a265a
other: switch to toml_edit (#1034) 2023-03-01 00:14:47 -05:00
Clement Tsang
f89b243589
feature: support 3-char hex colours (#1022) 2023-02-18 01:55:26 -05:00
Clement Tsang
efcf2bde29
other: use custom time chart grid implementation (#937)
Pulls in the tui-rs grid logic so I can implement custom braille painting logic. We basically "flatten" the layering logic into a single layer by replacing resetting cells if the colour is different. This avoids the multiple allocations if we used multiple layers as intended with tui-rs.

This gives us chart results similar to the current stable version, but with a flamegraph similar to the current master branch.
2022-12-30 03:06:48 -05:00
Clement Tsang
db07246f67
other: don't use manual map for color name mapping (#908)
* other: don't use manual map for color name mapping

I actually don't know why I was doing it like that before.

This commit removes the phf crate, as it's not needed anymore.

* update test
2022-11-21 03:34:33 -05:00
Clement Tsang
4ca68b621d
ci: fix missing target in tests (#757)
Fix missing target parameter for primary test targets (e.g. aarch64), and adjust integration tests to work with cross.
2022-06-27 01:36:45 -04:00
ClementTsang
798683b81f other: add test for battery flag if battery feature is off 2022-05-01 17:15:54 -04:00
Clement Tsang
d297ee4639
refactor: remove some simple as-casts (#697)
Remove some simple as casts that are easy to change to .into(), or easy to check.
2022-03-27 22:01:06 -04:00
Clement Tsang
01f6bddab6
deps: update clap to 3.x (#690)
Updates bottom to use clap 3.x, along with some small refactoring changes.
2022-03-07 22:53:02 -05:00
Randy Barlow
9acfacb5a5
Feature gate test_default_battery_movement
test_default_battery_movement() is now feature gated on the
battery feature.

fixes #581

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
2021-09-18 13:46:01 -04:00
Chloe Brown
cd1fe8b495 bug: Tests try to modify user home directory (#535)
Fixes a bug where running `cargo test` would try to create a
configuration file for the user.
2021-07-06 21:01:22 +01:00
Clement Tsang
fb7b1226fd
feature: add nord and nord-light colours (#406)
Adds colour schemes for Nord, along with a light variant.
2021-02-15 14:12:43 -05:00
ClementTsang
2d127f198e ci: uptick to 0.5.1, fix ci 2020-11-22 02:33:48 -05:00
Clement Tsang
e43456207b
feature: default colour schemes (#296)
Adds some default colour choices to choose from.
2020-11-15 05:16:47 -05:00
Clement Tsang
22278d7d75
other: aarch64 support (#217)
Adds theoretical aarch64 support.
2020-09-02 02:59:51 -04:00
ClementTsang
663ae6c5c2 bug: fix broken check from last commit, add tests 2020-09-01 03:08:46 -04:00
Clement Tsang
a4ddd649e1
refactor: Update error messages w/ anyhow and thiserror (#216)
Refactoring and updating of error messages + tests to be more useful.
2020-08-31 23:59:33 -04:00
Clement Tsang
3d2fc76aa2
feature: Add mouse click support for moving between widgets (#208)
Adds mouse support to the application, to move between widgets and click on elements.

List of things to added:

- Click to move between widgets
- Click to move between widgets in basic mode
- Click on widget entries
- Ability to disable mouse if you don't like it, I guess
2020-08-29 18:54:18 -04:00
Clement Tsang
4b03b4b0b0
refactor: Refactor code, add new tests
Refactor code so we use a lib, allowing for easier testing. Adds additional tests for layouts.
2020-08-19 16:32:33 -04:00
Clement Tsang
f3897f0538
feature: Allow sorting by any column
This feature allows any column to be sortable.

This also adds:
- Inverting sort for current column with `I`
- Invoking a sort widget with `s` or `F6`.  Close with same key or esc.

And:
- A bugfix in regards the basic menu and battery widget
- A lot of refactoring
2020-08-15 20:35:49 -04:00
Clement Tsang
12e4777d97
change: remove slash, change scroll behaviour on cpu
- Removal of the old slash-space-to-hide behaviour of CPU widget
- Scrolling onto a specific entry will only show that entry
- Showing average is now default
2020-05-16 22:38:19 -04:00
Clement Tsang
364049ee5f
chore: update travis a bit for msrv 2020-05-04 18:53:05 -04:00
ClementTsang
1ff2606c90 update tests to deal with msrv 2020-05-04 18:23:34 -04:00
ClementTsang
f4c6cb95e4 test: add config tests, update arg tests 2020-04-23 15:33:51 -04:00
ClementTsang
4d512afdae refactor: update arg tests to use new binary env 2020-04-23 13:29:10 -04:00
Clement Tsang
0b1d84fdf5
Add modularity to widget placement and inclusion (#95) 2020-04-01 20:31:43 -04:00
ClementTsang
648864176f Updated documentation, made error in args clearer 2020-03-10 01:51:28 -04:00
ClementTsang
e5588f1606 Add hiding time and autohiding time. 2020-03-09 00:52:29 -04:00
ClementTsang
78a05bc683 Fixes bug with too large inputs causing a panic
We would prefer a more graceful error message stating what went wrong.
Caught by the Travis test.
2020-03-08 22:27:41 -04:00
ClementTsang
f70cf02414 Add configurable default time and interval values
Also added documentation both in app and in the README.
2020-03-08 22:01:49 -04:00
ClementTsang
effd494683 Add two new tests; bit unrelated tbh. 2020-03-03 01:02:54 -05:00
ClementTsang
4c98fe4fde Refactoring. 2020-03-02 00:09:45 -05:00
ClementTsang
bbdd7786ce Optimized imports as per clion 2020-02-28 22:24:24 -05:00
ClementTsang
0697d9dd56 Fix issue with default file paths not being respected; updated default file paths. 2020-02-20 23:10:52 -05:00
Clement Tsang
d0a7a0dd72 Quick error change for processes to be a bit more graceful, fix tests 2019-12-30 22:39:49 -05:00
ClementTsang
f8209c9162 Update controls. 2019-12-15 00:17:15 -05:00