summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2022-09-16Replace heim with sysfs and dont wake devices (#805)Diana
* Replace heim with sysfs and dont wake devices This commit replaces heim sensor reading with manual sysfs sensor reading, and skips reading sensors for any device that is in ACPI D3cold This has the notable downside of still keeping a device awake, which I hope to solve in a later commit * Update docs They were referring to files i ultimately decided against using in this implementation, and so were no longer relevant to document. * has_temp check should be before reading hwmon_name * should_read_temp doesn't have to be mutable * Fix sensor for zenpower kernel module
2022-09-16deps: update sysinfo to 0.26.2 (#806)Clement Tsang
* deps: update sysinfo to 0.26.2 This dependency update has some nice things in store for us: - MacOS M1 temperature support - Bevy of bug fixes * update documentation * some fixes
2022-09-03other: Clarify help menu (#800)Clement Tsang
* other: clarify that numbers are for help menu * bug: fix incorrect overscroll check, should be min
2022-08-22feature: Add zfs feature flag for arc memory (#784)Justin Martin
* freebsd clippy * add arc support * Code Review: moved runtime cfg checks to compile time and formatting * remove compile platform checks * add zfs feature flag to get_arc_data
2022-08-15refactor: minor tweak to update_position codeClementTsang
2022-08-15feature: clamp scrolling (#775)ViridiCanis
* clamp scrolling when trying to go beyond the top or bottom * add more 'do nothing' cases to `update_position` * adjust tests to clamping scrolling * fixup! add more 'do nothing' cases to `update_position` * fixup! clamp scrolling when trying to go beyond the top or bottom * fixup! fixup! clamp scrolling when trying to go beyond the top or bottom
2022-08-14refactor: change max_scroll_index usage to better reflect name (#783)Clement Tsang
Tweaks `max_scroll_index` usage in the help menu to better reflect its name of being a max index, not a max index bound. For example, before, the index could not be equal to or more than `max_scroll_index`, but the name would have implied that it should be less than or equal to it.
2022-08-14Feature: half page scrolling (#774)ViridiCanis
* add ctrl-u/ctrl-d to process table * add help text for ctrl-u/ctrl-d * add ctrl-u/ctrl-d to help dialog * store height of help menu, fix overscroll with half page down on help menu Co-authored-by: ClementTsang <34804052+ClementTsang@users.noreply.github.com>
2022-08-13clippy: fix clippy eq warningClementTsang
2022-07-23Implement support for FreeBSD (#766)Wesley Moore
* WIP FreeBSD support * Implement get_cpu_data_list for FreeBSD * Implement disks for FreeBSD It doesn't work though as sysinfo doesn't make the device name available. * Use libxo to read process cpu info on FreeBSD * Populate get_io_usage with libxo too Actual I/O stats still aren't populated though as there's not an easy source for them. * Share more processes code between macos and freebsd * Extract function for deserializing libxo output on FreeBSD * Implement filtering of disks in FreeBSD * Clean up memory data collection * Update module docs
2022-07-07bug: fix total read/write units having /s (#763)Clement Tsang
Fixes the total read/write columns in processes using the wrong unit (having /s).
2022-06-29feature: add note on how to exit if running in non-terminal (#761)Clement Tsang
Addition to #760, adds an extra message so users know how to exit in this scenario.
2022-06-28feature: add check for whether the output is to a terminal (#760)Clement Tsang
Adds a warning if the user is calling bottom from an environment where the output is not a terminal.
2022-06-14docs: re-enable lib docs for development purposes (#750)Clement Tsang
Enables lib docs, primarily intended for dev use. Also change some existing documentation based on warnings (mainly broken/bare links).
2022-06-03refactoring: Move around components and state (#746)Clement Tsang
A small refactor to move some state/component files around in terms of file structure and code location. Should have no effect on logic.
2022-06-02refactor: unify all mod.rs structure to 2018 style (#742)Clement Tsang
This is a pretty small change, but at least _for now_, unifies all `mod.rs` use cases to the 2018 style for consistency. I personally don't mind going back to it on a case-by-case basis in the future if it results in cleaner code, though.
2022-05-17other: make the graph legend the same color as the graph (#732)Clement Tsang
This makes the graph legend the same color as the rest of the graph.
2022-05-16bug: hide user column for non-unixClementTsang
2022-05-16bug: fix a variety of bugsClementTsang
Bugs squashed: - Incorrect column sizing for flex cases - Case where the sort menu bounds were still existing despite being hidden - Proc widget not actually taking into account the calculated row widths in some cases during data conversion.
2022-05-15refactor: simplify partial ordering fn, clean up codeClementTsang
2022-05-15refactor: remove redundant get_ordering fn, add testsClementTsang
2022-05-15bug: fix issues with macos and windows during refactorClementTsang
2022-05-15other: delete redundant code, run clippy and fmtClementTsang
2022-05-15refactor: more work towards unifying process codeClementTsang
A bunch of work towards also refactoring how the process widget gathers and converts data.
2022-05-15refactor: begin migration of process widgetClementTsang
2022-05-15refactor: heavily simplify the old network legendClementTsang
2022-05-07refactor: move CPU graph over to new systemClementTsang
2022-05-07refactor: fix off-by-one bug with getting start positionClementTsang
2022-05-07refactor: per-row styling, remove seemingly redundant table codeClementTsang
2022-05-07refactor: don't draw header if too shortClementTsang
2022-05-07refactor: bind the start and end ranges for tablesClementTsang
2022-05-07refactor: remove unneeded freeze paramClementTsang
2022-05-07refactor: consolidate disk and temp table drawing, refactor stateClementTsang
Disk and temp tables now share the same drawing logic, as well as consolidating the "text table" states into one single state, as opposed to two separate states (one for scroll and one for width calculations). BTW I know this is kinda an ugly design - creating a giant struct to call a function - hopefully that's temporary, I want to do a bigger refactor to consolidate more stuff together and therefore avoid this problem, but baby steps, right?
2022-05-06deps: migrate to starship-battery (#724)Clement Tsang
Migrates the `battery` dependency to the more actively maintained `starship-battery` fork, found at https://github.com/starship/rust-battery. See https://github.com/svartalf/rust-battery/pull/92 for more information.
2022-05-01bug: fix panic if battery feature was disabledClementTsang
2022-04-29refactor: refactor some tests (#718)Clement Tsang
Small PR to quickly refactor some recent tests to avoid too much duplication.
2022-04-29Merge pull request #710 from ClementTsang/consolidate_component_drawingClement Tsang
Cleans up some drawing code and unifies all time graph drawing.
2022-04-28refactor: consolidate time graph componentsClementTsang
This consolidates all the time graph drawing to one main location, as well as some small improvements. This is helpful in that I don't have to reimplement the same thing across three locations if I have to make one change that in theory should affect them all. In particular, the CPU graph, memory graph, and network graph are all now using the same, generic implementation for drawing, which we call (for now) a component. Note this only affects drawing - it accepts some parameters affecting style and labels, as well as data points, and draw similarly to how it used to before. Widget-specific actions, or things affecting widget state, should all be handled by the widget-specific code instead. For example, our current implementation of x-axis autohide is still controlled by the widget, not the component, even if some of the code is shared. Components are, again, only responsible for drawing (at least for now). For that matter, the graph component does not have mutable access to any form of state outside of tui-rs' `Frame`. Note this *might* change in the future, where we might give the component state. Note that while functionally, the graph behaviour for now is basically the same, a few changes were made internally other than the move to components. The big change is that rather than using tui-rs' `Chart` for the underlying drawing, we now use a tweaked custom `TimeChart` tui-rs widget, which also handles all interpolation steps and some extra customization. Personally, I don't like having to deviate from the library's implementation, but this gives us more flexibility and allows greater control. For example, this allows me to move away from the old hacks required to do interpolation (where I had to mutate the existing list to avoid having to reallocate an extra vector just to insert one extra interpolated point). I can also finally allow customizable legends (which will be added in the future).
2022-04-28bug: fix choosing an out of list bounds selecting the last entry (#717)Clement Tsang
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-28refactor: remove dead config screen codeClementTsang
This code was never used and might as well be removed for clarity's sake.
2022-04-28refactor: remove trait usage in component drawingClementTsang
When I was newer to Rust, I got the weird impression that you couldn't add functionality to a struct outside of the defining file without using a trait. That's obviously not true, so it's high time I got rid of it and just made it part of the impl of the class itself, rather than declaring a trait and then exporting/importing it.
2022-04-27deps: update dependencies (#713)Clement Tsang
Updates various dependencies in both Cargo.toml and Cargo.lock.
2022-04-27bug: change as_ref() to build in Rust beta 1.61.0 (#711)Clement Tsang
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-03-27refactor: remove some simple as-casts (#697)Clement Tsang
Remove some simple as casts that are easy to change to .into(), or easy to check.
2022-03-20docs: shorten some of the -h help dialogClementTsang
2022-03-11other: add manpage file to cargo deb config, move back to build script (#693)Clement Tsang
Adds the asset for the manpage to cargo deb config. Also moves the generated manpage file to a .1.gz file. Also, moves back to a build script since that was causing some issues for the automatic Cargo.toml fields detection for manpage and completion generation. To prevent compilation from happening every time, and only in CI, we use an env var to avoid generation steps.
2022-03-07deps: update clap to 3.x (#690)Clement Tsang
Updates bottom to use clap 3.x, along with some small refactoring changes.
2022-03-07other: fix clippy lints on vector reference params (#689)Clement Tsang
Fixes a few clippy lints around function parameters and using slices over vector references.
2022-02-13Add support for nvidia GPUsshurizzle
2022-02-02Refresh sysinfo CPUFrederick Zhang
Without this now sysinfo `sys.processors().len()` returns 0.