diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d26baed5..b5548664 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,60 +6,40 @@ labels: "bug" assignees: "" --- +Before you report, please take a look at [Troubleshooting](https://clementtsang.github.io/bottom/troubleshooting) to see if there's already an answer to your problem. + +Also, **please fill in all fields if possible** - if the issue is too hard to reproduce or vague, it may not be fixed! + ## Describe the bug -_A clear and concise description of what the bug is and what the expected behaviour was. If applicable, add screenshots to help explain your problem:_ +Give a high level description of the bug. -## How to reproduce +## What operating system/architecture are you using? -_Steps on how to reproduce the behaviour. Please try to include this section so I can reproduce your problem in order to fix it. If you are using any runtime flags (i.e. `btm --group`) please mention them as part of this.:_ +Please mention what operating system, version, and architecture you're experiencing the problem on (ex: macOS 10.13, x86_64). Please also ensure that your system is [on the list of supported systems](https://github.com/ClementTsang/bottom#support) - bug reports on unsupported systems are likely to be closed. -## bottom version +## What terminal are you using `bottom` on? -_Use `btm -V` and report the version of bottom you have installed. Also, if you're not on the latest version, please [try that](https://github.com/ClementTsang/bottom/releases/latest) and see if the problem is already resolved._ +Please mention what terminal/terminal emulator you are using `bottom` on (ex: Konsole, Kitty). -## bottom config file (if used) +## What version are you on? -_If you're using a config file, please include it in the report._ +Please ensure that the bug still exists on the [latest stable release](https://github.com/ClementTsang/bottom/releases/latest) or newer (i.e. nightly). If so, mention +what version you are using here. -## Installation method +## How did you install `bottom`? -_How did you install bottom? Note if it's not a supported method, I may not be able to help you._ +Please mention how you installed `bottom`. If you manually compiled it, please also mention your _Rust version_. -## Platform and environment information +## How can we reproduce this? -### Operating system, OS version, and architecture +Provide detailed steps on _how_ to reproduce your problem, to the best of your ability. Be as detailed as possible, and include config files or flags if relevant. +If maintainers cannot reproduce the bug, it will be very hard to fix it. -_Please specify your operating system, the version, and architecture, so I can try to replicate your environment as best as possible. Note that the officially supported platforms are:_ +## What is the actual behaviour? -- _macOS (`x86_64`)_ -- _Linux (`x86_64`, `i686`, `aarch64`)_ -- _Windows (`x86_64`, `i686`)_ +What is the _actual_ result of the given steps? Be detailed. Please include screenshots if the issue is a visual one. -_If your platform is not listed, please be aware I do not officially support it and may be unable to fix this issue._ +## What is the expected behaviour? -### Terminal (i.e. urxvt, kitty, etc.) - -_Sometimes this matters, so please mention your terminal/terminal emulator._ - -### Shell (i.e. zsh, bash, etc.) - -_Again, sometimes this matters, so please mention your shell type if possible._ - -### Miscellaneous system info - -_Not totally necessary, but if possible, include details like:_ - -_RAM size:_ - -_SWAP size:_ - -_CPU and number of cores:_ - -### Rust version - -_Check this with `rustc --version`. This is only relevant if your version of bottom isn't from a pre-built binary (i.e. Cargo). Otherwise, feel free to skip._ - -## Additional context - -_If anything hasn't been covered by the above categories, feel free to include it here:_ +What do you believe the expected behaviour should be given these steps? diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 49594883..827e2006 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Feature request -about: Got a good idea that hasn't already been mentioned? Suggest it! +about: Got a good idea that hasn't already been suggested? Mention it here! title: "" labels: "feature" assignees: "" @@ -8,8 +8,5 @@ assignees: "" ### Describe the feature request -_What is the feature of interest? Be clear and concise._ - -### Additional context/details - -_Provide any additional context or details here. What needs to be done, why, etc:_ +Please describe what behaviour you are looking for, the motivation for it, and use cases for where this feature would be helpful. +Try to be clear and concise - more details are usually helpful, but don't ramble on too much. diff --git a/.github/ISSUE_TEMPLATE/packaging.md b/.github/ISSUE_TEMPLATE/packaging.md new file mode 100644 index 00000000..3a13b560 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/packaging.md @@ -0,0 +1,13 @@ +--- +name: Packaging +about: For any issues, questions, or requests regarding packaging or distribution. +title: "" +labels: "packaging" +assignees: "" +--- + +## Details + +What is the issue? Please be clear and concise. + +Note: if this issue is about supporting a new package manager/installation method, please do consider maintaining it yourself and sending in a PR, and I'll be glad accept it! See [the documentation](https://clementtsang.github.io/bottom/contribution/packaging-and-distribution/) for more information. diff --git a/.github/ISSUE_TEMPLATE/packaging_template.md b/.github/ISSUE_TEMPLATE/packaging_template.md deleted file mode 100644 index 9a657c69..00000000 --- a/.github/ISSUE_TEMPLATE/packaging_template.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: Packaging -about: For any issues, questions, or requests regarding packaging or distribution. -title: "" -labels: "packaging" -assignees: "" ---- - -## Details - -_What is the issue? Please be clear and concise._ - -_Note: if this issue is about supporting a new package manager, please do consider maintaining it yourself and sending in a PR, and I'll be glad accept it! While I definitely want to support more ways of distribution, it gets quite challenging to support package managers for operating systems you don't even have installed..._ diff --git a/.github/ISSUE_TEMPLATE/question_template.md b/.github/ISSUE_TEMPLATE/questions.md similarity index 54% rename from .github/ISSUE_TEMPLATE/question_template.md rename to .github/ISSUE_TEMPLATE/questions.md index 67578f08..8e908c0f 100644 --- a/.github/ISSUE_TEMPLATE/question_template.md +++ b/.github/ISSUE_TEMPLATE/questions.md @@ -8,4 +8,4 @@ assignees: "" ### Question -_What do you want to ask in regards to this project? Note that if this is a feature request or a bug/issue report, please use the appropriate templates instead._ +What do you want to ask in regards to this project? Note that this is **not** the template to use if you have a bug report or feature request - use the appropriate templates instead. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 16a03ae8..9d07b495 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -24,6 +24,6 @@ _If relevant, ensure the following have been met:_ - [ ] _Areas your change affects have been linted using rustfmt (`cargo fmt`)_ - [ ] _The change has been tested and doesn't appear to cause any unintended breakage_ -- [ ] _Documentation has been added/updated if needed (README, help menu, etc.)_ +- [ ] _Documentation has been added/updated if needed (`README.md`, help menu, etc.)_ - [ ] _The pull request passes the provided CI pipeline_ - [ ] _There are no merge conflicts_ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..67d6c829 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,27 @@ +name: docs +on: + workflow_dispatch: + # inputs: + # version: + # description: "The documentation version to update. Defaults to nightly." + # default: "nightly" + # required: false + push: + branches: + - master + paths: + - 'docs/**' + - '.github/workflows/docs.yml' +jobs: + build-documentation: + name: Build and deploy docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - run: pip install mkdocs-material + - run: pip install mdx_truly_sane_lists + - run: cd docs/ + - run: mkdocs gh-deploy --force diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4c642504..d78f4767 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,6 +11,7 @@ on: isMock: description: "Mock nightly run, fill in with anything to trigger a mock build." default: "" + required: false jobs: create-github-release: diff --git a/.gitignore b/.gitignore index f08f998c..82cce855 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ deny.toml # vscode .vscode + +# mkdocs +site/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 01d3157e..0336185b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,73 +1,30 @@ # Contribution -If you want to contribute to this project - first of all, thank you! I'm glad to see interest in it! +Contribution in any way is appreciated, whether it is reporting problems, fixing bugs, implementing features, improving the documentation, etc. -Here are some notes about how to contribute to bottom (structure is based on the official -[Rust contribution guidelines](https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md)): +## Opening an issue -- [Feature reports](#feature-reports) -- [Bug reports](#bug-reports) -- [Other types of reports](#other-types-of-reports) -- [Pull requests](#pull-requests) +### Bug reports -## Feature reports +When filing a bug report, please use the [bug report template](https://github.com/ClementTsang/bottom/issues/new?assignees=&labels=bug&template=bug_report.md&title=) and fill in as much as you can. It is _incredibly_ difficult for a maintainer to fix +a bug when it cannot be reproduced, and giving as much detail as possible generally helps to make it easier to reproduce the problem! -Feature suggestions can be submitted using the "feature" tag. Prior to submission, please look to see if this has already been suggested or solved; if it has and is not resolved, it would be better to comment on the relevant report. +### Feature requests -Within your feature report, try to answer the given prompts - in particular, state the specific feature you want and if possible, please state why you want this added to the program. - -## Bug reports - -Bug reports can be submitted using the "bug" tag. Prior to submission, please look to see if this has already been reported or solved; if it has and is not resolved, it would be better to comment on the relevant report. - -Within your bug report, try to answer the given prompts. Be as specific as possible - describe your bug to the best of your ability, how to replicate it, and provide information like screenshots, OS and terminal. It can be very useful to help whoever is dealing with the issue! - -## Other types of reports - -For reports/suggestions that don't fit the definition of a feature or bug, try to use the other tags: - -- `documentation`: If you note a typo, or want to suggest something to do with the documentation of bottom, use this. -- `question`: If you have a question, and not really a suggestion or request, then use this tag. -- `ci`, `investigative`, `refactoring`: Generally, these are for internal use to track issues in order to manage GitHub Projects, and won't be the appropriate topic for a report. -- `other`: If your suggestion or issue doesn't fit those categories, then use this. +Please use the [feature request template](https://github.com/ClementTsang/bottom/issues/new?assignees=&labels=feature&template=feature_request.md&title=) and fill it out. Remember to give details about what the feature is along with why you think this suggestion will be useful. ## Pull requests -If you want to help contribute by submitting a PR, by all means, I'm open! In regards to the development process: +The expected workflow for a pull request is: -- I develop primarily using _stable_ Rust. That is, whatever is the most up-to-date stable version you can get via running - `rustup update stable`. +1. Fork the project. +2. Make your changes. +3. Make any documentation changes if necessary - if you add a new feature, it'll probably need documentation changes. See [here](./documentation.md) for tips on documentation. +4. Commit and create a pull request to merge into the `master` branch. **Please follow the pull request template**. +5. Wait for the tests to pass. These consist of clippy lints, rustfmt checks, and basic tests. **If you are a first time contributor, you may need to skip this step for now, as GitHub Actions requires approval to run.** +6. Ask a maintainer to review your pull request. If changes are suggested or any comments are made, they should probably be addressed. Once it looks good, it'll be merged! -- There are some tests, they're mostly for sanity checks. Please run `cargo test` to ensure you didn't break anything important, unless the change will break the test (in which case please amend the tests). +## Further reading - - Note that `cargo test` will fail on anything lower than 1.43.0 due to it using a then-introduced env variable. - -- I use both [clippy](https://github.com/rust-lang/rust-clippy) and [rustfmt](https://github.com/rust-lang/rustfmt) in development (with some settings, see [clippy.toml](./clippy.toml) and [rustfmt.toml](rustfmt.toml)). Note clippy must pass to for PRs to be accepted. - - - You can check clippy using `cargo clippy`. - - - I use [cargo-husky](https://github.com/rhysd/cargo-husky) to automatically run a `cargo clippy` check. - -- You may notice that I have fern and log as dependencies; this is mostly for easy debugging via the `debug!()` macro. It writes to the `debug.log` file that will automatically be created if you run in debug mode (so `cargo run`). - -And in regards to the pull request process: - -- Create a personal fork of the process and PR that, as per the [fork and pull method](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-collaborative-development-models). - -- Merge against the `master` branch. - -- If you encounter a merge conflict, I expect you to resolve this via rebasing to `master`. - -- _Ensure your change builds, runs, and works_. Furthermore, state how you checked this, including what platforms you tested on. - -- If your change will result in needing to update documentation, please do so. In particular: - - - Does the README need to be updated to accommodate your change? - - - Does the help action, `?`, need to be updated to accommodate your change? - -- Please ensure that CI passes. If it fails, check to see why it fails! Chances are it's clippy. - -- If all looks good, then request someone with write access (so basically me, [@ClementTsang](https://github.com/ClementTsang)) to give your code a review. If it's fine, then I'll merge! - -- Please use the [pull request template](https://github.com/ClementTsang/bottom/blob/master/.github/pull_request_template.md) to help you. +- For details on contributing to documentation, see [here](https://clementtsang.github.io/bottom/contribution/documentation/). +- For details on packaging and distribution, see [here](https://clementtsang.github.io/bottom/contribution/packaging-and-distribution/). diff --git a/FAQ.md b/FAQ.md deleted file mode 100644 index 8edc6858..00000000 --- a/FAQ.md +++ /dev/null @@ -1,18 +0,0 @@ -# FAQ - -- [My graphs look kinda weird with some extra dots, how do I fix this?](#braille-support) - -

-My graphs look kinda weird with some extra dots, how do I fix this? -

- -![example_image](https://user-images.githubusercontent.com/14301439/100946236-2db2f480-34c0-11eb-9f32-41202a8fe6e2.png) - -You'll have to make sure you have proper braille font support. For example, for Arch, you may have to -install ttf-ubraille and/or properly set it up for your terminal. - -- [Why can't I see all my processes/process usage on macOS?] - -You may have to run the program with elevated privileges - i.e. `sudo btm`. If you don't like doing -this repeatedly, you can manually force it to run with root each time - for example, following -[this related guide from the htop wiki](https://github.com/hishamhm/htop/wiki/macOS:-run-without-sudo). diff --git a/README.md b/README.md index ba98983d..5c696a87 100644 --- a/README.md +++ b/README.md @@ -1,137 +1,69 @@ # bottom -![ci](https://github.com/ClementTsang/bottom/workflows/ci/badge.svg) -[![crates.io link](https://img.shields.io/crates/v/bottom.svg)](https://crates.io/crates/bottom) +[CI status](https://github.com/ClementTsang/bottom/actions?query=branch%3Amaster) +[crates.io](https://crates.io/crates/bottom) +[documentation](https://clementtsang.github.io/bottom) A cross-platform graphical process/system monitor with a customizable interface and a multitude of features. Supports Linux, macOS, and Windows. Inspired by [gtop](https://github.com/aksakalli/gtop), [gotop](https://github.com/xxxserxxx/gotop), and [htop](https://github.com/htop-dev/htop/). -![Quick demo recording showing off searching, expanding, and process killing.](assets/demo.gif) _Theme based on [gruvbox](https://github.com/morhetz/gruvbox)_ (`--color gruvbox`). _Font is [IBM Plex Mono](https://www.ibm.com/plex/), terminal is [Kitty](https://sw.kovidgoyal.net/kitty/)._ +
+ Quick demo recording showing off searching, expanding, and process killing. +
+
+ Gruvbox theme (--color gruvbox) with IBM Plex Mono running on Kitty +
+
+
-**Note**: If you are reading this on the master branch, then it may refer to in-development or un-released features/changes. Please refer to [release branch](https://github.com/ClementTsang/bottom/tree/release/README.md) or [crates.io](https://crates.io/crates/bottom) for the most up-to-date _release_ documentation. +## Features -## Table of Contents +As (yet another) process/system visualization and management application, bottom supports the typical features: -- [Support](#support) - - [Compatibility](#compatibility) - - [Other known platform-specific issues](#other-known-platform-specific-issues) -- [Installation](#installation) - - [Manually](#manually) - - [Nightly](#nightly) - - [Cargo](#cargo) - - [AUR](#aur) - - [Debian](#debian) - - [Fedora/CentOS](#fedoracentos) - - [Gentoo](#gentoo) - - [Nix](#nix) - - [Solus](#solus) - - [MacPorts](#macports) - - [Homebrew](#homebrew) - - [Scoop](#scoop) - - [Chocolatey](#chocolatey) - - [winget](#winget) - - [Auto-completion](#auto-completion) -- [Usage](#usage) - - [Flags](#flags) - - [Keybindings](#keybindings) - - [General](#general) - - [Process bindings](#process-bindings) - - [Process search bindings](#process-search-bindings) - - [Process sort bindings](#process-sort-bindings) - - [Battery bindings](#battery-bindings) - - [Basic memory bindings](#basic-memory-bindings) - - [Process searching keywords](#process-searching-keywords) - - [Supported search types](#supported-search-types) - - [Supported comparison operators](#supported-comparison-operators) - - [Supported logical operators](#supported-logical-operators) - - [Supported units](#supported-units) - - [Other syntax](#other-syntax) - - [Mousebindings](#mousebindings) - - [General](#general-1) - - [CPU bindings](#cpu-bindings) - - [Process bindings](#process-bindings-1) -- [Features](#features) - - [Processes](#processes) - - [Process searching](#process-searching) - - [Process sorting](#process-sorting) - - [Tree mode](#tree-mode) - - [Zoom](#zoom) - - [Expand](#expand) - - [Basic mode](#basic-mode) - - [Config files](#config-files) - - [Config flags](#config-flags) - - [Theming](#theming) - - [Layout](#layout) - - [Disk, temperature, and network filtering](#disk-temperature-and-network-filtering) - - [Battery](#battery) -- [FAQ](#faq) -- [Contribution](#contribution) - - [Contributors](#contributors) -- [Thanks](#thanks) +- Graphical visualization widgets for: + + - CPU usage over time, at an average and per-core level + - RAM and swap usage over time + - Network I/O usage over time + + with support for zooming in/out the current time interval displayed. + +- Widgets for displaying info about disk capacity/usage, temperature sensors, and battery. + +- A widget for displaying, sorting, and searching info about processes, as well as support for: + + - Kill signals + - Tree mode + +- Cross-platform support for Linux, macOS, and Windows, with more planned in the future. + +- Customizable behaviour that can be controlled with command-line flags or a config file, such as: + + - Custom and pre-built colour themes + - Changing the default behaviour of some widgets + - Changing the layout of widgets + - Filtering out entries in disk and temperature widgets + +- And some other nice stuff, like: + - An htop-inspired basic mode + - Expanding widgets of interest + +You can find more details in [the documentation](https://clementtsang.github.io/bottom/usage/general-usage/). ## Support -Note that bottom is: +bottom _officially_ supports the following operating systems and corresponding architectures: -- Built and released using the most recent stable version of Rust -- Officially supports: - - macOS (`x86_64`) - - Linux (`x86_64`, `i686`, `aarch64`) - - Windows (`x86_64`, `i686`) +- macOS (`x86_64`) +- Linux (`x86_64`, `i686`, `aarch64`) +- Windows (`x86_64`, `i686`) -Operating systems, versions of Rust, or platforms that are outside of this list are -_not_ currently officially supported - even if it is built, tested, or works - and I may not be -able to fix bugs for these! +These platforms are tested to work for the most part and issues on these platforms will be fixed if possible. +Furthermore, binaries are expected to be built and tested using the most recent version of stable Rust. -### Compatibility - -The current compatibility of widgets with operating systems from personal testing: - -| OS | CPU | Memory | Disks | Temperature | Processes/Search | Networks | Battery | -| ------- | --- | ------ | ----- | ------------------------------------ | ------------------------------------------ | -------- | -------------------------------------------- | -| Linux | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| Windows | ✓ | ✓ | ✓ | ? (seems to require elevated access) | ✓ | ✓ | ✓ (seems to have issues with dual batteries) | -| macOS | ✓ | ✓ | ✓ | ✓ | ✓ (requires `sudo btm` to show everything) | ✓ | ✓ | - -### Other known platform-specific issues - -- M1-based macOS devices may have issues with temperature sensors not returning anything. - -- For now, WSL has an issue reporting total memory usage. - -- WSL and WSL2 (as far as I know) cannot correctly report temperature sensors. - -- WSL2 will not match Windows' own Task Manager, this appears to be due to how WSL2 works. +For more details on known problems and unsupported platforms, feel free to check out [the documentation page on support](https://clementtsang.github.io/bottom/support). ## Installation -### Manually - -There are a few ways to go about doing this manually. If you do so, please build using the current stable release of Rust. For example: - -```bash -# If required, update Rust on the stable channel -rustup update stable - -# Clone and install the newest master version all via Cargo -cargo install --git https://github.com/ClementTsang/bottom - -# Clone from master and install manually -git clone https://github.com/ClementTsang/bottom -cd bottom -cargo install --path . - -# Download from releases and install -curl -LO https://github.com/ClementTsang/bottom/archive/0.6.1.tar.gz -tar -xzvf 0.6.1.tar.gz -cargo install --path . -``` - -Or, you can just download the binary from the [latest release](https://github.com/ClementTsang/bottom/releases/latest). - -### Nightly - -You can install pre-release nightly versions [here](https://github.com/ClementTsang/bottom/releases/tag/nightly). Builds are generated every day at 00:00 UTC, based on the most recent commit on the master branch. - ### Cargo ```bash @@ -146,7 +78,7 @@ cargo install bottom --locked ### AUR -Normal package found [here](https://aur.archlinux.org/packages/bottom/), binary package found [here](https://aur.archlinux.org/packages/bottom-bin/): +The normal package can be found [here](https://aur.archlinux.org/packages/bottom/), while the binary package found [here](https://aur.archlinux.org/packages/bottom-bin/): ```bash yay -S bottom @@ -175,7 +107,7 @@ sudo dnf install bottom ### Gentoo -Available in [GURU](https://wiki.gentoo.org/wiki/Project:GURU) and [dm9pZCAq](https://github.com/gentoo-mirror/dm9pZCAq) overlays +Available in [GURU](https://wiki.gentoo.org/wiki/Project:GURU) and [dm9pZCAq](https://github.com/gentoo-mirror/dm9pZCAq) overlays: ```bash sudo eselect repository enable guru @@ -235,7 +167,7 @@ Since validation of the package takes time, it may take a while to become availa ```bash choco install bottom -# Version number may be required for newer releases, if available: +# The version number may be required for newer releases during the approval process: choco install bottom --version=0.6.1 ``` @@ -251,12 +183,38 @@ winget install bottom You can also manually do the same thing by going to the [latest release](https://github.com/ClementTsang/bottom/releases/latest) and installing via the `.msi` file. -You can uninstall via Control Panel or Options in Windows. +You can uninstall via Control Panel, Options, or `winget --uninstall bottom`. -### Auto-completion +### Building -Shell completions are included in binary releases, and are generated in the same directory as the -binary if bottom is manually built. +There are a few ways to go about doing this manually. Note that in all cases, you would want to build using the most recent version of stable Rust: + +```bash +# If required, update Rust on the stable channel +rustup update stable + +# Download from releases and install +curl -LO https://github.com/ClementTsang/bottom/archive/0.6.1.tar.gz +tar -xzvf 0.6.1.tar.gz +cargo install --path . + +# Clone from master and install manually +git clone https://github.com/ClementTsang/bottom +cd bottom +cargo install --path . + +# Clone and install the newest master version all via Cargo +cargo install --git https://github.com/ClementTsang/bottom +``` + +### Binaries + +You can also try to use the generated release binaries and manually install them: + +- [Latest stable release](https://github.com/ClementTsang/bottom/releases/latest), generated off of the release branch +- [Latest nightly version](https://github.com/ClementTsang/bottom/releases/tag/nightly), which is generated daily off of the master branch at 00:00 UTC + +The release binaries are packaged with shell auto-completion files for bash, fish, zsh, and Powershell. To install them: - For bash, move `btm.bash` to `$XDG_CONFIG_HOME/bash_completion or /etc/bash_completion.d/`. - For fish, move `btm.fish` to `$HOME/.config/fish/completions/`. @@ -264,541 +222,23 @@ binary if bottom is manually built. - For PowerShell, add `. _btm.ps1` to your PowerShell [profile](). -Some install scripts (i.e. AUR) will automatically do this for you. - ## Usage -Run using `btm`. +You can run bottom using `btm`. -### Flags +For help on flags, use `btm -h` for a quick overview or `btm --help` for more details. -Use `btm --help` for more information. +## Configuration -``` - --autohide_time Temporarily shows the time scale in graphs. - -b, --basic Hides graphs and uses a more basic look. - --battery Shows the battery widget. - -S, --case_sensitive Enables case sensitivity by default. - -c, --celsius Sets the temperature type to Celsius. - --color Use a color scheme, use --help for supported values. - -C, --config Sets the location of the config file. - -u, --current_usage Sets process CPU% to be based on current CPU%. - -t, --default_time_value Default time value for graphs in ms. - --default_widget_count Sets the n'th selected widget type as the default. - --default_widget_type Sets the default widget type, use --help for more info. - --disable_advanced_kill Hides advanced options to stop a process on Unix-like systems. - --disable_click Disables mouse clicks. - -m, --dot_marker Uses a dot marker for graphs. - -f, --fahrenheit Sets the temperature type to Fahrenheit. - -g, --group Groups processes with the same name by default. - -h, --help Prints help information. Use --help for more info. - -a, --hide_avg_cpu Hides the average CPU usage. - --hide_table_gap Hides the spacing between table headers and entries. - --hide_time Completely hides the time scaling. - -k, --kelvin Sets the temperature type to Kelvin. - -l, --left_legend Puts the CPU chart legend to the left side. - --mem_as_value Defaults to showing process memory usage by value. - --network_use_binary_prefix Displays the network widget with binary prefixes. - --network_use_bytes Displays the network widget using bytes. - --network_use_log Displays the network widget with a log scale. - --process_command Show processes as their commands by default. - -r, --rate Sets a refresh rate in ms. - -R, --regex Enables regex by default. - --show_table_scroll_position Shows the scroll position tracker in table widgets. - -d, --time_delta The amount in ms changed upon zooming. - -T, --tree Defaults to showing the process widget in tree mode. - --use_old_network_legend DEPRECATED - uses the older network legend. - -V, --version Prints version information. - -W, --whole_word Enables whole-word matching by default. -``` +bottom accepts a number of command-line arguments to change the behaviour of the application as desired. Additionally, bottom will automatically +generate a configuration file on the first launch, which one can change as appropriate. -### Keybindings - -#### General - -| | | -| ------------------------------------------- | ------------------------------------------------------------ | -| `q`, `Ctrl-c` | Quit | -| `Esc` | Close dialog windows, search, widgets, or exit expanded mode | -| `Ctrl-r` | Reset display and any collected data | -| `f` | Freeze/unfreeze updating with new data | -| `Ctrl-Left`
`Shift-Left`
`H`
`A` | Move widget selection left | -| `Ctrl-Right`
`Shift-Right`
`L`
`D` | Move widget selection right | -| `Ctrl-Up`
`Shift-Up`
`K`
`W` | Move widget selection up | -| `Ctrl-Down`
`Shift-Down`
`J`
`S` | Move widget selection down | -| `Left`, `h` | Move left within widget | -| `Down`, `j` | Move down within widget | -| `Up`,`k` | Move up within widget | -| `Right`, `l` | Move right within widget | -| `?` | Open help menu | -| `gg`, `Home` | Jump to the first entry | -| `Shift-g`, `End` | Jump to the last entry | -| `e` | Toggle expanding the currently selected widget | -| `+` | Zoom in on chart (decrease time range) | -| `-` | Zoom out on chart (increase time range) | -| `=` | Reset zoom | - -#### Process bindings - -| | | -| ------------- | ---------------------------------------------------------------- | -| `dd` | Kill the selected process | -| `c` | Sort by CPU usage, press again to reverse sorting order | -| `m` | Sort by memory usage, press again to reverse sorting order | -| `p` | Sort by PID name, press again to reverse sorting order | -| `n` | Sort by process name, press again to reverse sorting order | -| `Tab` | Group/un-group processes with the same name | -| `Ctrl-f`, `/` | Open process search widget | -| `P` | Toggle between showing the full command or just the process name | -| `s, F6` | Open process sort widget | -| `I` | Invert current sort | -| `%` | Toggle between values and percentages for memory usage | -| `t`, `F5` | Toggle tree mode | - -#### Process search bindings - -| | | -| ------------- | -------------------------------------------- | -| `Tab` | Toggle between searching by PID or name | -| `Esc` | Close the search widget (retains the filter) | -| `Ctrl-a` | Skip to the start of the search query | -| `Ctrl-e` | Skip to the end of the search query | -| `Ctrl-u` | Clear the current search query | -| `Ctrl-w` | Delete a word behind the cursor | -| `Ctrl-h` | Delete the character behind the cursor | -| `Backspace` | Delete the character behind the cursor | -| `Delete` | Delete the character at the cursor | -| `Alt-c`, `F1` | Toggle matching case | -| `Alt-w`, `F2` | Toggle matching the entire word | -| `Alt-r`, `F3` | Toggle using regex | -| `Left` | Move cursor left | -| `Right` | Move cursor right | - -### Process sort bindings - -| | | -| -------------- | ------------------------------- | -| `Down`, `j` | Scroll down in list | -| `Up`, `k` | Scroll up in list | -| `Mouse scroll` | Scroll through sort widget | -| `Esc` | Close the sort widget | -| `Enter` | Sort by current selected column | - -#### Battery bindings - -| | | -| -------------- | -------------------------- | -| `Left, Alt-h` | Go to the next battery | -| `Right, Alt-l` | Go to the previous battery | - -#### Basic memory bindings - -| | | -| --- | ------------------------------------------------------ | -| `%` | Toggle between values and percentages for memory usage | - -### Process searching keywords - -- None of the keywords are case sensitive. -- Use brackets to logically group together parts of the search. -- Furthermore, if you want to search a reserved keyword, surround the text in quotes - for example, `"or" or "(sd-pam)"` would be a valid search: - -![quote searching](assets/quote_search.png) - -#### Supported search types - -| Keywords | Example | Description | -| ------------------- | ------------------ | ------------------------------------------------------------------------------- | -| | `btm` | Matches by process or command name; supports regex | -| `pid` | `pid=1044` | Matches by PID; supports regex | -| `cpu`, `cpu%` | `cpu > 0.5` | Matches the CPU column; supports comparison operators | -| `memb` | `memb > 1000 b` | Matches the memory column in terms of bytes; supports comparison operators | -| `mem`, `mem%` | `mem < 0.5` | Matches the memory column in terms of percent; supports comparison operators | -| `read`, `r/s` | `read = 1 mb` | Matches the read/s column in terms of bytes; supports comparison operators | -| `write`, `w/s` | `write >= 1 kb` | Matches the write/s column in terms of bytes; supports comparison operators | -| `tread`, `t.read` | `tread <= 1024 gb` | Matches he total read column in terms of bytes; supports comparison operators | -| `twrite`, `t.write` | `twrite > 1024 tb` | Matches the total write column in terms of bytes; supports comparison operators | -| `user` | `user=root` | Matches by user; supports regex | -| `state` | `state=running` | Matches by state; supports regex | - -#### Supported comparison operators - -| Keywords | Description | -| -------- | -------------------------------------------------------------- | -| `=` | Checks if the values are equal | -| `>` | Checks if the left value is strictly greater than the right | -| `<` | Checks if the left value is strictly less than the right | -| `>=` | Checks if the left value is greater than or equal to the right | -| `<=` | Checks if the left value is less than or equal to the right | - -#### Supported logical operators - -Note that the `and` operator takes precedence over the `or` operator. - -| Keywords | Usage | Description | -| ------------------ | -------------------------------------------- | --------------------------------------------------- | -| `and, &&, ` | ` and/&&/ ` | Requires both conditions to be true to match | -| `or, \|\|` | ` or/\|\| ` | Requires at least one condition to be true to match | - -#### Supported units - -| Keywords | Description | -| -------- | ----------- | -| `B` | Bytes | -| `KB` | Kilobytes | -| `MB` | Megabytes | -| `GB` | Gigabytes | -| `TB` | Terabytes | -| `KiB` | Kibibytes | -| `MiB` | Mebibytes | -| `GiB` | Gibibytes | -| `TiB` | Tebibytes | - -#### Other syntax - -| Keywords | Usage | Description | -| -------- | ---------------------------------------------------- | -------------------------- | -| `()` | `( AND ) OR ` | Group together a condition | - -### Mousebindings - -#### General - -| | | -| ------ | ----------------------------------------------------------------------------------------------------- | -| Scroll | Table: Scroll
Chart: Zooms in or out by scrolling up or down respectively | -| Click | Selects the clicked widget, table entry, dialog option, or tab.
Can be disabled via options/flags. | - -#### CPU bindings - -| | | -| ------ | --------------------------------------------------------------------- | -| Scroll | Scrolling over an CPU core/average shows only that entry on the chart | - -#### Process bindings - -| | | -| ---------------------- | --------------------------------------------------------------------------------------------------- | -| Click on process entry | If in tree mode and you click on a selected entry, it toggles whether the branch is expanded or not | -| Click on table header | Sorts the widget by that column, or inverts the sort if already selected | - -## Features - -As yet _another_ process/system visualization and management application, bottom supports the typical features: - -- CPU usage visualization, on an average and per-core basis - -- RAM and swap usage visualization - -- Network visualization for receiving and transmitting - -- Display information about disk capacity and I/O per second - -- Display temperatures from sensors - -- Display information regarding processes, like CPU, memory, I/O usage, user, and process state - -- Process management (well, if process killing is all you need) - -It also aims to be: - -- Lightweight - -- Cross-platform - supports 64-bit Linux, Windows, and macOS - -In addition, bottom also currently has the following features: - -### Processes - -#### Process searching - -On any process widget, hit `/` to bring up a search bar. If the layout has multiple process widgets, note this search is independent of other widgets. - -![search bar image](assets/search_empty.png) - -By default, just typing in something will search by process name: - -![a simple search](assets/simple_search.png) - -This simple search can be refined by matching by case, matching the entire word, or by using regex: - -![a slightly better search](assets/regex_search.png) - -Now let's say you want to search for two things - luckily, we have the `AND` and `OR` logical operators: - -![logical operator demo with just ors](assets/or_search.png) - -![logical operator demo with ands and ors](assets/and_or_search.png) - -Furthermore, one is able to refine their searches by CPU usage, memory usage, PID, and more. For example: - -![using cpu filter](assets/usage_search.png) - -You can see all available keywords and query options [here](#process-searching-keywords). - -#### Process sorting - -You can sort the processes list by any column you want by pressing `s` while on a process widget: - -![sorting](assets/sort.png) - -#### Tree mode - -Use `t` or `F5` to toggle tree mode in a process widget. This is somewhat similar to htop's tree -mode. - -![Standard tree](assets/trees_1.png) - -Sorting works as well, but it is done per groups of siblings. For example, by CPU%: - -![Standard tree](assets/trees_2.png) - -You can also still filter processes. Branches that entirely do not match the query are pruned out, -but if a branch contains an element that does match the query, any non-matching elements will instead -just be greyed out, so the tree structure is still maintained: - -![Standard tree](assets/trees_3.png) - -### Zoom - -Using the `+`/`-` keys or the scroll wheel will move the current time intervals of the currently selected widget, and `=` to reset the zoom levels to the default. -Widgets can hold different time intervals independently. These time intervals can be adjusted using the -`-t`/`--default_time_value` and `-d`/`--time_delta` options, or their corresponding config options. - -### Expand - -Only care about one specific widget? You can go to that widget and hit `e` to make that widget expand and take -up the entire drawing area. You can minimize this expanded widget with `Esc` or pressing `e` again. - -### Basic mode - -Using the `-b` or `--basic_mode` (or their corresponding config options) will open bottom in basic mode. -There are no charts or expanded mode when using this, and tables are condensed such that only one table is displayed -at a time. - -![basic mode image](assets/basic_mode.png) - -Note custom layouts are currently not available when this is used. - -### Config files - -bottom supports reading from a config file to customize its behaviour and look. -By default, bottom will look at (based on [dirs](https://github.com/dirs-dev/dirs-rs#features)): - -| OS | Location | -| ----------------------------------------------------------------------- | -------- | -| `~/.config/bottom/bottom.toml` or `$XDG_CONFIG_HOME/bottom/bottom.toml` | Linux/macOS | -| `$HOME/Library/Application Support/bottom/bottom.toml` | macOS | -| `C:\Users\\AppData\Roaming\bottom\bottom.toml` | Windows | - -Note that if a config file does not exist at either the default location or the passed in location via `-C` or `--config`, one is automatically created with no settings applied. - -#### Config flags - -The following options can be set under `[flags]` to achieve the same effect as passing in a flag on runtime. Note that if a flag is given, it will override the config file. - -These are the following supported flag config values, which correspond to the flag of the same name described in [Flags](#flags): - -| Field | Type | Functionality | -| ---------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | -| `hide_avg_cpu` | Boolean | Hides the average CPU usage. | -| `dot_marker` | Boolean | Uses a dot marker for graphs. | -| `left_legend` | Boolean | Puts the CPU chart legend to the left side. | -| `current_usage` | Boolean | Sets process CPU% to be based on current CPU%. | -| `group_processes` | Boolean | Groups processes with the same name by default. | -| `case_sensitive` | Boolean | Enables case sensitivity by default. | -| `whole_word` | Boolean | Enables whole-word matching by default. | -| `regex` | Boolean | Enables regex by default. | -| `basic` | Boolean | Hides graphs and uses a more basic look. | -| `use_old_network_legend` | Boolean | DEPRECATED - uses the older network legend. | -| `battery` | Boolean | Shows the battery widget. | -| `rate` | Unsigned Int (represents milliseconds) | Sets a refresh rate in ms. | -| `default_time_value` | Unsigned Int (represents milliseconds) | Default time value for graphs in ms. | -| `time_delta` | Unsigned Int (represents milliseconds) | The amount in ms changed upon zooming. | -| `temperature_type` | String (one of ["k", "f", "c", "kelvin", "fahrenheit", "celsius"]) | Sets the temperature unit type. | -| `default_widget_type` | String (one of ["cpu", "proc", "net", "temp", "mem", "disk"], same as layout options) | Sets the default widget type, use --help for more info. | -| `default_widget_count` | Unsigned Int (represents which `default_widget_type`) | Sets the n'th selected widget type as the default. | -| `disable_click` | Boolean | Disables mouse clicks. | -| `color` | String (one of ["default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light"]) | Use a color scheme, use --help for supported values. | -| `mem_as_value` | Boolean | Defaults to showing process memory usage by value. | -| `tree` | Boolean | Defaults to showing the process widget in tree mode. | -| `show_table_scroll_position` | Boolean | Shows the scroll position tracker in table widgets. | -| `process_command` | Boolean | Show processes as their commands by default. | -| `disable_advanced_kill` | Boolean | Hides advanced options to stop a process on Unix-like systems. | -| `network_use_binary_prefix` | Boolean | Displays the network widget with binary prefixes. | -| `network_use_bytes` | Boolean | Displays the network widget using bytes. | -| `network_use_log` | Boolean | Displays the network widget with a log scale. | - -#### Theming - -The config file can be used to set custom colours for parts of the application under the `[colors]` object. The following labels are customizable with strings that are hex colours, RGB colours, or specific named colours. - -Supported named colours are one of the following strings: `Reset, Black, Red, Green, Yellow, Blue, Magenta, Cyan, Gray, DarkGray, LightRed, LightGreen, LightYellow, LightBlue, LightMagenta, LightCyan, White`. - -| Labels | Details | Example | -| ------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| Table header colours | Colour of table headers | `table_header_color="255, 255, 255"` | -| CPU colour per core | Colour of each core. Read in order. | `cpu_core_colors=["#ffffff", "white", "255, 255, 255"]` | -| Average CPU colour | The average CPU color | `avg_cpu_color="White"` | -| All CPUs colour | The colour for the "All" CPU label | `all_cpu_color="White"` | -| RAM | The colour RAM will use | `ram_color="#ffffff"` | -| SWAP | The colour SWAP will use | `swap_color="#ffffff"` | -| RX | The colour rx will use | `rx_color="#ffffff"` | -| TX | The colour tx will use | `tx_color="#ffffff"` | -| Widget title colour | The colour of the label each widget has | `widget_title_color="#ffffff"` | -| Border colour | The colour of the border of unselected widgets | `border_color="#ffffff"` | -| Selected border colour | The colour of the border of selected widgets | `highlighted_border_color="#ffffff"` | -| Text colour | The colour of most text | `text_color="#ffffff"` | -| Graph colour | The colour of the lines and text of the graph | `graph_color="#ffffff"` | -| Cursor colour | The cursor's colour | `cursor_color="#ffffff"` | -| Selected text colour | The colour of text that is selected | `scroll_entry_text_color="#ffffff"` | -| Selected text background colour | The background colour of text that is selected | `scroll_entry_bg_color="#ffffff"` | -| High battery level colour | The colour used for a high battery level (100% to 50%) | `high_battery_color="green"` | -| Medium battery level colour | The colour used for a medium battery level (50% to 10%) | `medium_battery_color="yellow"` | -| Low battery level colour | The colour used for a low battery level (10% to 0%) | `low_battery_color="red"` | - -#### Layout - -bottom supports customizable layouts via the config file. Currently, layouts are controlled by using TOML objects and arrays. - -For example, given the sample layout: - -```toml -[[row]] - [[row.child]] - type="cpu" -[[row]] - ratio=2 - [[row.child]] - ratio=4 - type="mem" - [[row.child]] - ratio=3 - [[row.child.child]] - type="temp" - [[row.child.child]] - type="disk" -``` - -This would give a layout that has two rows, with a 1:2 ratio. The first row has only the CPU widget. -The second row is split into two columns with a 4:3 ratio. The first column contains the memory widget. -The second column is split into two rows with a 1:1 ratio. The first is the temperature widget, the second is the disk widget. - -This is what the layout would look like when run: - -![Sample layout](assets/sample_layout.png) - -Each `[[row]]` represents a _row_ in the layout. A row can have any number of `child` values. Each `[[row.child]]` -represents either a _column or a widget_. A column can have any number of `child` values as well. Each `[[row.child.child]]` -represents a _widget_. A widget is represented by having a `type` field set to a string. - -The following `type` values are supported: - -| | | -| -------------------------------- | ------------------------ | -| `"cpu"` | CPU chart and legend | -| `"mem", "memory"` | Memory chart | -| `"net", "network"` | Network chart and legend | -| `"proc", "process", "processes"` | Process table and search | -| `"temp", "temperature"` | Temperature table | -| `"disk"` | Disk table | -| `"empty"` | An empty space | -| `"batt", "battery"` | Battery statistics | - -Each component of the layout accepts a `ratio` value. If this is not set, it defaults to 1. - -For an example, look at the [default config](./sample_configs/default_config.toml), which contains the default layout. - -Furthermore, you can have duplicate widgets. This means you could do something like: - -```toml -[[row]] - ratio=1 - [[row.child]] - type="cpu" - [[row.child]] - type="cpu" - [[row.child]] - type="cpu" -[[row]] - ratio=1 - [[row.child]] - type="cpu" - [[row.child]] - type="empty" - [[row.child]] - type="cpu" -[[row]] - ratio=1 - [[row.child]] - type="cpu" - [[row.child]] - type="cpu" - [[row.child]] - type="cpu" -``` - -and get the following CPU donut: -![CPU donut](./assets/cpu_layout.png) - -#### Disk, temperature, and network filtering - -You can hide specific disks, temperature sensors, and networks by name in the config file via `disk_filter` and `mount_filter`, `temp_filter`, and `net_filter` respectively. Regex (`regex = true`), case-sensitivity (`case_sensitive = true`), and matching only if the entire word matches (`whole_word = true`) are supported, but are off by default. Filters default to denying entries that match and can be toggled by setting `is_list_ignored` to `false` in the config file. - -For example, here's the disk widget with no filter: - -![Disk no filter](./assets/disk_no_filter.png) - -The following in the config file would filter out some entries by disk name: - -```toml -[disk_filter] -is_list_ignored = true -list = ["/dev/sda"] -regex = true -case_sensitive = false -whole_word = false -``` - -![Disk widget with just disk name filter](./assets/disk_name_filter.png) - -If there are two potentially conflicting filters (i.e. when you are using both a disk and mount filter), the filter that explicitly allows an entry takes precedence over a filter that explicitly denies one. So for example, let's say I set a disk filter accepting anything with `/dev/sda`, but deny anything with `/mnt/.*` or `/`. So to do so, I write in the config file: - -```toml -[disk_filter] -is_list_ignored = false -list = ["/dev/sda"] -regex = true -case_sensitive = false -whole_word = false - -[mount_filter] -is_list_ignored = true -list = ["/mnt/.*", "/"] -regex = true -case_sensitive = false -whole_word = true -``` - -Which gives me: - -![Disk widget with disk name and mount filter](./assets/disk_name_mount_filter.png) - -### Battery - -You can get battery statistics (charge, time to fill/discharge, consumption in watts, and battery health) via the battery widget. - -Since this is only useful for devices like laptops, it is off by default. You can either enable the widget in the default layout via the `--battery` flag, or by specifying the widget in a [layout](#layout): - -![Battery example](assets/battery.png) - -## FAQ - -Please see the [FAQ](./FAQ.md) for answers to frequently asked questions. +More details on configuration can be found [in the documentation](https://clementtsang.github.io/bottom/configuration/config-file/default-config/). ## Contribution -Contribution is always welcome! Please take a look at [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to help. +Whether it's reporting problems, documentation, or code, contribution is always welcome! Please read +[CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to contribute to bottom. ### Contributors @@ -841,10 +281,10 @@ Thanks to all contributors ([emoji key](https://allcontributors.org/docs/en/emoj ## Thanks - This project is very much inspired by [gotop](https://github.com/xxxserxxx/gotop), - [ytop](https://github.com/cjbassi/ytop), [gtop](https://github.com/aksakalli/gtop), and [htop](https://github.com/htop-dev/htop/). + [gtop](https://github.com/aksakalli/gtop), and [htop](https://github.com/htop-dev/htop/). - This application was written with many, _many_ libraries, and built on the work of many talented people. This application would be impossible without their work. I used to thank them all individually but the list got too large... -- And of course, thanks to all contributors! +- And of course, another round of thanks to all contributors and package maintainers! diff --git a/assets/and_or_search.png b/assets/and_or_search.png deleted file mode 100644 index e8b60490..00000000 Binary files a/assets/and_or_search.png and /dev/null differ diff --git a/assets/basic_mode.png b/assets/basic_mode.png deleted file mode 100644 index 1b74ca64..00000000 Binary files a/assets/basic_mode.png and /dev/null differ diff --git a/assets/battery.png b/assets/battery.png deleted file mode 100644 index 9bd21385..00000000 Binary files a/assets/battery.png and /dev/null differ diff --git a/assets/cpu_filter.png b/assets/cpu_filter.png deleted file mode 100644 index d6660710..00000000 Binary files a/assets/cpu_filter.png and /dev/null differ diff --git a/assets/cpu_layout.png b/assets/cpu_layout.png deleted file mode 100644 index 2d4403e4..00000000 Binary files a/assets/cpu_layout.png and /dev/null differ diff --git a/assets/or_search.png b/assets/or_search.png deleted file mode 100644 index 25347cf2..00000000 Binary files a/assets/or_search.png and /dev/null differ diff --git a/assets/quote_search.png b/assets/quote_search.png deleted file mode 100644 index f580335a..00000000 Binary files a/assets/quote_search.png and /dev/null differ diff --git a/assets/regex_search.png b/assets/regex_search.png deleted file mode 100644 index 91ca1a25..00000000 Binary files a/assets/regex_search.png and /dev/null differ diff --git a/assets/search_empty.png b/assets/search_empty.png deleted file mode 100644 index fb484ea5..00000000 Binary files a/assets/search_empty.png and /dev/null differ diff --git a/assets/simple_search.png b/assets/simple_search.png deleted file mode 100644 index 8a9a2284..00000000 Binary files a/assets/simple_search.png and /dev/null differ diff --git a/assets/sort.png b/assets/sort.png deleted file mode 100644 index e0803aab..00000000 Binary files a/assets/sort.png and /dev/null differ diff --git a/assets/trees_1.png b/assets/trees_1.png deleted file mode 100644 index 0bde6d1a..00000000 Binary files a/assets/trees_1.png and /dev/null differ diff --git a/assets/trees_2.png b/assets/trees_2.png deleted file mode 100644 index 8ef47895..00000000 Binary files a/assets/trees_2.png and /dev/null differ diff --git a/assets/trees_3.png b/assets/trees_3.png deleted file mode 100644 index d1832253..00000000 Binary files a/assets/trees_3.png and /dev/null differ diff --git a/assets/usage_search.png b/assets/usage_search.png deleted file mode 100644 index 5b5f753f..00000000 Binary files a/assets/usage_search.png and /dev/null differ diff --git a/docs/content/assets/screenshots/basic.png b/docs/content/assets/screenshots/basic.png new file mode 100644 index 00000000..5177932e Binary files /dev/null and b/docs/content/assets/screenshots/basic.png differ diff --git a/docs/content/assets/screenshots/battery.png b/docs/content/assets/screenshots/battery.png new file mode 100644 index 00000000..49947e30 Binary files /dev/null and b/docs/content/assets/screenshots/battery.png differ diff --git a/assets/disk_name_filter.png b/docs/content/assets/screenshots/config/disk-filtering/disk_name_filter.png similarity index 100% rename from assets/disk_name_filter.png rename to docs/content/assets/screenshots/config/disk-filtering/disk_name_filter.png diff --git a/assets/disk_name_mount_filter.png b/docs/content/assets/screenshots/config/disk-filtering/disk_name_mount_filter.png similarity index 100% rename from assets/disk_name_mount_filter.png rename to docs/content/assets/screenshots/config/disk-filtering/disk_name_mount_filter.png diff --git a/assets/disk_no_filter.png b/docs/content/assets/screenshots/config/disk-filtering/disk_no_filter.png similarity index 100% rename from assets/disk_no_filter.png rename to docs/content/assets/screenshots/config/disk-filtering/disk_no_filter.png diff --git a/assets/sample_layout.png b/docs/content/assets/screenshots/config/layout/sample_layout.png similarity index 100% rename from assets/sample_layout.png rename to docs/content/assets/screenshots/config/layout/sample_layout.png diff --git a/docs/content/assets/screenshots/cpu.png b/docs/content/assets/screenshots/cpu.png new file mode 100644 index 00000000..8c84b1de Binary files /dev/null and b/docs/content/assets/screenshots/cpu.png differ diff --git a/docs/content/assets/screenshots/disk.png b/docs/content/assets/screenshots/disk.png new file mode 100644 index 00000000..476bf5b1 Binary files /dev/null and b/docs/content/assets/screenshots/disk.png differ diff --git a/docs/content/assets/screenshots/memory.png b/docs/content/assets/screenshots/memory.png new file mode 100644 index 00000000..8c583e0e Binary files /dev/null and b/docs/content/assets/screenshots/memory.png differ diff --git a/docs/content/assets/screenshots/network/network.png b/docs/content/assets/screenshots/network/network.png new file mode 100644 index 00000000..47ce2da5 Binary files /dev/null and b/docs/content/assets/screenshots/network/network.png differ diff --git a/docs/content/assets/screenshots/network/network_old.png b/docs/content/assets/screenshots/network/network_old.png new file mode 100644 index 00000000..a5c86a73 Binary files /dev/null and b/docs/content/assets/screenshots/network/network_old.png differ diff --git a/docs/content/assets/screenshots/process/process_default.png b/docs/content/assets/screenshots/process/process_default.png new file mode 100644 index 00000000..1f15be5a Binary files /dev/null and b/docs/content/assets/screenshots/process/process_default.png differ diff --git a/docs/content/assets/screenshots/process/process_full.png b/docs/content/assets/screenshots/process/process_full.png new file mode 100644 index 00000000..1fbb9799 Binary files /dev/null and b/docs/content/assets/screenshots/process/process_full.png differ diff --git a/docs/content/assets/screenshots/process/process_grouped.png b/docs/content/assets/screenshots/process/process_grouped.png new file mode 100644 index 00000000..651c09b6 Binary files /dev/null and b/docs/content/assets/screenshots/process/process_grouped.png differ diff --git a/docs/content/assets/screenshots/process/process_sort_menu.png b/docs/content/assets/screenshots/process/process_sort_menu.png new file mode 100644 index 00000000..b48ce4f6 Binary files /dev/null and b/docs/content/assets/screenshots/process/process_sort_menu.png differ diff --git a/docs/content/assets/screenshots/process/process_tree.png b/docs/content/assets/screenshots/process/process_tree.png new file mode 100644 index 00000000..f70917f0 Binary files /dev/null and b/docs/content/assets/screenshots/process/process_tree.png differ diff --git a/docs/content/assets/screenshots/process/search/cpu.png b/docs/content/assets/screenshots/process/search/cpu.png new file mode 100644 index 00000000..911191b3 Binary files /dev/null and b/docs/content/assets/screenshots/process/search/cpu.png differ diff --git a/docs/content/assets/screenshots/process/search/or.png b/docs/content/assets/screenshots/process/search/or.png new file mode 100644 index 00000000..49f50665 Binary files /dev/null and b/docs/content/assets/screenshots/process/search/or.png differ diff --git a/docs/content/assets/screenshots/process/search/quotes.png b/docs/content/assets/screenshots/process/search/quotes.png new file mode 100644 index 00000000..8da3f4a3 Binary files /dev/null and b/docs/content/assets/screenshots/process/search/quotes.png differ diff --git a/docs/content/assets/screenshots/process/search/regex.png b/docs/content/assets/screenshots/process/search/regex.png new file mode 100644 index 00000000..c15eaff4 Binary files /dev/null and b/docs/content/assets/screenshots/process/search/regex.png differ diff --git a/docs/content/assets/screenshots/process/search/search.png b/docs/content/assets/screenshots/process/search/search.png new file mode 100644 index 00000000..a1f32dc1 Binary files /dev/null and b/docs/content/assets/screenshots/process/search/search.png differ diff --git a/docs/content/assets/screenshots/temperature.png b/docs/content/assets/screenshots/temperature.png new file mode 100644 index 00000000..4a75e862 Binary files /dev/null and b/docs/content/assets/screenshots/temperature.png differ diff --git a/docs/content/assets/screenshots/troubleshooting/dots.png b/docs/content/assets/screenshots/troubleshooting/dots.png new file mode 100644 index 00000000..ce7c779a Binary files /dev/null and b/docs/content/assets/screenshots/troubleshooting/dots.png differ diff --git a/docs/content/assets/screenshots/troubleshooting/no_braille.png b/docs/content/assets/screenshots/troubleshooting/no_braille.png new file mode 100644 index 00000000..1bedc2cd Binary files /dev/null and b/docs/content/assets/screenshots/troubleshooting/no_braille.png differ diff --git a/docs/content/assets/screenshots/troubleshooting/weird_braille.png b/docs/content/assets/screenshots/troubleshooting/weird_braille.png new file mode 100644 index 00000000..54f7d0c3 Binary files /dev/null and b/docs/content/assets/screenshots/troubleshooting/weird_braille.png differ diff --git a/docs/content/configuration/command-line-flags.md b/docs/content/configuration/command-line-flags.md new file mode 100644 index 00000000..ae99ad7c --- /dev/null +++ b/docs/content/configuration/command-line-flags.md @@ -0,0 +1,45 @@ +# Flags + +!!! Warning + + This section is in progress, and is just copied from the old documentation. + +The following flags can be provided to bottom in the command line to change the behaviour of the program (run `btm --help` for more information on each flag): + +| Flag | Behaviour | +| ------------------------------------- | -------------------------------------------------------------- | +| `--autohide_time` | Temporarily shows the time scale in graphs. | +| `-b, --basic` | Hides graphs and uses a more basic look. | +| `--battery` | Shows the battery widget. | +| `-S, --case_sensitive` | Enables case sensitivity by default. | +| `-c, --celsius` | Sets the temperature type to Celsius. | +| `--color ` | Use a color scheme, use --help for supported values. | +| `-C, --config ` | Sets the location of the config file. | +| `-u, --current_usage` | Sets process CPU% to be based on current CPU%. | +| `-t, --default_time_value ` | Default time value for graphs in ms. | +| `--default_widget_count ` | Sets the n'th selected widget type as the default. | +| `--default_widget_type ` | Sets the default widget type, use --help for more info. | +| `--disable_advanced_kill` | Hides advanced options to stop a process on Unix-like systems. | +| `--disable_click` | Disables mouse clicks. | +| `-m, --dot_marker` | Uses a dot marker for graphs. | +| `-f, --fahrenheit` | Sets the temperature type to Fahrenheit. | +| `-g, --group` | Groups processes with the same name by default. | +| `-h, --help` | Prints help information. Use --help for more info. | +| `-a, --hide_avg_cpu` | Hides the average CPU usage. | +| `--hide_table_gap` | Hides the spacing between table headers and entries. | +| `--hide_time` | Completely hides the time scaling. | +| `-k, --kelvin` | Sets the temperature type to Kelvin. | +| `-l, --left_legend` | Puts the CPU chart legend to the left side. | +| `--mem_as_value` | Defaults to showing process memory usage by value. | +| `--network_use_binary_prefix` | Displays the network widget with binary prefixes. | +| `--network_use_bytes` | Displays the network widget using bytes. | +| `--network_use_log` | Displays the network widget with a log scale. | +| `--process_command` | Show processes as their commands by default. | +| `-r, --rate ` | Sets a refresh rate in ms. | +| `-R, --regex` | Enables regex by default. | +| `--show_table_scroll_position` | Shows the scroll position tracker in table widgets. | +| `-d, --time_delta ` | The amount in ms changed upon zooming. | +| `-T, --tree` | Defaults to showing the process widget in tree mode. | +| `--use_old_network_legend` | DEPRECATED - uses the older network legend. | +| `-V, --version` | Prints version information. | +| `-W, --whole_word` | Enables whole-word matching by default. | diff --git a/docs/content/configuration/config-file/data-filtering.md b/docs/content/configuration/config-file/data-filtering.md new file mode 100644 index 00000000..0bbc7b45 --- /dev/null +++ b/docs/content/configuration/config-file/data-filtering.md @@ -0,0 +1,46 @@ +# Data Filtering + +!!! Warning + + This section is in progress, and is just copied from the old documentation. + +You can hide specific disks, temperature sensors, and networks by name in the config file via `disk_filter` and `mount_filter`, `temp_filter`, and `net_filter` respectively. Regex (`regex = true`), case-sensitivity (`case_sensitive = true`), and matching only if the entire word matches (`whole_word = true`) are supported, but are off by default. Filters default to denying entries that match and can be toggled by setting `is_list_ignored` to `false` in the config file. + +For example, here's the disk widget with no filter: + +![Disk no filter](/assets/config/disk-filtering/disk_no_filter.png) + +The following in the config file would filter out some entries by disk name: + +```toml +[disk_filter] +is_list_ignored = true +list = ["/dev/sda"] +regex = true +case_sensitive = false +whole_word = false +``` + +![Disk widget with just disk name filter](/assets/screenshots/config/disk-filtering/disk_name_filter.png) + +If there are two potentially conflicting filters (i.e. when you are using both a disk and mount filter), the filter that explicitly allows an entry takes precedence over a filter that explicitly denies one. So for example, let's say I set a disk filter accepting anything with `/dev/sda`, but deny anything with `/mnt/.*` or `/`. So to do so, I write in the config file: + +```toml +[disk_filter] +is_list_ignored = false +list = ["/dev/sda"] +regex = true +case_sensitive = false +whole_word = false + +[mount_filter] +is_list_ignored = true +list = ["/mnt/.*", "/"] +regex = true +case_sensitive = false +whole_word = true +``` + +Which gives me: + +![Disk widget with disk name and mount filter](/assets/screenshots/config/disk-filtering/disk_name_mount_filter.png) diff --git a/docs/content/configuration/config-file/default-config.md b/docs/content/configuration/config-file/default-config.md new file mode 100644 index 00000000..85fb3f42 --- /dev/null +++ b/docs/content/configuration/config-file/default-config.md @@ -0,0 +1,11 @@ +# Default Config + +A default config file is automatically generated at the following locations that bottom checks by default: + +| OS | Default Config Location | +| ------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| macOS | `$HOME/Library/Application Support/bottom/bottom.toml`
`~/.config/bottom/bottom.toml`
`$XDG_CONFIG_HOME/bottom/bottom.toml` | +| Linux | `~/.config/bottom/bottom.toml`
`$XDG_CONFIG_HOME/bottom/bottom.toml` | +| Windows | `C:\Users\\AppData\Roaming\bottom\bottom.toml` | + +Furthermore, if a custom config path that does not exist is given (using `-C` or `--config`), bottom will attempt to create a default config file at that location. diff --git a/docs/content/configuration/config-file/flags.md b/docs/content/configuration/config-file/flags.md new file mode 100644 index 00000000..e4896828 --- /dev/null +++ b/docs/content/configuration/config-file/flags.md @@ -0,0 +1,37 @@ +# Flags + +!!! Warning + + This section is in progress, and is just copied from the old documentation. + +Most of the [command line flags](../../command-line-flags) have config file equivalents to avoid having to type them out each time: + +| Field | Type | Functionality | +| ---------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | +| `hide_avg_cpu` | Boolean | Hides the average CPU usage. | +| `dot_marker` | Boolean | Uses a dot marker for graphs. | +| `left_legend` | Boolean | Puts the CPU chart legend to the left side. | +| `current_usage` | Boolean | Sets process CPU% to be based on current CPU%. | +| `group_processes` | Boolean | Groups processes with the same name by default. | +| `case_sensitive` | Boolean | Enables case sensitivity by default. | +| `whole_word` | Boolean | Enables whole-word matching by default. | +| `regex` | Boolean | Enables regex by default. | +| `basic` | Boolean | Hides graphs and uses a more basic look. | +| `use_old_network_legend` | Boolean | DEPRECATED - uses the older network legend. | +| `battery` | Boolean | Shows the battery widget. | +| `rate` | Unsigned Int (represents milliseconds) | Sets a refresh rate in ms. | +| `default_time_value` | Unsigned Int (represents milliseconds) | Default time value for graphs in ms. | +| `time_delta` | Unsigned Int (represents milliseconds) | The amount in ms changed upon zooming. | +| `temperature_type` | String (one of ["k", "f", "c", "kelvin", "fahrenheit", "celsius"]) | Sets the temperature unit type. | +| `default_widget_type` | String (one of ["cpu", "proc", "net", "temp", "mem", "disk"], same as layout options) | Sets the default widget type, use --help for more info. | +| `default_widget_count` | Unsigned Int (represents which `default_widget_type`) | Sets the n'th selected widget type as the default. | +| `disable_click` | Boolean | Disables mouse clicks. | +| `color` | String (one of ["default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light"]) | Use a color scheme, use --help for supported values. | +| `mem_as_value` | Boolean | Defaults to showing process memory usage by value. | +| `tree` | Boolean | Defaults to showing the process widget in tree mode. | +| `show_table_scroll_position` | Boolean | Shows the scroll position tracker in table widgets. | +| `process_command` | Boolean | Show processes as their commands by default. | +| `disable_advanced_kill` | Boolean | Hides advanced options to stop a process on Unix-like systems. | +| `network_use_binary_prefix` | Boolean | Displays the network widget with binary prefixes. | +| `network_use_bytes` | Boolean | Displays the network widget using bytes. | +| `network_use_log` | Boolean | Displays the network widget with a log scale. | diff --git a/docs/content/configuration/config-file/layout.md b/docs/content/configuration/config-file/layout.md new file mode 100644 index 00000000..fb32c5fe --- /dev/null +++ b/docs/content/configuration/config-file/layout.md @@ -0,0 +1,57 @@ +# Layout + +!!! Warning + + This section is in progress, and is just copied from the old documentation. + +bottom supports customizable layouts via the config file. Currently, layouts are controlled by using TOML objects and arrays. + +For example, given the sample layout: + +```toml +[[row]] + [[row.child]] + type="cpu" +[[row]] + ratio=2 + [[row.child]] + ratio=4 + type="mem" + [[row.child]] + ratio=3 + [[row.child.child]] + type="temp" + [[row.child.child]] + type="disk" +``` + +This would give a layout that has two rows, with a 1:2 ratio. The first row has only the CPU widget. +The second row is split into two columns with a 4:3 ratio. The first column contains the memory widget. +The second column is split into two rows with a 1:1 ratio. The first is the temperature widget, the second is the disk widget. + +This is what the layout would look like when run: + +![Sample layout](/assets/screenshots/config/layout/sample_layout.png) + +Each `[[row]]` represents a _row_ in the layout. A row can have any number of `child` values. Each `[[row.child]]` +represents either a _column or a widget_. A column can have any number of `child` values as well. Each `[[row.child.child]]` +represents a _widget_. A widget is represented by having a `type` field set to a string. + +The following `type` values are supported: + +| | | +| -------------------------------- | ------------------------ | +| `"cpu"` | CPU chart and legend | +| `"mem", "memory"` | Memory chart | +| `"net", "network"` | Network chart and legend | +| `"proc", "process", "processes"` | Process table and search | +| `"temp", "temperature"` | Temperature table | +| `"disk"` | Disk table | +| `"empty"` | An empty space | +| `"batt", "battery"` | Battery statistics | + +Each component of the layout accepts a `ratio` value. If this is not set, it defaults to 1. + +Furthermore, you can have duplicate widgets. + +For an example, look at the [default config](https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml), which contains the default layout. diff --git a/docs/content/configuration/config-file/theming.md b/docs/content/configuration/config-file/theming.md new file mode 100644 index 00000000..cbb46f85 --- /dev/null +++ b/docs/content/configuration/config-file/theming.md @@ -0,0 +1,31 @@ +# Theming + +!!! Warning + + This section is in progress, and is just copied from the old documentation. + +The config file can be used to set custom colours for parts of the application under the `[colors]` object. The following labels are customizable with strings that are hex colours, RGB colours, or specific named colours. + +Supported named colours are one of the following strings: `Reset, Black, Red, Green, Yellow, Blue, Magenta, Cyan, Gray, DarkGray, LightRed, LightGreen, LightYellow, LightBlue, LightMagenta, LightCyan, White`. + +| Labels | Details | Example | +| ------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| Table header colours | Colour of table headers | `table_header_color="255, 255, 255"` | +| CPU colour per core | Colour of each core. Read in order. | `cpu_core_colors=["#ffffff", "white", "255, 255, 255"]` | +| Average CPU colour | The average CPU color | `avg_cpu_color="White"` | +| All CPUs colour | The colour for the "All" CPU label | `all_cpu_color="White"` | +| RAM | The colour RAM will use | `ram_color="#ffffff"` | +| SWAP | The colour SWAP will use | `swap_color="#ffffff"` | +| RX | The colour rx will use | `rx_color="#ffffff"` | +| TX | The colour tx will use | `tx_color="#ffffff"` | +| Widget title colour | The colour of the label each widget has | `widget_title_color="#ffffff"` | +| Border colour | The colour of the border of unselected widgets | `border_color="#ffffff"` | +| Selected border colour | The colour of the border of selected widgets | `highlighted_border_color="#ffffff"` | +| Text colour | The colour of most text | `text_color="#ffffff"` | +| Graph colour | The colour of the lines and text of the graph | `graph_color="#ffffff"` | +| Cursor colour | The cursor's colour | `cursor_color="#ffffff"` | +| Selected text colour | The colour of text that is selected | `scroll_entry_text_color="#ffffff"` | +| Selected text background colour | The background colour of text that is selected | `scroll_entry_bg_color="#ffffff"` | +| High battery level colour | The colour used for a high battery level (100% to 50%) | `high_battery_color="green"` | +| Medium battery level colour | The colour used for a medium battery level (50% to 10%) | `medium_battery_color="yellow"` | +| Low battery level colour | The colour used for a low battery level (10% to 0%) | `low_battery_color="red"` | diff --git a/docs/content/contribution/development.md b/docs/content/contribution/development.md new file mode 100644 index 00000000..f388506b --- /dev/null +++ b/docs/content/contribution/development.md @@ -0,0 +1,11 @@ +# Development + +!!! Warning + + This section is currently WIP. + +## Dev Environment + +## Logging + +## Testing diff --git a/docs/content/contribution/documentation.md b/docs/content/contribution/documentation.md new file mode 100644 index 00000000..88fab072 --- /dev/null +++ b/docs/content/contribution/documentation.md @@ -0,0 +1,29 @@ +# Documentation + +## When should documentation changes be done? + +- Whenever a new feature is added, a bug is fixed, or a breaking change is made, it should be documented where appropriate (ex: `README.md`, changelog, etc.) +- New methods of installation are always appreciated and should be documented + +## What pages need documentation? + +There are a few areas where documentation changes are often needed: + +- The [extended documentation](https://clementtsang.github.io/bottom/) (AKA here) +- The [`README.md`](https://github.com/ClementTsang/bottom/blob/master/README.md) +- The help menu inside of the application (located [here](https://github.com/ClementTsang/bottom/blob/master/src/constants.rs)) +- The [`CHANGELOG.md`](https://github.com/ClementTsang/bottom/blob/master/CHANGELOG.md) + +## How should I add documentation? + +1. Fork the repository first and make changes there. + +2. Where you're adding documentation will probably affect what you need to do: + + - For changes to [`README.md`](https://github.com/ClementTsang/bottom/blob/master/README.md) and [`CHANGELOG.md`](https://github.com/ClementTsang/bottom/blob/master/CHANGELOG.md), just follow the formatting provided and use any editor. + + - For changes to the help menu, try to refer to the existing code within `src/constants.rs` on how the help menu is generated. + + - For changes to the extended documentation, you'll want [MkDocs](https://www.mkdocs.org/), [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/), and `mdx_truly_sane_lists` installed to provide live reloading and preview for your changes. You can do so through `pip` or your system's package managers. While you don't _need_ these, it'll probably help in making and validating changes. + +3. Once you have your documentation changes done, submit it as a pull request. For more information regarding that, refer to [Issues and Pull Requests](http://127.0.0.1:8000/contribution/issues-and-pull-requests/). diff --git a/docs/content/contribution/issues-and-pull-requests.md b/docs/content/contribution/issues-and-pull-requests.md new file mode 100644 index 00000000..36ebb57c --- /dev/null +++ b/docs/content/contribution/issues-and-pull-requests.md @@ -0,0 +1,25 @@ +# Issues and Pull Requests + +Contribution in any way is appreciated, whether it is reporting problems, fixing bugs, implementing features, improving the documentation, etc. + +## Opening an issue + +### Bug reports + +When filing a bug report, please use the [bug report template](https://github.com/ClementTsang/bottom/issues/new?assignees=&labels=bug&template=bug_report.md&title=) and fill in as much as you can. It is _incredibly_ difficult for a maintainer to fix +a bug when it cannot be reproduced, and giving as much detail as possible generally helps to make it easier to reproduce the problem! + +### Feature requests + +Please use the [feature request template](https://github.com/ClementTsang/bottom/issues/new?assignees=&labels=feature&template=feature_request.md&title=) and fill it out. Remember to give details about what the feature is along with why you think this suggestion will be useful. + +## Pull requests + +The expected workflow for a pull request is: + +1. Fork the project. +2. Make your changes. +3. Make any documentation changes if necessary - if you add a new feature, it'll probably need documentation changes. See [here](./documentation.md) for tips on documentation. +4. Commit and create a pull request to merge into the `master` branch. **Please follow the pull request template**. +5. Wait for the tests to pass. These consist of clippy lints, rustfmt checks, and basic tests. **If you are a first time contributor, you may need to skip this step for now, as GitHub Actions requires approval to run.** +6. Ask a maintainer to review your pull request. If changes are suggested or any comments are made, they should probably be addressed. Once it looks good, it'll be merged! diff --git a/docs/content/contribution/packaging-and-distribution.md b/docs/content/contribution/packaging-and-distribution.md new file mode 100644 index 00000000..fddff689 --- /dev/null +++ b/docs/content/contribution/packaging-and-distribution.md @@ -0,0 +1,41 @@ +# Packaging and Distribution + +Package maintainers are always welcome and appreciated! Here's some info on how one can help with package distribution and bottom. + +## Pre-built binaries + +The latest stable release can be found [here](https://github.com/ClementTsang/bottom/releases/latest), where you can find pre-built binaries in either a `tar.gz` or `zip` format. +Binaries here also include automatically generated shell completion files for zsh, bash, fish, and Powershell, which you may want to also install during the packaging +process. + +You can also find a nightly build in the [releases page](https://github.com/ClementTsang/bottom/releases), built every day at 00:00 UTC off of the master branch. + +## Building manually + +If you want to manually build bottom rather than distributing a pre-built binary, you'll need the most recent version of stable Rust, which you can get with: + +```bash +rustup update stable +``` + +You'll then want to build with: + +```bash +cargo build --release --locked +``` + +Completion files are automatically generated during this process, and are located in the directory `target/release/build/bottom-/out`. Note there may be multiple folders that look like `target/release/build/bottom-`. To programmatically determine which is the right folder, you might want to use something like: + +```bash +$(ls target/release/build/bottom-*/out/btm.bash | head -n1 | xargs dirname) +``` + +You may find the [Arch package install script template](https://github.com/ClementTsang/bottom/blob/master/deployment/linux/arch/PKGBUILD.template) useful as a reference. + +## Adding an installation source + +Once you've finished your installation source, if you want to mention it in the main bottom repo, fork the repo and add the installation method and any details to +the [`README.md`](https://github.com/ClementTsang/bottom/blob/master/README.md) file under the [Installation](https://github.com/ClementTsang/bottom#installation) section. +Once that's done, open a pull request - these will usually be approved of very quickly. + +You can find more info on the contribution process [here](../issues-and-pull-requests/#pull-requests). diff --git a/docs/content/index.md b/docs/content/index.md new file mode 100644 index 00000000..be23c613 --- /dev/null +++ b/docs/content/index.md @@ -0,0 +1,29 @@ +--- +title: Home +--- + +# `bottom` + +This site serves as documentation for bottom and the overall project, and as an extension to the [`README.md`](https://github.com/ClementTsang/bottom#readme). + +!!! Warning + + Some areas of this documentation is still in progress, and should get better in time. Feel free to suggest/contribute changes! + +## Installation + +!!! Tip + + It's probably a good idea to first check out the [Support](./support) page to see if your system is officially supported! + +!!! Tip + + If you're facing some issues during/after installation, check the [Troubleshooting](./troubleshooting) page for some common problems and solutions. + +To install bottom, refer to [the installation section of the `README.md`](https://github.com/ClementTsang/bottom#installation), +which contains a list of all the installation methods. + +## Contribution + +New contributors are always welcome! See the [contribution](./contribution/issues-and-pull-requests/) section for how to help contribute to +bottom, whether it be filing issues or creating pull requests. diff --git a/docs/content/stylesheets/extra.css b/docs/content/stylesheets/extra.css new file mode 100644 index 00000000..b7e75d05 --- /dev/null +++ b/docs/content/stylesheets/extra.css @@ -0,0 +1,12 @@ +:root { + --md-primary-fg-color: #268bd2; + --md-accent-fg-color: #81a1c1; +} + +.md-typeset__table { + min-width: 100%; +} + +.md-typeset table:not([class]) { + display: table; +} diff --git a/docs/content/support.md b/docs/content/support.md new file mode 100644 index 00000000..9812ce02 --- /dev/null +++ b/docs/content/support.md @@ -0,0 +1,42 @@ +# Support + +## Official support + +bottom _officially_ supports the following operating systems and corresponding architectures: + +- macOS (`x86_64`) +- Linux (`x86_64`, `i686`, `aarch64`) +- Windows (`x86_64`, `i686`) + +These platforms are tested to work (with caveats, see below) and issues on these platforms will be fixed if possible. + +Furthermore, binaries are expected to be built and tested using the most recent version of stable Rust - if you are manually building +bottom from the repo/source, then please try that as well. + +### Known problems + +#### Windows + +- The temperature widget seems to require elevated access in some cases to get data. +- The battery widget seems to have issues with dual battery systems, like some Thinkpads. +- If you run on WSL/WSL2, you may have issues with getting memory data. +- WSL and WSL2 (as far as I know) cannot correctly report temperature sensors. +- WSL2 will not match Windows' own Task Manager in terms of data. + +#### macOS + +- The process widget may require elevated access (ex: `sudo btm`) to gather all data in some cases. + +## Unofficial support + +Systems and architectures that aren't officially supported may still work, but there are no guarantees on how much will work. Furthermore, +while it will depend on the problem at the end of the day, _issues on unsupported platforms are likely to go unfixed_. + +!!! note + + bottom is tested to build on other ARM and PowerPC architectures through [CI](https://github.com/ClementTsang/bottom/blob/master/.github/workflows/ci.yml), + but since they are not officially tested to work on a sample platform, they are only unofficially supported. + +### Known problems + +- M1-based macOS devices may have issues with temperature sensors not returning anything. diff --git a/docs/content/troubleshooting.md b/docs/content/troubleshooting.md new file mode 100644 index 00000000..71a9718e --- /dev/null +++ b/docs/content/troubleshooting.md @@ -0,0 +1,78 @@ +# Troubleshooting + +## The graph points look broken/strange + +It's possible that your graphs won't look great out of the box due to the reliance on braille fonts. + +One example of this is seeing a bunch of missing font characters, caused when the terminal isn't configured properly to render braille fonts. + +
+ Example of a terminal with no braille font. +
Powershell shown missing braille fonts
+
+ +Another example is when braille is rendered as a block of dots, with the non-coloured dots also appearing. This may look strange for some users, and it is also caused by misconfiguration or missing fonts. + +
+ Example of a terminal with the wrong braille font. +
Braille fonts rendering as a block of dots
+
+ +In either case, you may need to install a specific font and configure your terminal to use it. For example, installing [UBraille](https://yudit.org/download/fonts/UBraille/) +and ensuring your terminal uses should work. + +Another alternative is to use the `--dot_marker` option to instead render graph charts using dots, which I've generally found to be better supported out of the box: + +
+ Example of running bottom with the dot marker flag +
Example using btm --dot_marker
+
+ +## Why can't I see all my processes/process usage on macOS? + +You may have to run the program with elevated privileges - for example: + +```bash +sudo btm +``` + +There are measures taken to try to maximize the amount of information obtained without elevated privileges, but there may still be some limitations. + +## My configuration file isn't working + +If your configuration files aren't working, here are a few things to try: + +### Check the formatting + +It may be handy to refer to the automatically generated config files or the [sample configuration files](https://github.com/ClementTsang/bottom/tree/master/sample_configs). +The config files also follow the [TOML](https://toml.io/en/) format. + +Also make sure your config options are under the right table - for example, to set your temperature type, you must set it under the `[flags]` table: + +```toml +[flags] +temperature_type = "f" +``` + +Meanwhile, if you want to set a custom color scheme, it would be under the `[colors]` table: + +```toml +[colors] +table_header_color="LightBlue" +``` + +### Check the configuration file location + +Make sure bottom is reading the right configuration file. By default, bottom looks for config files at these locations: + +| OS | Default Config Location | +| ------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| macOS | `$HOME/Library/Application Support/bottom/bottom.toml`
`~/.config/bottom/bottom.toml`
`$XDG_CONFIG_HOME/bottom/bottom.toml` | +| Linux | `~/.config/bottom/bottom.toml`
`$XDG_CONFIG_HOME/bottom/bottom.toml` | +| Windows | `C:\Users\\AppData\Roaming\bottom\bottom.toml` | + +If you want to use a config file in another location, use the `--config` or `-C` flags along with the path to the configuration file, like so: + +```bash +btm -C path_to_config +``` diff --git a/docs/content/usage/basic-mode.md b/docs/content/usage/basic-mode.md new file mode 100644 index 00000000..7913fbed --- /dev/null +++ b/docs/content/usage/basic-mode.md @@ -0,0 +1,36 @@ +# Basic Mode + +Basic mode is a special layout that removes all of the graphs and provides an interface that resembles (a very stripped-down version of) htop. + +
+ A picture of bottom's basic mode. +
+ +Basic mode can be enabled either through a command line flag: + +```bash +btm -b + +# or + +btm --basic +``` + +or through the config: + +```toml +[flags] +basic = true +``` + +## Notes + +In this mode, widgets that use tables (temperatures, processes, disks, and batteries) are only shown one at a time. +One can switch between these widgets either by clicking the arrow buttons or by using the general widget selection shortcuts (for example, ++ctrl+left++ or ++H++) +to switch which widget is shown. + +Also note that in this mode, widget expansion and custom layouts are disabled. + +## Key bindings + +Basic mode follows the same key bindings as normal, barring widget expansion being disabled, and that the ++"%"++ key while selecting the memory widget toggles between total usage and percentage. diff --git a/docs/content/usage/general-usage.md b/docs/content/usage/general-usage.md new file mode 100644 index 00000000..4bfcdb61 --- /dev/null +++ b/docs/content/usage/general-usage.md @@ -0,0 +1,63 @@ +# General Usage + +You can run bottom with: + +```bash +btm +``` + +For help regarding the command-line flags, use: + +```bash +# For a simple overview of flags +btm -h + +# For more details +btm --help +``` + +## Features + +### Expansion + +By default, bottom is somewhat like a dashboard - a bunch of different widgets, all showing different things, and they all cram together to fit into one terminal. + +If you instead just want to see _one_ widget - maybe you want to look at a graph in more detail, for example - you can "expand" the currently selected +widget using the ++e++ key, which will hide all other widgets and make that widget take up all available terminal space. + +You can leave this state by either pressing ++e++ again or pressing ++esc++. + +### Widget selection + +To allow for widget-specific keybindings and expansion, there is the idea of _widget selection_ in bottom, where you can focus on a specific widget to work with it. +This can be done with the mouse (just click on the widget of interest) or keyboard (ex: ++ctrl+"Direction"++, see [Key bindings](#key-bindings) for alternatives). + +## Key bindings + +These are global or common keyboard shortcuts for the application, which you can see in-app through the ++question++ shortcut. +Note that key bindings are generally case-sensitive. + +| Binding | Action | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| ++q++ , ++ctrl+c++ | Quit | +| ++esc++ | Close dialog windows, search, widgets, or exit expanded mode | +| ++ctrl+r++ | Reset display and any collected data | +| ++f++ | Freeze/unfreeze updating with new data | +| ++question++ | Open help menu | +| ++e++ | Toggle expanding the currently selected widget | +| ++ctrl+up++
++shift+up++
++K++
++W++ | Select the widget above | +| ++ctrl+down++
++shift+down++
++J++
++S++ | Select the widget below | +| ++ctrl+left++
++shift+left++
++H++
++A++ | Select the widget on the left | +| ++ctrl+right++
++shift+right++
++L++
++D++ | Select the widget on the right | +| ++up++ , ++k++ | Move up within a widget | +| ++down++ , ++j++ | Move down within a widget | +| ++left++
++h++
++alt+h++ | Move left within a widget | +| ++right++
++l++
++alt+l++ | Move right within a widget | +| ++g+g++ , ++home++ | Jump to the first entry | +| ++G++ , ++end++ | Jump to the last entry | + +## Mouse bindings + +| Binding | Action | +| ----------- | ------------------ | +| ++lbutton++ | Selects the widget | diff --git a/docs/content/usage/widgets/battery.md b/docs/content/usage/widgets/battery.md new file mode 100644 index 00000000..90fa7503 --- /dev/null +++ b/docs/content/usage/widgets/battery.md @@ -0,0 +1,35 @@ +# Battery Widget + +The battery widget provides information about batteries on the system. + +
+ A picture of an expanded battery widget. +
+ +The battery widget can be enabled through either the `--battery` flag, the `battery = true` option in a config file, or specifying the widget in a custom layout. + +## Features + +The following data is displayed for batteries: + +- Charge percent +- Consumption +- Time to empty/charge, based on the current state +- Battery health percent + +The battery widget also supports devices with multiple batteries, and you can switch between them using the keyboard or the mouse. + +## Key bindings + +Note that key bindings are generally case-sensitive. + +| Binding | Action | +| ------------------------------------- | ---------------------------------------------------------- | +| ++left++
++h++
++alt+h++ | Moves to the battery entry to the left of the current one | +| ++right++
++l++
++alt+l++ | Moves to the battery entry to the right of the current one | + +## Mouse bindings + +| Binding | Action | +| ----------- | ----------------------- | +| ++lbutton++ | Selects a battery entry | diff --git a/docs/content/usage/widgets/cpu.md b/docs/content/usage/widgets/cpu.md new file mode 100644 index 00000000..1c59376b --- /dev/null +++ b/docs/content/usage/widgets/cpu.md @@ -0,0 +1,55 @@ +# CPU Widget + +The CPU widget displays a visual representation of CPU usage over a time range. + +
+ A picture of an expanded CPU widget showing average CPU usage. +
+ +## Features + +The CPU widget is composed of two parts: the graph and the legend: + +- The graph displays the usage data for the currently selected entry as a percentage +- The legend displays all available entries that can be displayed on the graph along with their last recorded use percentage (except for the "All" option) + +Users can scroll through the legend using either the keyboard or mouse to select which entry to display on the graph. The "All" option shows every entry +at the same time, though this may get a bit hard to follow if you have a large number of cores/threads. + +One can also adjust the displayed time range through either the keyboard or mouse, with a range of 30s to 600s. + +## Key bindings + +Note that key bindings are generally case-sensitive. + +### Graph + +| Binding | Action | +| --------- | --------------------------------------- | +| ++plus++ | Zoom in on chart (decrease time range) | +| ++minus++ | Zoom out on chart (increase time range) | +| ++equal++ | Reset zoom | + +### Legend + +| Binding | Action | +| ------------------ | ------------------------------------- | +| ++up++ , ++k++ | Move up within a widget | +| ++down++ , ++j++ | Move down within a widget | +| ++g+g++ , ++home++ | Jump to the first entry in the legend | +| ++G++ , ++end++ | Jump to the last entry in the legend | + +## Mouse bindings + +### Graph + +| Binding | Action | +| ------------ | -------------------------------------------------------------- | +| ++"Scroll"++ | Scrolling up or down zooms in or out of the graph respectively | + +### Legend + +| Binding | Action | +| ------------ | ------------------------------------------------- | +| ++"Scroll"++ | Scroll through options to display in the graph | +| ++lbutton++ | Selects a CPU thread/average to show in the graph | diff --git a/docs/content/usage/widgets/disk.md b/docs/content/usage/widgets/disk.md new file mode 100644 index 00000000..655f0357 --- /dev/null +++ b/docs/content/usage/widgets/disk.md @@ -0,0 +1,36 @@ +# Disk Widget + +The disk widget provides a table of useful disk and partition information, like I/O per second and total usage. + +
+ A picture of an expanded disk widget. +
+ +## Features + +The disk widget provides the following information: + +- Disk name +- Disk mount location +- Percentage of space used +- Amount of space left +- Total amount of space +- Read per second +- Write per second + +## Key bindings + +Note that key bindings are generally case-sensitive. + +| Binding | Action | +| ------------------ | ------------------------------------ | +| ++up++ , ++k++ | Move up within a widget | +| ++down++ , ++j++ | Move down within a widget | +| ++g+g++ , ++home++ | Jump to the first entry in the table | +| ++G++ , ++end++ | Jump to the last entry in the table | + +## Mouse bindings + +| Binding | Action | +| ----------- | ----------------------------- | +| ++lbutton++ | Selects an entry in the table | diff --git a/docs/content/usage/widgets/memory.md b/docs/content/usage/widgets/memory.md new file mode 100644 index 00000000..180b4b64 --- /dev/null +++ b/docs/content/usage/widgets/memory.md @@ -0,0 +1,30 @@ +# Memory Widget + +The memory widget provides a visual representation of RAM and swap usage over time. + +
+ A picture of an expanded memory widget. +
+ +## Features + +The legend displays the current usage in terms of percentage and actual usage. +If the total RAM or swap available is 0, then it is automatically hidden from the legend and graph. + +One can also adjust the displayed time range through either the keyboard or mouse, with a range of 30s to 600s. + +## Key bindings + +Note that key bindings are generally case-sensitive. + +| Binding | Action | +| --------- | --------------------------------------- | +| ++plus++ | Zoom in on chart (decrease time range) | +| ++minus++ | Zoom out on chart (increase time range) | +| ++equal++ | Reset zoom | + +## Mouse bindings + +| Binding | Action | +| ------------ | -------------------------------------------------------------- | +| ++"Scroll"++ | Scrolling up or down zooms in or out of the graph respectively | diff --git a/docs/content/usage/widgets/network.md b/docs/content/usage/widgets/network.md new file mode 100644 index 00000000..8e58194c --- /dev/null +++ b/docs/content/usage/widgets/network.md @@ -0,0 +1,30 @@ +# Network Widget + +The network widget provides a visual representation of network input and output per second, as well as noting the total amount +received and transmitted. + +
+ A picture of an expanded network widget. +
+ +## Features + +The legend displays the current reads and writes per second, as well as the total amount read/written. + +One can also adjust the displayed time range through either the keyboard or mouse, with a range of 30s to 600s. + +## Key bindings + +Note that key bindings are generally case-sensitive. + +| Binding | Action | +| --------- | --------------------------------------- | +| ++plus++ | Zoom in on chart (decrease time range) | +| ++minus++ | Zoom out on chart (increase time range) | +| ++equal++ | Reset zoom | + +## Mouse bindings + +| Binding | Action | +| ------------ | -------------------------------------------------------------- | +| ++"Scroll"++ | Scrolling up or down zooms in or out of the graph respectively | diff --git a/docs/content/usage/widgets/process.md b/docs/content/usage/widgets/process.md new file mode 100644 index 00000000..e48f6d57 --- /dev/null +++ b/docs/content/usage/widgets/process.md @@ -0,0 +1,227 @@ +# Process Widget + +The process widget displays a table containing information regarding a running process, along with sorting, +searching, and process control features. + +
+ A picture of an expanded process widget by default. +
+ +## Features + +The process widget has three main components: + +- The main process table +- The search sub-widget (opened with ++ctrl+f++ or ++slash++) +- The sort menu sub-widget (opened with ++s++ or ++f6++) + +By default, the main process table displays the following information for each process: + +- PID +- Name of the process +- CPU use percentage (note this is averaged out per available thread) +- Memory use percentage +- Reads per second +- Writes per second +- Total amount read +- Total amount written +- User +- State + +### Sorting + +The table can be sorted by clicking on the table headers, which will either sort the table by that column, or if already +sorting by that column, reverse the sorting order. + +Alternatively, one can sort using the sort menu sub-widget, which is brought up using ++s++ or ++f6++, and can be controlled by arrow keys or the mouse. + +
+ A picture of an expanded process widget with the sort menu open. +
+ +### Grouping + +Pressing ++tab++ in the table will group entries with the same name together. The PID column will be replaced with the number of entries in each group, and usage +is added together when displayed. + +
+ A picture of grouped mode in a process widget. +
+ +Note that the process state and user columns are disabled in this mode. + +### Tree mode + +Pressing ++t++ or ++f5++ in the table toggles tree mode in the process widget, displaying processes in regards to their parent-child process relationships. + +
+ A picture of tree mode in a process widget. +
+ +A process in tree mode can also be "collapsed", hiding its children and any descendants, using either the ++minus++ or ++plus++ keys, or double clicking on an entry. + +Lastly, note that in tree mode, processes cannot be grouped together due to the behaviour of the two modes somewhat clashing. + +### Full command + +You can show the full command instead of just the process name by pressing ++P++. + +
+ A picture of a process widget using full commands. +
+ +### Search + +Pressing ++slash++ or ++ctrl+f++ will open up the search sub-widget. By default, just typing in something will search by the process name. + +
+ A picture of searching for a process with a simple search. +
+ +This search can be further enhanced by matching by case, matching the entire word, or by regex. + +
+ A picture of searching for a process with a search condition that uses regex. +
+ +We are able to also search for multiple things/conditions. + +
+ A picture of searching for a process with a search condition that uses the or operator. +
+ +And if our search uses a keyword, we need to use quotation marks around the term to properly search it. + +
+ A picture of searching for a process with a search condition that needs quotation marks. +
+ +Lastly, we can refine our search even further based on the other columns, like PID, CPU usage, etc., as well as grouping together conditions. + +
+ A picture of searching for a process with a search condition that uses the CPU keyword. +
+ +#### Keywords + +Note all keywords are case-insensitive. To search for a process/command that collides with a keyword, surround the term with quotes (e.x. `"cpu"`). + +| Keywords | Example | Description | +| ------------------------ | ------------------------------------- | ------------------------------------------------------------------------------- | +| | `btm` | Matches by process or command name; supports regex | +| `pid` | `pid=1044` | Matches by PID; supports regex | +| `cpu`
`cpu%` | `cpu > 0.5` | Matches the CPU column; supports comparison operators | +| `memb` | `memb > 1000 b` | Matches the memory column in terms of bytes; supports comparison operators | +| `mem`
`mem%` | `mem < 0.5` | Matches the memory column in terms of percent; supports comparison operators | +| `read`
`r/s` | `read = 1 mb` | Matches the read/s column in terms of bytes; supports comparison operators | +| `write`
`w/s` | `write >= 1 kb` | Matches the write/s column in terms of bytes; supports comparison operators | +| `tread`
`t.read` | `tread <= 1024 gb` | Matches he total read column in terms of bytes; supports comparison operators | +| `twrite`
`t.write` | `twrite > 1024 tb` | Matches the total write column in terms of bytes; supports comparison operators | +| `user` | `user=root` | Matches by user; supports regex | +| `state` | `state=running` | Matches by state; supports regex | +| `()` | `( AND ) OR ` | Group together a condition | + +#### Comparison operators + +| Keywords | Description | +| -------- | -------------------------------------------------------------- | +| `=` | Checks if the values are equal | +| `>` | Checks if the left value is strictly greater than the right | +| `<` | Checks if the left value is strictly less than the right | +| `>=` | Checks if the left value is greater than or equal to the right | +| `<=` | Checks if the left value is less than or equal to the right | + +#### Logical operators + +Note all operators are case-insensitive, and the `and` operator takes precedence over the `or` operator. + +| Keywords | Usage | Description | +| ------------------------------------ | ------------------------------------------------------------------------------ | --------------------------------------------------- | +| `and`
`&&`
`` | ` and `
` && `
` ` | Requires both conditions to be true to match | +| `or`
|| | ` or `
` || ` | Requires at least one condition to be true to match | + +#### Units + +All units are case-insensitive. + +| Keywords | Description | +| -------- | ----------- | +| `B` | Bytes | +| `KB` | Kilobytes | +| `MB` | Megabytes | +| `GB` | Gigabytes | +| `TB` | Terabytes | +| `KiB` | Kibibytes | +| `MiB` | Mebibytes | +| `GiB` | Gibibytes | +| `TiB` | Tebibytes | + +## Key bindings + +Note that key bindings are generally case-sensitive. + +### Process table + +| Binding | Action | +| ---------------------- | ---------------------------------------------------------------- | +| ++up++ , ++k++ | Move up within a widget | +| ++down++ , ++j++ | Move down within a widget | +| ++g+g++ , ++home++ | Jump to the first entry in the table | +| ++G++ , ++end++ | Jump to the last entry in the table | +| ++d+d++ | Send a kill signal to the selected process | +| ++c++ | Sort by CPU usage, press again to reverse sorting order | +| ++m++ | Sort by memory usage, press again to reverse sorting order | +| ++p++ | Sort by PID name, press again to reverse sorting order | +| ++n++ | Sort by process name, press again to reverse sorting order | +| ++tab++ | Toggle grouping processes with the same name | +| ++P++ | Toggle between showing the full command or just the process name | +| ++ctrl+f++ , ++slash++ | Toggle showing the search sub-widget | +| ++s++ , ++f6++ | Toggle showing the sort sub-widget | +| ++I++ | Invert the current sort | +| ++"%"++ | Toggle between values and percentages for memory usage | +| ++t++ , ++f5++ | Toggle tree mode | + +### Sort sub-widget + +| Binding | Action | +| ------------------ | ------------------------------------- | +| ++up++ , ++k++ | Move up within a widget | +| ++down++ , ++j++ | Move down within a widget | +| ++g+g++ , ++home++ | Jump to the first entry in the table | +| ++G++ , ++end++ | Jump to the last entry in the table | +| ++esc++ | Close the sort sub-widget | +| ++enter++ | Sorts the corresponding process table | + +### Search sub-widget + +| Binding | Action | +| ------------------------------------- | -------------------------------------------- | +| ++left++
++h++
++alt+h++ | Moves the cursor left | +| ++right++
++l++
++alt+l++ | Moves the cursor right | +| ++tab++ | Toggle between searching by PID or name | +| ++esc++ | Close the search widget (retains the filter) | +| ++ctrl+a++ | Skip to the start of the search query | +| ++ctrl+e++ | Skip to the end of the search query | +| ++ctrl+u++ | Clear the current search query | +| ++ctrl+w++ | Delete a word behind the cursor | +| ++ctrl+h++ | Delete the character behind the cursor | +| ++backspace++ | Delete the character behind the cursor | +| ++delete++ | Delete the character at the cursor | +| ++alt+c++ , ++f1++ | Toggle matching case | +| ++alt+w++ , ++f2++ | Toggle matching the entire word | +| ++alt+r++ , ++f3++ | Toggle using regex | + +## Mouse bindings + +### Process table + +| Binding | Action | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ++"Scroll"++ | Selects a CPU thread/average to show in the graph | +| ++lbutton++ | Table header: Sorts/reverse sorts the table by the column
Table entry: Selects an entry in the table, if in tree mode, collapses/expands the entry's children | + +### Sort sub-widget + +| Binding | Action | +| ----------- | ----------------------------- | +| ++lbutton++ | Selects an entry in the table | diff --git a/docs/content/usage/widgets/temperature.md b/docs/content/usage/widgets/temperature.md new file mode 100644 index 00000000..f7ea2790 --- /dev/null +++ b/docs/content/usage/widgets/temperature.md @@ -0,0 +1,28 @@ +# Temperature Widget + +The temperature widget provides a table of temperature sensors and their current temperature. + +
+ A picture of an expanded temperature widget. +
+ +## Features + +The temperature widget provides the sensor name as well as its current temperature. + +## Key bindings + +Note that key bindings are generally case-sensitive. + +| Binding | Action | +| ------------------ | ------------------------------------ | +| ++up++ , ++k++ | Move up within a widget | +| ++down++ , ++j++ | Move down within a widget | +| ++g+g++ , ++home++ | Jump to the first entry in the table | +| ++G++ , ++end++ | Jump to the last entry in the table | + +## Mouse bindings + +| Binding | Action | +| ----------- | ----------------------------- | +| ++lbutton++ | Selects an entry in the table | diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 00000000..ceee8fcc --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,139 @@ +# Site information +site_name: bottom +site_author: Clement Tsang +site_url: https://clementtsang.github.io/bottom +site_description: >- + Yet another cross-platform graphical process/system monitor, inspired by gtop, gotop, and htop. +docs_dir: "content/" + +# Project information +repo_name: ClementTsang/bottom +repo_url: https://github.com/ClementTsang/bottom + +# Theming +theme: + name: material + features: + - navigation.tabs + - navigation.top + - navigation.expand + - navigation.instant + palette: + # Light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/weather-night + name: Switch to dark mode + # Dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/weather-sunny + name: Switch to light mode +extra_css: + - stylesheets/extra.css + +# Extensions +markdown_extensions: + - admonition + - attr_list + - toc: + anchorlink: true + - pymdownx.inlinehilite + - pymdownx.keys: + # Override to make it case-sensitive + key_map: { + "a": "a", + "b": "b", + "c": "c", + "d": "d", + "e": "e", + "f": "f", + "g": "g", + "h": "h", + "i": "i", + "j": "j", + "k": "k", + "l": "l", + "m": "m", + "n": "n", + "o": "o", + "p": "p", + "q": "q", + "r": "r", + "s": "s", + "t": "t", + "u": "u", + "v": "v", + "w": "w", + "x": "x", + "y": "y", + "z": "z", + "A": "A", + "B": "B", + "C": "C", + "D": "D", + "E": "E", + "F": "F", + "G": "G", + "H": "H", + "I": "I", + "J": "J", + "K": "K", + "L": "L", + "M": "M", + "N": "N", + "O": "O", + "P": "P", + "Q": "Q", + "R": "R", + "S": "S", + "T": "T", + "U": "U", + "V": "V", + "W": "W", + "X": "X", + "Y": "Y", + "Z": "Z" + } + - pymdownx.details + - pymdownx.highlight + - pymdownx.superfences + - mdx_truly_sane_lists # See https://github.com/mkdocs/mkdocs/issues/545#issuecomment-522196661 + +# Versioning +# extra: +# version: +# provider: mike +# default: nightly + +# Navigation +nav: + - "Home": index.md + - "Support": support.md + - "Usage": + - "General Usage": usage/general-usage.md + - "Widgets": + - "CPU Widget": usage/widgets/cpu.md + - "Memory Widget": usage/widgets/memory.md + - "Process Widget": usage/widgets/process.md + - "Disk Widget": usage/widgets/disk.md + - "Temperature Widget": usage/widgets/temperature.md + - "Network Widget": usage/widgets/network.md + - "Battery Widget": usage/widgets/battery.md + - "Basic Mode": usage/basic-mode.md + - "Configuration": + - "Command-line Flags": configuration/command-line-flags.md + - "Config File": + - "Default Config": configuration/config-file/default-config.md + - "Flags": configuration/config-file/flags.md + - "Theming": configuration/config-file/theming.md + - "Layout": configuration/config-file/layout.md + - "Data Filtering": configuration/config-file/data-filtering.md + - "Contribution": + - "Issues and Pull Requests": contribution/issues-and-pull-requests.md + - "Documentation": contribution/documentation.md + - "Development": contribution/development.md + - "Packaging and Distribution": contribution/packaging-and-distribution.md + - "Troubleshooting": troubleshooting.md diff --git a/src/app.rs b/src/app.rs index 5e281a86..3de4939b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -684,6 +684,7 @@ impl App { { proc_widget_state.is_tree_mode = !proc_widget_state.is_tree_mode; + // FIXME: For consistency, either disable tree mode if grouped, or allow grouped mode if in tree mode. if proc_widget_state.is_tree_mode { // Disable grouping if so! proc_widget_state.is_grouped = false; @@ -2999,6 +3000,7 @@ impl App { } } BottomWidgetType::ProcSort => { + // TODO: This should sort if you double click! if let Some(proc_widget_state) = self .proc_state .get_widget_state(self.current_widget.widget_id - 2) diff --git a/src/app/states.rs b/src/app/states.rs index c596f038..28d1323b 100644 --- a/src/app/states.rs +++ b/src/app/states.rs @@ -333,7 +333,6 @@ impl Default for ProcColumn { } } -// TODO: [SORTING] Sort by clicking on column header (ie: click on cpu, sort/invert cpu sort)? impl ProcColumn { /// Returns its new status. pub fn toggle(&mut self, column: &ProcessSorting) -> Option {