Commit Graph

457 Commits

Author SHA1 Message Date
Clement Tsang 3252796f17
change: Allow e to also close expanded widgets
Allow `e` to toggle expansion, rather than only allowing it to open.
2020-08-22 17:31:19 -04:00
Clement Tsang 1a25fbb987
bug: fix freezing not affecting processes during search and sort
Fixes a bug where searching refreshed process data even when frozen.
2020-08-22 17:23:27 -04:00
Clement Tsang 3394b9ee66
feature: allow searching by state, add more keyword variants
Allows searching by state (`state = sleep`), and adds more keyword variants for searching: `cpu%`, `mem%`, `r/s`, `w/s`, matching the columns.
2020-08-22 15:38:13 -04:00
Clement Tsang c82f4d40b4
feature: Support memb (mem bytes) searching in processes
Supports searching by the new mem value.
2020-08-21 22:59:49 -04:00
Clement Tsang ff15649be7
refactor: remove kill command, use libc
Removes the kill command call and instead uses libc to manage killing processes.
2020-08-21 18:16:37 -04:00
Clement Tsang 7475f24a4e
feature: Add hook to properly clean up in the case of a kill call
Adds a hook to properly clean up the program in case the program gets SIGTERM'd.
2020-08-21 16:00:14 -04:00
Clement Tsang 1dc9346d3b
refactor: Remove ps calls
Removes and refactor ps calls that... should have not been there in the first place.
2020-08-21 01:33:12 -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
ClementTsang eb5ac54ad0 bug: fix not switching sort type when toggling % in mem 2020-08-17 15:52:09 -04:00
Clement Tsang 3c373d7129
feature: Add appox. total mem as an option for processes and basic mem
Adds a way to display the memory value as a column in the processes widget and the basic memory widget, rather than just the percentage.
2020-08-17 15:41:37 -04:00
Clement Tsang 59ce90f577
bug: Fix bug w/ parsing `/proc/{pid}/stats`
Fixes a bug caused by incorrectly reading the `/proc/{pid}/stats` file.  Due to splitting by whitespace, the string parsing was read incorrectly if the process also contained spaces.
2020-08-16 20:53:34 -04:00
Clement Tsang 08e49b63c1
refactor: Revert tui upgrade to 0.10
Reverts tui upgrade, there are some bugs and issues - namely, issues with rendering text.
We can revert this commit when those bugs are dealt with (should be fine after 0.10.1, tested building from the repo).
2020-08-16 04:25:59 -04:00
ClementTsang 9068108d0f bug: fix missing default battery layout during refactor 2020-08-16 03:08:09 -04:00
Clement Tsang d211c6474c
bug: Fix bug caused by hitting enter w/ a failed dd
This would cause the dd fields to get stuck due to never resetting.
2020-08-16 02:56:54 -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
ClementTsang 84f63f2f83 refactor: remove redundant newlines 2020-08-13 02:04:53 -04:00
Clement Tsang e1a7378386
change: Update macOS config dir
Update documentation and program to use the correct config directory as per the dirs package.
2020-08-12 02:15:57 -04:00
ClementTsang 6e38d73116 change: Refactor dd drawing code
This also slightly improves how we generate the widths/heights to be
less... terrible.

Note this is not done, unfortunately.  This requires tui-rs' wrapped
paragraph height PR to land and release so I can properly calculate the
height offsets.

See https://github.com/fdehau/tui-rs/pull/349 for details.
2020-08-12 00:27:02 -04:00
ClementTsang 60f4759494 change: Add WASD keys for widget selection movement 2020-08-11 21:19:55 -04:00
Clement Tsang d0cc6078df
deps: Update dependencies, drop MSRV
Update dependencies to most recent versions if applicable. Refactor to deal with breaking changes. Drop MSRV due to dependency issues, just support stable and later.
2020-08-11 20:22:39 -04:00
Clement Tsang 30bdaa6073
feature: add full command to process widget
This PR adds the ability to toggle between the process name and process path. Currently, this uses `P` as the modifier key.

