Commit Graph

152 Commits

Author SHA1 Message Date
Clement Tsang
e393078691
bug: fix choosing an out of list bounds selecting the last entry (#717)
This is a simple bug fix that changes the behaviour of a scroll select
(and column select) to only update if the updated position is _within_
the bounds of the list (0 to the max index, inclusive). Prior to this,
all the implementations but the disk implementation would just bound the
change. This was both inconsistent with the disk scroll state, but also
jarring since this meant a user could click on seemingly empty space but
it would somehow click on the very last entry.

This change also unifies the scroll calculation function between all the
scroll select functions. Ideally we get rid of the intermediary
functions but that might require more refactoring than I want for this
fairly simple bug fix.

The column select scroll calculation was also changed to fit this
behaviour, but it does not use the same logic as the other scroll
states. What could be done in the future is a generic implementation for
direction (or maybe just "increment vs. decrement") to share it all.
2022-04-28 22:39:33 -04:00
Clement Tsang
d43bd6147d
bug: change as_ref() to build in Rust beta 1.61.0 (#711)
This changes various as_ref() calls as needed in order for bottom to successfully build in Rust beta 1.61, as they were causing type inference issues. These calls were either removed or changed to an alternative that does build (e.g. as_slice()).

Functionally, there should be no change.

For context, see:
- https://github.com/ClementTsang/bottom/issues/708
- https://github.com/rust-lang/rust/issues/96074
2022-04-27 18:34:49 -04:00
ClementTsang
adf1e2b216 docs: update changelog 2022-02-25 14:32:44 -05:00
Clement Tsang
8587af6936
uptick: 0.6.8 (#670)
Uptick to 0.6.8.
2022-02-01 21:01:32 -05:00
Clement Tsang
d7dc710ddb
uptick: 0.6.7 (#667)
Uptick to 0.6.7, with appropriate updates to the README and changelog.
2022-01-31 16:40:50 -05:00
Clement Tsang
9eabb061aa
feature: add basic page up/down scrolling (#646)
Adds page up/down scrolling support to respectively scroll up/down by a full page.

Note that this is mostly just to get the feature out for those interested, and is admittedly a bit rushed - I will be rewriting all logic involving event handling as part of state refactor anyways, so this will also get changed in the work done there, and therefore, I kinda just sped through this.
2021-12-27 18:23:11 -05:00
ClementTsang
eaff52c8a4 docs: Add comment/changelog about not including guest twice 2021-12-22 14:57:15 -05:00
Clement Tsang
5526fe738d
uptick: 0.6.6 (#638) 2021-12-22 14:18:50 -05:00
Clement Tsang
d32a74ec7e
bug: Fix process CPU calculation if /proc/stat CPU line has less values than expected (#637)
Addresses a potential case where processing would fail if there were missing values from the CPU line of `/proc/stat`, and allows it to successfully return.
2021-12-21 18:17:30 -05:00
Clement Tsang
e4339f1f2b
docs: Update changelog 2021-12-19 22:33:34 -05:00
Clement Tsang
8e5742d636
docs: try switching over to Cloudflare Pages (#632)
I would prefer for the project to not be under clementtsang.github.io/bottom, so let's try out CFP.
2021-12-19 15:26:10 -05:00
Clement Tsang
065ffdbc78
uptick: 0.6.5 (#628) 2021-12-19 13:04:10 -05:00
Clement Tsang
c7626057c9
uptick: 0.6.4 (#576) 2021-09-12 14:02:11 -04:00
Clement Tsang
aabbc4fd95
bug: fix crashes for kernel patch versions > 255 (#575)
Solved by updating procfs to 0.10.1. Thanks to hasali19 for finding and looking into this!
2021-09-12 13:48:01 -04:00
Clement Tsang
bacaca5548
change: add '/s' to network usage legend (#557)
Adds "/s" to the the network usage graph legend.
2021-07-23 19:51:45 -04:00
ClementTsang
bcbdc15b51 docs: update changelog for #551 2021-07-21 11:01:44 -04:00
Clement Tsang
812731ba00
uptick: 0.6.3 (#549)
Uptick README and documentation to 0.6.3.
2021-07-18 13:42:25 -04:00
Clement Tsang
7f24e62867
bug: switch over to procfs for linux mem usage (#547)
Swap to manually calculating the mem total and usage via procfs. The usage calculation is now:

total - (free + cached + buffers + slab_reclaimable - shmem)

This follows the same usage calculation as htop. See the PR for more details.
2021-07-17 21:25:05 -04:00
Clement Tsang
741054e84a
bug: fix inaccuracy in memory usage/total on macOS and Linux (#545)
Fixes the accuracy of the memory widget for Linux and macOS, and uses binary prefixes instead to be more accurate.

Regarding the first part, it turns out that the way I was calculating memory usage was *slightly* incorrect for a few reasons:

- Regarding macOS, it seems like the way I was determining usage (`usage = total - available`) is not the most accurate.  The better way of doing this is apparently `usage = wire + active`, where `wire` is memory always marked to stay in RAM, and `active` is memory currently in RAM.  This seems to be much closer to other applications now.

- Regarding Linux, this was somewhat due to two issues - one was that I should have used heim's own built-in function call to get how much memory was *used*, and the other is that when heim reads info from `meminfo`, it reads it in *kilobytes* - however, the values are actually in *kibibytes*.  As such, to get the value in kibibytes, you want to actually take it in kilobytes.

  While I've filed an issue for the library, for now, I'll just manually bandaid over this.  See https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-proc-meminfo for more info.

Both changes take more advantage of platform-specific methods, and as such, the change unfortunately adds some ugly platform-specific code blocks.

Side note, Windows Task Manager apparently (?) uses binary prefixes for the values behind the scenes, but displays decimal prefixes.  As such, now that we've switched to binary prefixes, it'll "seem" like the two aren't matching anymore since the units won't match, despite the values matching.
2021-07-15 18:28:41 -04:00
Clement Tsang
a9b4d42eef
docs + ci: Update changelog and ignore some files in CI (#527) 2021-06-27 16:58:55 -04:00
Clement Tsang
985959ec1c
uptick: 0.6.2 (#526) 2021-06-26 14:03:16 -04:00
Clement Tsang
1598654bef
bug: Divide Windows process cpu usage by number of processors (#525)
Fixes a bug displaying the CPU usage of a process in Windows due to not dividing by the number of processors.
2021-06-26 02:34:32 -04:00
Clement Tsang
b67c928f2b
docs: Switch to mike for versioning (#521)
Switches to mike to add versioning to docs.
2021-06-23 23:34:39 -04:00
Clement Tsang
3313e88334
bug: Fix battery widget color and mouse (#504)
Fixes two bugs causing the battery widget colours and mouse events to be broken.
2021-06-20 20:28:44 -04:00
Clement Tsang
b1b1e94e6b
uptick: 0.6.1 (#475) 2021-05-11 19:03:15 -04:00
Clement Tsang
0ac449e573
bug: forgot to create memory usage string when collapsed (#473)
Adds a line to actually build the string of the summed memory usage. I forgot to make the string after summing the values.
2021-05-11 01:38:36 -04:00
ClementTsang
5a41e0d70e docs: fix changelog entry 2021-05-09 19:21:11 -04:00
Clement Tsang
244a17cbef
uptick: 0.6.0 (#471)
Update versions to 0.6.0.
2021-05-09 17:51:05 -04:00
Clement Tsang
574c2c1df7
change: switch from sysinfo to heim for cpu usage in macOS and Windows (#467)
Due to #404, I've just moved all CPU usage calculations over to heim.
2021-05-09 01:39:42 -04:00
Clement Tsang
d4a18aea75
bug: Fix mouse hitboxes (#459)
Fixes the mouse hitbox checks overextending by 1. Also reverts the bandaid fix done for #458.
2021-04-23 23:13:42 -04:00
Clement Tsang
fcc478a1eb
bug: Fixes basic mode mouse hitboxes being broken (#458)
Fixes basic mode having broken click hitboxes (they were 1 unit too long in both directions). I'm pretty sure normal mode does too, but it's less noticeable due to bounding boxes.
2021-04-23 19:31:35 -04:00
Clement Tsang
f33bb42c5b
feature: Add mount filtering, rework filter priority logic (#455)
This PR accomplishes two things:

1. This PR aims to add mount_filter to the config file. This allows a user to filter their disk widget entries by the mount name as well; this was particularly a problem in trying to address #431.
2. A slight rework of how the filter system works due to the need of being able to manage two potentially conflicting filter sources, since the disk widget will now potentially filter on both the disk name and the mount name.

In regards to the second point, the new behaviour is as such:

1. Is the entry allowed through any filter? That is, does it match an entry in a filter where is_list_ignored is false? If so, we always keep this entry.
2. Is the entry denied through any filter? That is, does it match an entry in a filter where is_list_ignored is true? If so, we always deny this entry.
3. Anything else is allowed.

This main (breaking) change is really the third point. This would mean that temp_filter and net_filter, when set to allow listed entries with is_list_ignored = false, are kinda... useless, as a whitelist in the scenario of being the only filter is kinda pointless. But hopefully this shouldn't be a problem...?
2021-04-22 23:43:12 -04:00
Clement Tsang
cc03d57f37
change: Add decimal to disk values larger than 1GB (#451)
A bit of a followup to #449, this adds decimal places for values over 1GB in regards to disk usage. This affects the disk widget (for the read/write per second) and process widgets (total read, total write, read/write per second).
2021-04-09 16:14:01 -04:00
Clement Tsang
8c7e85b923
change: Tweak default light colour scheme (#450)
Removes/tweaks some really light colours that might cause issues with a white background. For example, yellow on white didn't look so great, so I adjusted the memory/rx colours for this mode.
2021-04-09 15:57:54 -04:00
Clement Tsang
edb29a43b9
change: Add decimal to actual memory usage in proc (#449)
This change adds a decimal + single digit to memory usage values over the 1 GiB threshold. Otherwise, there is no visible change.

(Note to self: implement the per-column width system soon, this change causes some values to potentially look a bit weird in mem-non-percent mode as it is if the value is really large, like 530.2GiB pushing right up against the column width, but it's currently tied to mem-percent mode. Ugh.)

Also revert a change made by accident where I switched to a decimal prefix system (GB) for memory values. This has been reverted back to a binary prefix (GiB).
2021-04-09 15:43:34 -04:00
Clement Tsang
5bd9e4f6ae
feature: Collapsing in tree mode sums usage to parent (#445)
For the process widget, we now sum the resource usage of the child processes on the parent entry when collapsing in tree mode.

Note that if you search to filter, and collapse, it will not sum the pruned values (values that cannot be seen).  This is partly because I'm a bit lazy, and partly because I think this behaviour makes sense.

For example, let's say I search for a process with 4 child processes "AA, AB, BA, BB", with CPU usage 0.1, 0.2, 0.3, 0.4 respectively.  Assume the parent process has 0 usage.

- Without filter, it sums to 1.0
- With a filter on A, it would sum to just 0.3
- With a filter on AA, it would sum to 0.1

I think this is fine because I'm treating this as summing any child that is still *visible* somehow.  Summing unseen values would probably be weird as it would look like it's not adding up.

Further note that if you had, say, a child "CC" with a usage of, say, 2.0, and its parent of "AB", and you searched for CC in our above example, you would get a sum of 2.2.  This is because AB is still visible by the fact that CC was the searched process, and AB must still exist (albeit faded out) in the tree hierarchy, and as such will still be displayed.
2021-04-05 01:19:17 -04:00
Clement Tsang
476aaff45c
change: Make proc widget unit consistent with disk (#443)
In particular, use non-binary prefixes for disk and memory usage in a process. Ideally everything is configurable by the user, but this is fine for now IMO until I can get around to doing in-app config.
2021-04-04 17:03:52 -04:00
Clement Tsang
eb6a737d34
feature: Rework network y-axis, linear interpolation for off-screen data (#437)
Rewrite of the y-axis labeling and scaling for the network widget, along with more customization. This still has one step to be optimized (cache results so we don't have to recalculate the legend each time), but will be done in another PR for sake of this one being too large already.

Furthermore, this change adds linear interpolation at the 0 point in the case a data point shoots too far back - this seems to have lead to ugly gaps to the left of graphs in some cases, because the left hand limit was not big enough for the data point. We address this by grabbing values just outside the time range and linearly interpolating at the leftmost limit. This affects all graph widgets (CPU, mem, network).

This can be optimized, and will hopefully be prior to release in a separate change.
2021-04-04 05:38:57 -04:00
Clement Tsang
53d8bdae32
feature: User info in proc widget for Unix-based systems (#425)
Adds users into the process widget (for Unix-based systems).  This shows only in non-grouped modes, similar to state.  Search is also supported.

In addition, a quick fix to prevent users from being in grouped mode when they tried to enter tree mode while grouped.
2021-02-28 17:40:55 -05:00
Clement Tsang
fe74328647
bug: Fix bugs with disk widget and disk encryption (#423)
Two issues were highlighted as a result of using either Void Linux with disk encryption, or just disk encryption on Linux in general:

Two fixes:
1. Fixes a failed `usage()` call in the `get_disk_usage` function from failing the entire result.  Now it only returns an entry with N/A results.  This occurred in some distros and disk encryption setups, for example, the one for Void Linux here: https://docs.voidlinux.org/installation/guides/fde.html.

2. Fixes a potential mapping issue with disk encryption on Linux in general.  Since the disk might map to `/dev/mapper/whatever`, but the I/O harvester was using another name, the mappings would not match.  As such, we now also check if a symlink exists; if it does, then we take it and work out the correct path.  This also fixes the disk name being wrong.
2021-02-24 20:23:35 -05:00
Clement Tsang
cb1191ff35
deps: Update various deps as per 2021-02-19 (#420)
Major update is tui-rs from 0.13 to 0.14.  This change allows us to update our tables to make them look nicer!
2021-02-19 17:57:39 -05:00
Clement Tsang
f2975c3a7c
change: Don't jump to top when using sort shortcuts (#418)
For consistency, we now don't automatically jump to the top of the list when using a sort shortcut. This behaviour already occurred with the sort menu and sorting by mouse clicks, so this is just now more consistent (and IMO less annoying, you can also always jump to the top via gg).
2021-02-19 01:22:19 -05:00
Clement Tsang
e6c9187928
bug: Fix sorting menu and sort shortcuts not syncing in gui (#417)
Fixes sorting menus and shortcuts not syncing correctly if the sorting window is open.
2021-02-19 01:02:21 -05:00
Clement Tsang
e6230ef156
bug: fix inconsistent spacing with grouped vs non-grouped in the process widget (#416)
Fixes grouped mode having different spacing than non-grouped mode.
2021-02-18 19:15:07 -05:00
Clement Tsang
4db39da75e
feature: Add mouse support to sorting columns (#413)
Adds mouse support for sorting columns within the process widget. You can now click on the column header to sort (or invert the sort).
2021-02-18 17:10:51 -05:00
Clement Tsang
cf14abe37d
feature: Add ctrl-w and ctrl-h support in the search (#409)
Ctrl-w deletes one word backwards from the current cursor location. Ctrl-h is just an alias for backspace.
2021-02-16 18:07:41 -05: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
c94e1e821b docs: Reorder some of the changelog items 2021-01-31 14:19:26 -05:00
ClementTsang
425f4877de docs: Update changelog, revert formatting typo in README 2021-01-30 20:26:38 -05:00
Clement Tsang
d48e6cd7e0
bug: Workaround for strange rendering when there are <4 CPU entries reported (#398)
So it seems that tui-rs doesn't like rendering my CPU bars if the height is exactly 1. It needs at least 2. I have no idea why, this is probably something weird with how I render.

This, of course, breaks when there is only one row to report (i.e. with a dual core setup in #397).

The workaround switches the gap between the CPU and mem/net parts to 0, and increases the CPU's draw height by 1, only when the height is otherwise 1 (so the draw height is now at least 2). This does have the side effect of including an extra line to the side borders, but I think it's fine.
2021-01-25 02:21:33 -05:00