Commit graph

930 commits

Author SHA1 Message Date
Clement Tsang
b0cb308106
refactor: flatten IoCounter return value (#1253)
* refactor: rewrite io stats collection function result

* refactor: flatten IoCounters vector results
2023-07-11 01:18:58 -04:00
Justin Martin
b1a39026fb
add zfs io counters for linux and freebsd (#1248)
* 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
2023-07-09 17:50:22 -04:00
Clement Tsang
a10b91239b
bug: missing windows syscall to close the handle on drop when killing (#1245)
* bug: missing windows syscall to close the handle on drop when killing

* changelog

* fix
2023-07-05 01:40:12 -04:00
Clement Tsang
f21ffde068
other: removes the percent sign from battery widget labels (#1244) 2023-07-04 01:44:17 -04:00
Clement Tsang
beef65a460
other: remove the percentage sign for CPU usage in CPU widget (#1243) 2023-07-04 01:35:39 -04:00
Clement Tsang
df3088e80e
other: hide battery tab selector if there is only one battery (#1236)
* other: hide battery tab selector if there is only one battery

* update changelog
2023-07-02 00:38:40 -04:00
Clement Tsang
3f53818c54
other: remove some unnecessary vec allocations (#1234)
* other: remove unnecessary vector allocations in farmer

* other: remove unnecessary vector allocations when drawing tui Rows
2023-07-01 03:28:23 -04:00
Clement Tsang
9c368815dd
deps: bump deps as of 2023-06-29 (#1233)
* deps: bump deps as of 2023-06-29, clean up Cargo.toml a bit

* fix deprecated function call
2023-06-29 00:48:49 -04:00
Clement Tsang
aa191a981d
bug: fix core dump if the terminal is closed while bottom is open (#1230)
* 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
2023-06-27 01:57:32 -04:00
Clement Tsang
4ac3b43260
docs: update time-related documentation (#1222)
* docs: update time-related documentation

* fix retention too
2023-06-24 01:36:36 -04:00
Clement Tsang
cc3833289f
feature: support human times for rate (#1221) 2023-06-23 03:42:16 -04:00
Clement Tsang
0b7f4c745d
other: fix humantime-related documentation, add tests, support numbers + strings in toml (#1220)
* 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
2023-06-22 00:01:01 -04:00
Clement Tsang
6f1a8f7e5b
bug: fix overflow/underflow with graph timespan zoom (#1219)
* bug: fix overflow/underflow with graph timespan zoom

Basically, you could overflow/underflow the time span which would skip
checks.

* changelog
2023-06-21 00:03:48 -04:00
Clement Tsang
9e97680131
other: revert color help text change (#1217)
Didn't mean to push this, reverting it.
2023-06-19 02:40:48 -04:00
Clement Tsang
751abecfe3
other: take ownership of config and matches when building App (#1215)
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.
2023-06-19 01:47:57 -04:00
Clement Tsang
594e091a93
bug: fix arguments being unsorted (#1216)
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.
2023-06-19 01:37:22 -04:00
Clement Tsang
7c0eda1034
other: use f32 for process percentage values (#1212)
* 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
2023-06-18 02:11:57 -04:00
Clement Tsang
d6b6e0aea9
refactor: move out bits/bytes enum to utils (#1211) 2023-06-17 02:08:11 -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
531e26ea45
other: post-0.9.2 cleanup (#1203)
* other: some cleanup

* other: add conditional logging macros

* more cleanup

* use compile-time feature for some text in clap
2023-06-12 01:01:07 -04:00
Clement Tsang
9560722318
feature: on Linux, check coretemp and don't fail fast with name generation when gathering temps (#1188)
* 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
2023-06-11 18:12:15 -04:00
Clement Tsang
9ec95a9740
ci: add a build check for aarch64-linux-android (#1124)
* 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
2023-06-11 02:01:56 -04:00
Clement Tsang
2a354f772f
other: remaining changes needed to get android to build (#1199)
* other: remaining changes needed to get android to build

* update changelog

* simplify disk os-specific code
2023-06-11 01:35:16 -04:00
Clement Tsang
2ba7394ac2
other: have dummy fallback for disk I/O for unsupported OSes (#1198) 2023-06-11 00:01:14 -04:00
Clement Tsang
13a8e5bf0e
refactor: redo how we do get processes between different OSes (#1197)
* 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
2023-06-10 01:44:15 -04:00
database64128
48422c4111
bug: ntfs3 mounts don't show up (#1191)
Partitions mounted using the ntfs3 driver in linux (mainlined since 5.15)
won't show up because the name didn't match.
2023-06-08 13:07:18 -04:00
Clement Tsang
1cc0e910b4
refactor: remove outdated collection thread code (#1190)
This was going to be used for in-app config, but it's so old that it's
probably better to just rip it out and start anew in that regard.
2023-06-08 02:48:29 -04:00
Clement Tsang
f0121e6af4
other: enforce unused_imports lint again (#1189)
* 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
2023-06-08 02:28:36 -04:00
Clement Tsang
086b622c66
feature: use better names for duplicate temp sensors found by /sys/class/thermal (#1187)
* docs: update changelog

* feature: add a counter to duplicate names if using /sys/class/thermal/

* update changelog
2023-06-08 00:05:30 -04:00
Clement Tsang
358bddf990
bug: when getting Linux temps, don't bail ASAP if they fail (#1186)
* 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
2023-06-07 21:47:05 -04:00
Clement Tsang
5e0900584b
refactor: change canvas macOS check to compile-time (#1184) 2023-06-04 00:18:24 -04:00
Clement Tsang
c6d322263e
other: fix links and broken references in doc comments (#1182) 2023-06-03 05:44:52 -04:00
Clement Tsang
852e2e86c7
refactor: remove typed-builder (#1181) 2023-06-02 00:53:38 -04:00
Clement Tsang
4e99f31ad0
deps: bump ratatui to 0.21.0 (#1178) 2023-05-31 00:21:55 -04:00
Clement Tsang
74953455dc
refactor: clean up some Linux proc collection code (#1179) 2023-05-31 00:21:34 -04:00
Clement Tsang
635e82a8a2
refactor: remove typed builder from App struct (#1176)
Another one on the chopping block. This also moves out the app
widget logic to a separate struct.
2023-05-28 00:46:13 -04:00
Clement Tsang
eccaf11937
feature: support human times for default_time_value and time_delta (#1172)
* feature: support human times for time interval and default range

* add tests, fix not using ms

* appease clippy

* changelog
2023-05-26 00:42:40 -04:00
Clement Tsang
6b9663a2c2
other: clean up some fixmes (#1171) 2023-05-26 00:19:28 -04:00
Clement Tsang
69318465ae
other: simplify termination/event loop logic (#1169)
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.
2023-05-25 00:13:04 -04:00
Clement Tsang
b6dc17cfb3
other: clean up thread event code (#1170) 2023-05-24 01:05:49 -04:00
Clement Tsang
caa1d1b88b
refactor: remove procfs (#1163)
* refactor: remove procfs, use personal impls/rustix directly

* buffer sharing

* inline

* some cleanup
2023-05-21 00:53:27 -04:00
Clement Tsang
8a49c49267
refactor: remove TypedBuilder for col (#1162)
* refactor: remove TypedBuilder for col

* clean up basic
2023-05-20 01:27:42 -04:00
Clement Tsang
463b0fbef8
refactor: remove TypedBuilder for widget (#1159)
* refactor: remove TypedBuilder for widget

* group together cpu

* clean up proc too
2023-05-18 05:45:07 -04:00
Clement Tsang
a1a48bc647
refactor: remove TypedBuilder for col row (#1158) 2023-05-17 02:43:08 -04:00
Clement Tsang
b9c106c9cf
refactor: remove unused typed-builder proc macro usage in options (#1156) 2023-05-16 00:03:34 -04:00
Clement Tsang
3a8d85d487
refactor: use macros for initializing canvas styles (#1149)
* refactor: use macros for initializing canvas styles

* add quotes

* Simplify macro

* update tests

* more renaming
2023-05-13 05:22:09 -04:00
Clement Tsang
bcca7e2621
bug: fix gruvbox cache colour being invalid (#1148)
* bug: fix gruvbox cache colour being invalid

* update changelog
2023-05-12 04:39:07 -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
a62fdc5e04
deps: bump clap to 4.2.7 and libc to 0.2.143 (#1136) 2023-05-07 04:35:42 -04:00
Clement Tsang
b60a62d5f0
other: keep running even if logger fails to initialize (#1132)
This just makes it so that even if the logger is enabled, if it fails to
initialize (e.g. read-only directory), bottom will still continue to
start up, and just print a warning that the logger encountered an issue.
2023-05-06 12:56:01 -04:00
Clement Tsang
4cdedffaee
other: use sysinfo for temps for android and ios (#1130) 2023-05-06 00:58:19 -04:00
Yuxuan Shui
80183b8b1c
feature: show running time of processes (#801)
* feature: show running time of processes

* fix clippy

* add time searching

* update changelog

* use safer duration for linux in case of 0

* some cleanup

* quick hack to deal with some Windows processes returning unix epoch time as start time

---------

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
2023-05-02 01:33:53 -04:00
Clement Tsang
605314d44c
feature: add customizable process columns (#1115)
* feature: add customizable process columns

* Add some tests and actual logic

* more tests

* update changelog

* update config field

* even more tests

* update documentation

* more testing
2023-04-29 19:21:48 -04:00
Clement Tsang
c99e98c6d3
other: edit some comments 2023-04-28 00:00:23 -04:00
Clement Tsang
109498c1db
deps: remove const_format dependency (#1114)
* deps: remove const_format dependency

I was importing it for just one use case, but I could just define the
const string manually and not pull it in at all.

* update husky entry
2023-04-23 00:53:21 -04:00
Clement Tsang
4a86b1c21b
refactor: add fallback process signal (#1112)
* refactor: add fallback process signal

* also update dialog logic to be able to fall back in some cases
2023-04-22 00:19:05 -04:00
Clement Tsang
8b81dfba47
bug: fix side borders in basic mode (#1110)
Seems like I broke this when migrating from tui-rs to ratatui. This just
uses explicit enum variants to set my side borders and a test to try and
make sure this doesn't happen again.
2023-04-21 00:07:45 -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
1c95411494
feature: add current battery charging state, update field names (#1106) 2023-04-19 00:46:57 -04:00
Clement Tsang
6ea3635b28
deps: migrate from tui to ratatui (#1086) 2023-04-16 00:04:16 -04:00
Clement Tsang
8c6ae3bbc7
other: update default config generation to show cache (#1102) 2023-04-15 02:01:35 -04:00
Clement Tsang
513024aefd
refactor: clean up data init sleep duration code (#1101)
* refactor: clean up data init sleep duration code

* const
2023-04-15 02:01:25 -04:00
Clement Tsang
20902e87b9
other: Speed up first draw and first data collection (#1100)
* other: add first draw immediately after initialization

Previously, I would only do the first draw after an event triggered, so
this just makes it so that I *always* draw once first. Some widgets look
a bit weird with no data, but this is fine I guess if we want to gain a
bit of responsiveness.

* other: potentially shorten first time to get data

* other: move event loop thread init earlier in app initialization
2023-04-15 00:15:36 -04:00
Twan Stok
1b1e80ec3c
feature: add buffer and cache memory (#1063)
* First implementation of cache memory data collection, mostly copied from RAM and swap implementations

* First implementation of cache memory display, copied from RAM and swap implementations. placed cache as second in the list as it is more similar to the RAM than any other item in the list

* expanded comment to explain method.

* rustfmt

* all cache-related code excluded on windows, in the process refactored src/data_conversion.rs convert_mem_label() to convert a single label instead of all at once

* better factoring-out of cache memory logic to allow individual disabling

* added --enable_cache_memory flag, disabled cache memory collection by default

* renamed CCH to CHE
not sure how i messed that up

* changelog updated

* Added command line flag documentation

* updated config file documentation

* specified that buffer and cache memory display does not work on windows

* resolved merge conflicts

* added documentation to cache memory data collection

* capitalized Windows

* implemented missing canvas styling logic

* fixed misplaced no-windows flag

* reduced colour collisions, as cache colour was the same as the first GPU colour

* made FIFTH_COLOUR constant windows-only

* Revert "made FIFTH_COLOUR constant windows-only"

This reverts commit 72698f1dd7.

* made FIFTH_COLOUR constant non-windows-only

* minor fix for basic mode row count

* Update src/app/data_harvester/memory/sysinfo.rs

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>

* Update src/canvas/widgets/mem_basic.rs

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>

* updated default_config.toml

* formatting

---------

Co-authored-by: ClementTsang <34804052+ClementTsang@users.noreply.github.com>
2023-04-12 22:51:41 -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
62474be52a
deps: bump once_cell and related dependencies (#1090)
* deps: bump once_cell and related dependencies

Now that we've removed heim, I can bump up other dependencies that
relied on newer versions of once_cell.

* Add some dhat code

* dhat gitignore
2023-04-11 03:22:32 -04:00
Clement Tsang
9edde9b133
refactor: migrate disk collection code off of heim, remove heim (#1064)
Migrates existing heim-based disk data collection code off of it to either sysinfo or vendored code based on heim/sysinfo/other sources. This also allows us to remove heim completely from bottom.

---

* refactor: fix some refresh code

* remove async from the freebsd code

* some file/implementation organization

Turns out sysinfo lacks a lot of data I need. I can still use it for the
Windows disk usage implementation, but I'm probably going to manually
implement macos/linux usage and all io usage stats.

* more restructuring

* Some other fixes

* remove futures

* ready for some big changes?

* big changes

* linux io + reads

* use lossy conversion for mount point

* add windows refresh

* so long heim, and thanks for all the fish

* fix filter behaviour, remove string allocation when reading lines

* rename unix -> system for more accurate file struct representation

* fix freebsd

* port generic unix partition code

* add bindings and fix errors

* finish macOS bindings for I/O

* disable conform check, this seems to... make disk I/O work on macOS?????

* fix linux

* add safety comments

* more comments

* update changelog

* changelog

* We're going full 0.9.0 for this

* update lock

* fix some typing

* bleh

* some file management

* hoist out get_disk_usage

* fix some stuff for Windows

* typing and remove dead code allow lint

* unify typing

* fix

* fix 2

* macOS fix

* Add bindings file for windows

* add windows implementation

* fix macos
2023-04-10 05:52:46 -04:00
Clement Tsang
37cb59e16f
deps: update some minor dependency versions (#1087)
* deps: update some minor dependency versions

Bump some dependency versions as of April 7, 2023. Note I skipped any
updates tied to futures as that's getting removed along with heim in the
near future (heh).

* fix rename on Windows from K32GetPerformanceInfo -> GetPerformanceInfo
2023-04-07 03:48:35 -04:00
Clement Tsang
36f55de4d2
other: add clippy lints to deny todo and unimplemented (#1085) 2023-04-05 00:41:59 -04:00
Clement Tsang
8814bc53e3
other: add test for multiple regexes in filter (#1082) 2023-04-03 01:47:57 -04:00
Clement Tsang
444d2f7ad7
deps: bump sysinfo to 0.28 (#1078)
* deps: update sysinfo to 0.28.0

* 0.28.1

* 0.28.2

* 0.28.3

* 0.28.4
2023-03-27 00:50:21 -04:00
Clement Tsang
7ee6da3776
refactor: unify on using bytes for the memory unit when harvesting (#1077)
* refactor: unify on using bytes for the memory unit when harvesting

* some ordering stuff that doesn't mean much

* some comments

* more fixes

* refactor: rename

* comments v2

* some more cleanup

* remove uninlined_format_args allow
2023-03-26 01:53:43 -04:00
Clement Tsang
358db119bb
refactor: clean up some data collection refresh code, refresh sysinfo lists on loop (#1076)
* refactor: clean up some data collection refresh/init code

* move out battery

* missing setting memory value for proc

* stop segfault on macos

* unit

* oopsie
2023-03-25 02:31:11 -04:00
Clement Tsang
ac0bf7ca96
deps: switch back to crossterm 0.26.1 with fix to double keypress (#1068) 2023-03-15 01:50:52 -04:00
Clement Tsang
c2d66af72f
clippy: appease clippy as of Rust 1.68.0 (#1055)
* clippy: fix derivable_impls clippy warning

This was done using `cargo clippy --fix`

* cargo fmt after autofix
2023-03-11 01:20:46 -05:00
Clement Tsang
82c0c3b0e5
refactor: use internal committed memory calculation for Windows (#1051)
* refactor: use internal committed memory calculation for Windows

* comments
2023-03-08 00:08:02 -05:00
Clement Tsang
10d7226b19
other: deny missing safety docs and add them (#1053) 2023-03-08 00:00:50 -05:00
Clement Tsang
b745684156
refactor: more data collection cleanup (#1047)
* refactor: more memory collection cleanup

* more cleanup

* clean up data_harvester, remove heim sensor flag

Separate out most individual components to separate functions. Also
remove Linux's usage of heim's sensors feature, since I wasn't using it
apparently.

* clean up GPU section

* fix cond

* fix feature flags

* more cleanup

* even more cleanup
2023-03-07 00:18:24 -05:00
Clement Tsang
8489c4bc10
refactor: Clean up memory collection code (#1045) 2023-03-05 02:31:45 -05:00
Justin Martin
3510563638
re-enable zfs feature (#1044) 2023-03-04 20:10:24 -05:00
Clement Tsang
994c11e3b3
refactor: migrate network collection to sysinfo (#1041)
* refactor: migrate network collection to sysinfo

* remove net feature from heim

* comments and changelog
2023-03-04 01:34:52 -05:00
Clement Tsang
caba611036
docs: update changelog and some comments (#1040) 2023-03-03 01:00:33 -05:00
Dmitry Valter
40288c181e
fix: is_list_ignored=false filters for network and temperature (#1037)
Use filter logic from network/sysinfo in temperature and network/heim
harvesters. Previously is_list_ignored=false filter configs would
silently accept every sensor and every interface.
2023-03-03 00:33:47 -05:00
Clement Tsang
8cc763cc1b
refactor: migrate memory collection to sysinfo for all platforms (#1036)
* cleanup

* refactor: remove heim memory code

* add missing updates, remove heim memory feature

* restrict export visibility

* some refactoring, remove smol

* gpu feature
2023-03-03 00:06:19 -05:00
Clement Tsang
c2d94900f3
deps: bump procfs to 0.15.1 (#1038) 2023-03-02 17:40:56 -05:00
Clement Tsang
f26d598410
refactor: migrate CPU from heim to sysinfo for all platforms (#1035)
* refactor: migrate CPU from heim to sysinfo for all platforms

* fix windows and macos imports

* simplify a bit of code

* cleanup
2023-03-02 00:03:54 -05:00
Clement Tsang
e8ae1a265a
other: switch to toml_edit (#1034) 2023-03-01 00:14:47 -05:00
Clement Tsang
44e52d6229
deps: bump nvml to 0.9.0 (#1032) 2023-02-27 19:37:35 -05:00
Clement Tsang
cabc594279
refactor: clean up some options code (#1029)
* remove some dead code

* use macros to help clean up clutter for binary flags

* add test

* group

* fix using gpu feature
2023-02-25 04:24:38 -05:00
Clement Tsang
78b1126fb4
other: move terminal check after the config check (#1027) 2023-02-20 00:57:09 -05:00
Clement Tsang
f1f07945f6
change: show process in tree if any ancestor or descendent matches (#1026)
* refactor: optimize kept list in tree to just store filtered values in a set

* change: show all direct children of a tree process children if the parent matches

* change: show process in tree if any ancestor or descendent matches
2023-02-20 00:15:16 -05:00
Clement Tsang
6d15f01009
other: support hw.temperature-based temps on FreeBSD (#1024)
* other: support hw.temperature-based temps for FreeBSD

* update changelog

* enable sysctl always for freebsd
2023-02-19 18:44:35 -05:00
Clement Tsang
f89b243589
feature: support 3-char hex colours (#1022) 2023-02-18 01:55:26 -05:00
Clement Tsang
edc61d428c
bug: fix selected text bg colour being wrong if only the fg colour was set (#1021)
* rename file to be more generic

* fix selected text BG colour being wrong by default

* update changelog

* add test for bug
2023-02-18 00:51:13 -05:00
Michael Bikovitsky
d956f336a9
feature: Add support for displaying process usernames on Windows (#1016) 2023-02-10 15:01:37 -05:00
spital
021a727f19
other: replace deprecated value_of and is_present in clap
* Upgrade clap to 3.2.2 to allow future fix warnings

* cargo fmt fix

* Replaced deprecated `value_of` and `is_present`, builds with no warnings, clap 3.2.2

* cargo fmt

* updated according to comments. builds fine, cargo test fine

* Match some versions

* Update Cargo.lock

* Fix typo, mb

---------

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
2023-01-31 19:34:52 -05:00
Clement Tsang
9ad1d8f0b4
other: ignore uninlined_format_args clippy lint for now (#1004) 2023-01-27 18:13:17 -05:00
Clement Tsang
635d173f49
other: explicitly style dd text colours (#995) 2023-01-20 20:53:27 -05:00
Clement Tsang
3aa4aa1c08
bug: fix axis labels not being styled (#994)
Fixes graph axis labels not being styled.
2023-01-20 18:50:20 -05:00
Clement Tsang
4870ff365a
refactor: change name of some stuff, add some comments (#992)
* some quick refactoring first

* add todo for bug report template
2023-01-20 00:08:02 -05:00
Clement Tsang
7f7a328977
other: refresh cpu for sysinfo users if proc is used (#991) 2023-01-20 00:07:52 -05:00
Clement Tsang
22e386a38c
other: re-enable disk usage split, update help menu (#963)
* Revert "other: revert disk usage change for now (#962)"

This reverts commit d3661c2320.

* some cleanup

* update help menu

* update screenshot

* update changelog wording

* Remove redundant newlines

* Use type system to ensure help constants match in size
2023-01-19 05:40:34 -05:00
Clement Tsang
639c93b4c8
other: switch to windows-rs for process killing (#985) 2023-01-18 01:43:08 -05:00
Rareș Constantin
f8db3403af
other: Dynamic battery widget (#975)
* Added dynamic battery widget

For bottom to know that there are no batteries on the system,
I added the battery::Manager to the options.rs file because
here is the first moment bottom verifies battery configuration
by reading the config file, which may or may not contain the
battery field, but for a better UX, it doesn't matter what bottom
finds in the config file now, if it doesn't retrieve battery data,
it just ignores the battery widget all together.
If needed, it can be adjusted so that if the config file contains
the battery field, it will still show the widget.

* CFG guarding for BATTERY module

I guarded the options.rs in two places for battery module that can be missing in the feature list.

Co-authored-by: RaresCon <RaresCon>
Co-authored-by: NitrogenDev <44950964+NitrogenDev@users.noreply.github.com>
2023-01-15 12:06:42 -05:00
Clement Tsang
571ec08291
other: skip battery duration draw if unknown (#974)
* other: skip battery duration draw if unknown

* increase others

* update changelog
2023-01-15 12:06:19 -05:00
Clement Tsang
d3661c2320
other: revert disk usage change for now (#962)
This is a temp change, this commit will be reverted after 0.7.1 comes out.
2023-01-05 23:22:45 -05:00
Clement Tsang
9303c1b52f
bug: further shrink battery time-to text (#960) 2023-01-05 21:36:45 -05:00
Clement Tsang
8f9097b90c
bug: fix CPU 'all' label missing on small sizes (#953)
Fixes the "All" label being missing on small windows.
2023-01-04 01:55:46 -05:00
Clement Tsang
0093a45be9
bug: reduce battery text cutoff in small windows (#952)
Fixes an issue where small windows would cause the battery to-X time to be cut off.
2023-01-04 01:27:15 -05:00
Clement Tsang
7c53f088c3
ci: add build hash to nightly builds for version (#951)
This adds the build hash to the btm -V output for nightly builds, making it easier to troubleshoot when someone might have obtained a nightly build, and what commit it corresponds to.
2023-01-02 15:18:05 -05:00
Clement Tsang
a56e7f6cc9
feature: split usage into usage percentage and value (#950)
Denotes both usage and usage percentage. This also redoes the calculation for percentage to be based on the sum of avail + used, rather than on total, as otherwise we get potentially confusing percentages.
2023-01-01 05:08:04 -05:00
Clement Tsang
d7e9fd6be0
other: run rustfmt (#949) 2023-01-01 04:35:08 -05:00
Clement Tsang
b7bf57481f
docs: update demo to 0.7.0 (#941)
* docs: update demo to 0.7.0

* update again
2022-12-31 20:47:33 -05:00
Clement Tsang
3b5774117f
bug: fix search scrolling with wider Unicode characters. (#938)
This should help make search scrolling more reliable larger Unicode characters like CJK/flag characters.
2022-12-31 05:51:59 -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
21a21b86c0
ci: clean all workflow caches to script (#936) 2022-12-30 00:56:27 -05:00
Clement Tsang
32da5f39bb
bug: fix dot marker setting not being considered (#934)
* bug: fixes marker settings being ignored while rendering time charts

* appease clippy
2022-12-27 06:37:47 -05:00
Clement Tsang
07fd2152f4
docs: update changelog + docs for default expansion feature (#928) 2022-12-07 04:28:43 -05:00
Chon Sou
4272dd0c2d
feature: Adding default expanded option to commandline and config (#919)
* [#822] adding default expanded option to commandline and config

* refactoring (#919)

* nullifying default expanded when in basic mode (#919)
2022-12-06 19:34:41 -05:00
Clement Tsang
1920f4b2e1
other: add a redraw event on resize (#926) 2022-12-05 04:34:19 -05:00
Clement Tsang
ac5e2ce4a2
bug: fix incorrect text width calculation (#925)
* bug: fix incorrect text calculation

* actual fix, add tests

* appease clippy

* add link to inspiration
2022-12-05 04:21:37 -05:00
Clement Tsang
d3577bd1ab
other: don't draw on non-updating events (#924) 2022-12-03 01:18:47 -05:00
Clement Tsang
9c3e60e74f
other: slightly reduce the CPU time spent for draws (#918)
* other: group all dataset draws in a time chart

We used to draw each data set separately as a new canvas. Now, in one
canvas, we draw all datasets.

Note that this changes how dataset  lines are drawn - rather than
drawing one on top of another, it now draws kinda all at once. This
effect is *kinda* a bit better IMO, but it might also look a bit
more cluttered.

* other: optimize truncate_text

Flamegraphs showed that this area seems to be a bit heavy at times with
some inefficient use of iterators and collection. This change should
hopefully optimize this a bit by reducing some collections or
reallocations.

There can also be some further optimizations with less allocations from
callers.

* Reduce some redundant draws
2022-11-29 03:53:58 -05:00
Clement Tsang
913c9ed5c6
refactor: move widgets out of the app folder nesting (#917)
Moves the widget folder away from being nested in the app hierarchy.
2022-11-28 00:26:58 -05:00
Clement Tsang
8338a30752
bug: fix possible gaps with widget layout spacing (#916)
Fixes an occasional gap appearing due to how rect spacing was previously calculated.
2022-11-26 05:00:38 -05:00
Clement Tsang
27fc7a7768
other: change non-normalized shortcut (#912) 2022-11-22 05:12:35 -05:00
database64128
a0eebf3acb
bug: fix reading temperature from disabled devices (#911) 2022-11-21 15:36:06 -05:00
Clement Tsang
4f00434210
other: non-normalized process CPU% cleanup and docs (#910)
* refactor: simplify non-normalized code

* update docs

* appease clippy

* add comment

* unnormalized

* fix issues on non-Linux regarding typos/imports
2022-11-21 05:28:42 -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
database64128
71bc6c940e
feature: per-core process cpu usage percentage (#899) 2022-11-21 03:12:47 -05:00
ClementTsang
dd4b19866d
other: update Debian extended description 2022-11-20 03:22:22 -05:00
Clement Tsang
abff6e4a7a
bug: fix is_nan being incorrectly used to check for division by zero (#905) 2022-11-20 03:05:45 -05:00
Clement Tsang
63df220a38
other: clean up some strings (#904)
* other: clean up some strings

* formatting
2022-11-20 02:21:20 -05:00
Clement Tsang
6a0bf10760
other: some cleanup in proc widget (#903) 2022-11-20 01:13:24 -05:00
Clement Tsang
fd1badaf36
other: small linux process cleanup (#902) 2022-11-19 23:21:50 -05:00
Clement Tsang
b7ac83e926
other: shrink the timed data vector in addition to clearing (#900)
Should prevent the times series vector from possibly growing indefinitely.
2022-11-19 15:09:53 -05:00
Clement Tsang
f52b66a844
other: deduplicate sorts, always sort proc by PID first (#898)
* other: deduplicate sorts, sort proc by PID by default

* add proc test

* remove sort in Windows

* fix tree

* fix test

* Remove mut

* Add comment on sorting processes
2022-11-17 12:10:36 -05:00
Clement Tsang
a07fa305fb
bug: redirect stderr on FreeBSD to avoid drawing on UI (#897) 2022-11-17 03:18:05 -05:00
Clement Tsang
b2c301b1fe
deps: update sysctl to 0.5.2, procfs to 0.14.1 (#894) 2022-11-13 17:43:55 -05:00
Clement Tsang
17ca30c023
other: remove flume (#893)
In hindsight, pulling in flume is probably overkill and doesn't really
help much.
2022-11-13 01:59:45 -05:00
Clement Tsang
50768907ec
feature: add custom retention periods for data (#892)
* feature: add custom retention periods for data

* docs: update changelog

* docs: update docs
2022-11-13 01:51:10 -05:00
Clement Tsang
9dc6d0c0d5
other: remove the mouse throttler except for scroll events (#886)
The throttler is only really needed for scrolls (e.g. free scroll wheels
in Logitech mice), I don't really see it being needed in any other
contexts. Moves/drag is another one I guess but we outright ignore those
events right now.
2022-11-11 02:27:18 -05:00
Clement Tsang
99fc5fc2c8
refactor: run cargo +nightly fmt with group_imports (#885)
* refactor: add some disabled unstable fmt options

* run cargo +nightly fmt with group_imports

* separate out the cfg-specific imports for clarity
2022-11-10 01:22:19 -05:00
Clement Tsang
f5ec9191f2
other: try using flume for channel (#884) 2022-11-10 01:08:06 -05:00
Clement Tsang
938c4ccd52
feature: search paste support (#881)
* feature: add pasting to search

Supports pasting events to the search bar (e.g. shift-insert, ctrl-shift-v).

* update docs

* clippy

* comment

* Update process.md

* remove keyboard event throttle

* fix issues with cjk/flag characters
2022-11-10 00:40:04 -05:00
Clement Tsang
8101e6fa56
deps: Update tui to 0.19.0 and crossterm to 0.25.0 (#878)
* deps: update tui to 0.19 and crossterm to 0.25

* fix error

* handle breaking changes
2022-11-08 00:56:39 -05:00
Clement Tsang
7ae8e66a3a
ci: add cache clearing to PR merges (#874)
* ci: add cache clearing to PR merges

* some renaming

* small change to force cache

* add manual run option
2022-11-06 03:44:02 -05:00
ClementTsang
7f7d0cebf4
bug: fix spacing for disk table widget headers when sorting 2022-11-06 02:26:16 -05:00
Clement Tsang
36837ae8ac
feature: basic sortable disk (#870) 2022-11-06 01:34:32 -05:00
Clement Tsang
4d9f5093b2
feature: basic sortable temp (#868)
* feature: basic sortable temp

* add shortcuts

* fix missing shortcut names in header

* update changelog

* update docs
2022-11-05 19:32:14 -04:00