Currently, the longer command names are dealt with by forcefully changing the width of the columns, but this can be handled in a more graceful manner IMO.
2020-08-07 04:29:20 -04:00
ClementTsang be6f824a43 clippy: clippy error due to redundant conversion
Fixes a redundant usize to usize conversion.
2020-07-06 02:36:24 -04:00
ClementTsang cef81d1b8d refactor: use fold to avoid clones in search for implied AND 2020-05-21 22:06:51 -04:00
ClementTsang c7edad91ed refactor: fix clippy error 2020-05-21 21:46:21 -04:00
ClementTsang b33ea11af2 bug: fix query not working for or, refactor a bit 2020-05-21 21:40:40 -04:00
ClementTsang 948c1206e9 chore: wrote better debugging printing for queries
This should make reading completed queries a bit easier for debugging
2020-05-21 16:55:51 -04:00
ClementTsang dcaef7ebc4 bug: fix incorrect parsing for process i/o calc
Cause was checking the wrong indices for values.  I thought I
had taken in a vector of strings that were just byte values,
but they actually contained the labels... oops.
2020-05-21 14:03:00 -04:00
Clement Tsang cf1d41c83a
feature: add back states to unmerged processes 2020-05-19 17:58:17 -04:00
ClementTsang e2e1ac3006 change: always highlight selected cpu 2020-05-18 23:36:58 -04:00
Clement Tsang e6379982f1
refactor: reduce unchecked type conversions to usize 2020-05-18 23:34:50 -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
ClementTsang 2ae2ebd6d8 deps: update sysinfo 2020-05-14 22:22:29 -04:00
ClementTsang 549d61b836 bug: add extra check for process cpu value to be >= 0 2020-05-13 00:15:41 -04:00
ClementTsang a8ed838726 refactor: use a nicer match statement in one spot 2020-05-11 22:52:35 -04:00
ClementTsang ce563542ee force SWAP and RAM labels to show even if at 0 2020-05-11 22:48:37 -04:00
Clement Tsang 137e3cea5f
bug: disk displays nothing on if IO fails to match
Obvious on macOS.
2020-05-11 22:34:35 -04:00
Clement Tsang 7b5685bf44
refactor: remove redundant empty checks in graphs
Now that the fix for empty data is patched in tui, these checks are
redundant.
2020-05-11 01:32:39 -04:00
ClementTsang 56d6771d1b refactor: re-enable tui-rs linear interpolation 2020-05-10 17:01:45 -04:00
Clement Tsang 90272777f7
change: hide table gap if widget height is small 2020-05-09 16:23:15 -04:00
ClementTsang e6181d4aa4 change: hide time legend if window gets too small 2020-05-09 14:54:23 -04:00
ClementTsang b253d0153b change: reallow spaces to represent "and" 2020-05-08 15:34:46 -04:00
Clement Tsang a71d991695
refactor: avoid using max checks, use saturating_sub instead 2020-05-07 01:09:24 -04:00
ClementTsang 9152ba3281 docs: make process help text consistent with README 2020-05-05 18:57:38 -04:00
Kim Brose 095fb7e54e
Update constants.rs 2020-05-05 20:45:43 +02:00
ClementTsang 38f4967a8a bug/change: removed space as and for now 2020-05-04 23:44:33 -04:00
ClementTsang c8afe0d4f8 chore: support MSRV of 1.40.0 2020-05-04 17:45:11 -04:00
ClementTsang a56156a8f2 bug: swap 'and' and 'or' calls around for correct precedence 2020-05-04 00:27:21 -04:00
ClementTsang 2a32bbac3b change: separated search and process widgets again 2020-05-04 00:03:11 -04:00
ClementTsang 83a4a15cd5 bug: fix broken case if quotes surrounded paren 2020-05-03 00:54:33 -04:00
ClementTsang 0986b96056 bug: made the regex error one line in search 2020-05-03 00:08:18 -04:00