Commit Graph

147 Commits

Author SHA1 Message Date
Clement Tsang d08036f69a refactor: refactor some fields and code to use "colour" spelling (#2058)
<!-- Please use this template (unless you have a very good reason not
to). PRs that do not use the template may be closed. -->

## Description

_A description of the change, what it does, and why it was made. If
relevant (e.g. UI changes), **please also provide
screenshots/recordings**:_

Rename a bunch of code/struct field names to use "colour". Note this
should have no functional change to config settings as I was already
aliasing "colour" for "color" settings, this just flips it internally.

As for why, I'm Canadian, I grew up spelling it this way, sorry.

## Issue

_If applicable, what issue does this address?_

Closes: #<issue-number>

## Testing

_If relevant, please state how this was tested (including steps):_

_If this change affects the program, please also indicate which
platforms were tested:_

- [ ] _Windows_
- [ ] _macOS (specify version below)_
- [x] _Linux (specify distro below)_
- [ ] _Other (specify below)_

## Checklist

_Ensure **all** of these are met:_

- [x] _If this PR adds or changes a dependency, please justify this in
the description_
- [x] _If this is a code change, areas your change affects have been
linted using (`cargo fmt`)_
- [x] _If this is a code change, your changes pass `cargo clippy --all
-- -D warnings`_
- [x] _If this is a code change, new tests were added if relevant_
- [x] _If this is a code change, your changes pass `cargo test`_
- [x] _The change has been tested to work (see above) and doesn't appear
to break other things_
- [x] _Documentation has been updated if needed (`README.md`, help menu,
docs, configs, etc.)_
- [x] _There are no merge conflicts_
- [x] _You have reviewed your changes first_
- [x] _The pull request passes the provided CI pipeline_

## Other

_Anything else that maintainers should know about this PR:_
2026-05-08 01:34:02 -04:00
ChrisJr404 1888dbb270 feature: configurable default sort column for the process widget (#2053)
## Description

You can now tell bottom which column the process widget should be sorted
by at startup, instead of always falling back to CPU%.

It's settable in two places: a `default_sort` field under `[processes]`
in the config file, and a `--process_default_sort` CLI flag. The flag
accepts the same column-name aliases that already work in
`[processes].columns` (e.g. `cpu%`, `mem`, `pid`, `name`, `read`,
`t.write`, etc.), and the CLI flag wins over the config setting.

```toml
[processes]
default_sort = "mem"
```

```
btm --process_default_sort mem
```

This piggybacks on the same wiring that #2003 added for the disk and
temperature widgets, just routed through the existing `ProcTableConfig`
so the widget initializer can pick a non-default sort index without
touching any of the runtime sort code.

A few small things worth flagging:

- If the configured column is not actually present in the user's
`columns` list, the widget falls back to the existing default behaviour
(CPU% in normal/grouped mode, PID in tree mode) instead of silently
snapping to column 0. That keeps misconfiguration predictable.
- The deserializer for `ProcColumn` was refactored to share its parsing
with the CLI's value parser, so config-file and CLI accept the exact
same aliases. The set of accepted strings is unchanged from before.

I checked the `# columns =` workaround floating around in #810 and on
Stack Overflow; it changes layout but not the sort key, so it doesn't
actually solve the original ask.

## Issue

Closes: #810

## Testing

_If this change affects the program, please also indicate which
platforms were tested:_

- [ ] _Windows_
- [ ] _macOS (specify version below)_
- [x] _Linux (Kali, kernel 6.19)_
- [ ] _Other (specify below)_

Added unit tests for `ProcWidgetState::new` covering the happy path
(sort index actually lands on the configured column) and the fallback
path (configured column not in the column list). Also added valid +
invalid config integration tests under `tests/valid_configs/` and
`tests/invalid_configs/`, matching the pattern used for the disk/temp
default-sort tests.

`cargo test`, `cargo clippy --all -- -D warnings`, and `cargo fmt
--check` are all clean.

Manual smoke test: ran `btm --process_default_sort=mem` and `btm
--process_default_sort=garbage`. The first starts the widget sorted by
Mem%, the second exits early with `'garbage' is not a valid process
column for --process_default_sort` from the args layer. Also ran `btm -C
tests/valid_configs/proc_default_sort.toml` to confirm the config-file
path works the same way.

## Checklist

_Ensure **all** of these are met:_

- [x] _If this PR adds or changes a dependency, please justify this in
the description_ (no new deps)
- [x] _If this is a code change, areas your change affects have been
linted using (`cargo fmt`)_
- [x] _If this is a code change, your changes pass `cargo clippy --all
-- -D warnings`_
- [x] _If this is a code change, new tests were added if relevant_
- [x] _If this is a code change, your changes pass `cargo test`_
- [x] _The change has been tested to work (see above) and doesn't appear
to break other things_
- [x] _Documentation has been updated if needed (`README.md`, help menu,
docs, configs, etc.)_
- [x] _There are no merge conflicts_
- [x] _You have reviewed your changes first_
- [x] _The pull request passes the provided CI pipeline_

## Other

The schema under `schema/nightly/bottom.json` was regenerated via `cargo
run --features generate_schema --bin schema`; the only diff is the new
`default_sort` entry on `ProcessesConfig`, mirroring what's already
there on `DiskConfig` and `TemperatureConfig`.

---------

Co-authored-by: ClementTsang <dev@cjhtsang.ca>
2026-05-08 00:31:08 -04:00
Clement Tsang 797129156d feature: add temperature graph (#2048)
Add support for a temperature graph widget. Quick-and-dirty implementation for now, will clean this up with other widgets later (maybe after adding a disk graph widget).
2026-05-03 07:19:49 +00:00
Clement Tsang 61e56754db feature: basic scrollbar support for tables and dialogs (#2046)
Adds scrollbars to dialogs (help, process kill) and optionally tables.
2026-04-25 09:47:15 +00:00
Clement Tsang 5d09d18469 feature: support showing a decimal place for CPU usage (#2045)
* feature: support showing a decimal place for CPU usage

* update docs + changelog + schema

* fix basic cpu formatting
2026-04-21 23:27:25 -04:00
Adarsh Das 4b59c04547 feature: support negation in queries (#1948)
This PR adds the ability to use negation in queries. For example, `!=` as an equality operator `(cpu != 10)` and around groups, like `!(cpu > 5 or mem < 10)`.

---------

Co-authored-by: ClementTsang <34804052+ClementTsang@users.noreply.github.com>
2026-04-21 02:44:46 -04:00
Clement Tsang ae425d09d8 feature: add new table_gap option with a drawn-line option (#2039)
This PR replaces the `hide_table_gap` option with a new `table_gap` option that controls whether a space is drawn, a line is drawn, or nothing is drawn.
2026-04-17 08:02:16 +00:00
Clement Tsang 53f0236050 ci: migrate from cirrus for 2.17 to cross (#2022)
* ci: migrate from cirrus for 2.17 to cross

CirrusCI is going to be stopped soon after the OAI acquisition, so we're
on a clock to move away from it. Thankfully, we only use it for 2.17
builds for CentOS.

Looks like supporting 2.17 is natively supported by cross
(https://github.com/cross-rs/cross/issues/680), so this PR tries to use
that to do it instead.

* it's uppercase

* use older version

* revert + pin version

* typo

* allow overriding artifact name

* update comment
2026-04-11 21:09:39 +00:00
Clement Tsang a797ad79c5 docs: update contribution docs (#2018) 2026-04-11 08:14:36 +00:00
dastarruer 8cb217cd19 feature: add a global bg_color option for widgets (#1979)
* feature: add global bg_color option

* period

* fmt

* oops, format again

* update default config + schema

* rename field + apply it to dialogs

* update dialog to just draw once

* handle basic

* add test + some small tweaks

---------

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
2026-04-11 03:59:25 -04:00
Clement Tsang 8a38f89113 docs: add note about justifying dep changes (#2016) 2026-04-11 06:50:10 +00:00
Clement Tsang 7496bbdd54 feature: configurable default sort column for temperature and disk table widgets. (#2003)
Adds support for configuring the default sort column for temperature and disk widgets via config file.
2026-03-21 17:23:16 -04:00
Filipe Paniguel c7b436056a docs: fix typo in total read column docs (#1967) 2026-01-27 11:25:54 -05:00
Clement Tsang 8add5183ad docs: add banner for nightly version (#1931)
* docs: try and add notification for nightly version

* hmmm

* hmmmm

* I forgot to run the banner

* fix spacing

* some more comments

* fmt
2025-12-26 00:58:11 -05:00
Clement Tsang 4d34265971 docs: add nightly release redirect hook (#1928)
* docs: update copyright year

* docs: add nightly release redirect

* trigger docs in nightly

* workflow_call

* chmod

* fix for potential time delay?

* fix post release too

* prune runs that ran today too

* update docs
2025-12-25 19:57:38 -05:00
Clement Tsang d6f05157c4 docs: add some info on winget (#1925) 2025-12-25 15:42:43 -05:00
Clement Tsang 9b9262b3cb ci: test workaround to immutable release issue on nightly (#1907)
Workaround is to create nightly as a draft and then use `gh` to manually publish it after. Also a lot of other small fixes.
2025-12-20 21:34:11 -05:00
rezky_nightky f277dff2b2 fix: correct spelling across docs, comments, and configs (#1891) 2025-11-30 16:42:06 -05:00
Adarsh Das 45b2522929 feature: add readonly mode (#1861)
* init

* Fixed code smells

* Updated documentation as per feedback
2025-11-17 06:03:46 -05:00
Adarsh Das c813b220af feature: add spacebar shortcut to toggle process tree nodes (#1830)
* feature: added spacebar as a toggle for proc tree mode

* bug: added check if the app is currently in search widget state

* refactor: moved the if statements inside the match case

* docs: added documentation for Spaec as tree toggle

* revert: changes

* feat: added space key to toggle tree

* refactor: clippy errors

* docs: updated documentation for space as toggle

* feat: experimental change to Minus, collapse entire tree

* fix: clippy errors

* feat: finished - and + as full tree collapse/expand

* refactor: clippy errors

* Made the all collapse function more concise

* Changed i32 calls to Pid

* updated help text

* Fixed array

* reverted total collapse and expand of trees

* array fix
2025-11-16 17:34:35 -05:00
Clement Tsang bda29e6564 docs: some rearragement of known issues + add NVIDIA musl issue (#1849)
* docs: some rearragement of known issues + add NVIDIA musl issue

* tweak comment

* non-musl too
2025-11-05 10:01:39 -05:00
Justin Martin 118bb5e061 feature: free arc (#1812)
* feature: free arc

* freebsd clippy no-default-features

* add alias to free_arc

* add get_threads to default config

* clippy

* code review: combine zfs feature and target_os build cfgs
2025-10-12 15:08:55 -04:00
Justin Martin b07f940970 feature: hide k-threads (#1772)
* hide k-threads init

comment

* add config for hide_k_threads

arg help

* update docs for hide_k_threads

* add test_toggle_k_thread for process_table

* update help text and schema

* add hide_k_threads to sample_configs default

* add Virt column to sample default config

* update sample demo config column name for schema ci

* force_rerender_and_update from toggle_k_threads for updates when frozen

* use is_kernel for ProcessType

* remove todo

* Apply suggestions from code review

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

---------

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
2025-09-07 18:56:56 -04:00
Clement Tsang d55e1a674f docs: fix missing pages + delete old filtering page (#1806) 2025-08-29 23:27:26 -04:00
Clement Tsang a35b81a187 docs: update docs page with missing features (#1805)
* add no key setting

* do it here instead of in main loop

* add a warning

* docs: update a bunch of docs with features

* linux-only test

* oop

* skip field check for other os

* oop

* easier way of doing it

* use dead code

* oop

* huh guess I don't need it
2025-08-29 23:12:19 -04:00
Clement Tsang 65a5d5314c docs: bump mkdocs-material, hide navigation for home page (#1774) 2025-08-06 23:57:35 +00:00
Clement Tsang 2132da2f8b feature: option to have process tree entries be collapsed by default (#1770)
* Add option to have process tree collapsed by default

* Fix collapse logic

* format

* tweak how it's done

* oops

* slight tweaks to the no-children collapse logic

* update schema

---------

Co-authored-by: ceres <ceres.bezuidenhout@trintel.co.za>
Co-authored-by: Bucket-Bucket-Bucket <107044719+Bucket-Bucket-Bucket@users.noreply.github.com>
2025-08-04 23:29:42 +00:00
Clement Tsang 51c67ee599 other: change how we calculate swap usage in Windows (#1769)
* bump sysinfo

* other: change how we calculate swap usage in Windows

* update changelog

* update comments

* add test?

* adjust test
2025-08-03 05:25:11 +00:00
Clement Tsang 98342617a1 refactor: update how we render and handle process kill dialogs (#1701)
* fmt

* temp work

* get yes/no working

* cleanup

* fill out some more buttons

* conditional compilation

* update

* update docs

* wait this just works

* like 80% of the way there

* some stuff around the killing screen

* mouse works

* done!

* clippy

* more stuff

* fix some imports for windows

* android fixes

* oop

* ahh

* hmm
2025-06-08 04:46:31 -04:00
Yuri Astrakhan 729f714bf9 feature: allow left to collapse trees and right to expand them (#1306)
Allow using the left arrow to collapse a tree branch in the process widget, or a right arrow to expand it.

---------

Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
2025-04-21 03:01:18 -04:00
Clement Tsang 86b7ef331e feature: support delete key to kill processes (#1717)
* feature: support delete key to kill processes

* clippy

* Changelog

* fn + delete
2025-04-19 06:51:49 +00:00
Clement Tsang 146b8596cf refactor: some refactoring while stable graphs (#1715)
* update grids

* asdfadf

* asdf

* b

* update loggers

* some formatting and refactoring

* docs

* some comments

* more docs
2025-04-14 06:13:20 +00:00
Clement Tsang f8b8a21748 docs: use local link in docs to reference itself & missing CPU config (#1704)
* docs: use local link in docs to reference itself

* also fix missing cpu config docs
2025-03-28 04:22:40 +00:00
Clement Tsang a90490fe83 docs: update README and autocomplete docs (#1699)
* formatting

* update autocomplete
2025-03-21 09:21:04 +00:00
Clement Tsang 2afd32fbb0 docs: update font-related troubleshooting (#1695) 2025-03-21 02:56:19 -04:00
Clement Tsang 9999a4824a docs: update documentation around how grouping processes and tree mode are incompatible (#1679)
* update default config

* use info, not note
2025-02-21 11:04:08 +00:00
Fotis Gimian cf91c73b60 feature: make it possible to override generate dirs via env (#1658) 2025-01-18 15:27:24 -05:00
Ada Ahmed 479276bd53 feature: Support AMDGPU Data Collection (#1641)
* gpu: support amdgpu tracking

Co-authored-by: lvxnull2 <184518908+lvxnull2@users.noreply.github.com>

* gpu: dependency-free amdgpu parsing

gpu: fix clippy issues

Co-authored-by: lvxnull2 <184518908+lvxnull2@users.noreply.github.com>

* gpu: change memory usage percentage to be scaled to total memory instead of current memory usage

gpu: requested syntax changes

Co-authored-by: lvxnull2 <184518908+lvxnull2@users.noreply.github.com>

---------

Co-authored-by: lvxnull2 <184518908+lvxnull2@users.noreply.github.com>
2024-12-20 02:48:32 -05:00
Clement Tsang a095e67179 change: default config location on macOS considers XDG config var (#1570)
Actually support $XDG_CONFIG_HOME on macOS. Apparently in our docs we also say we do, but we, uh, don't, because dirs doesn't.

Note this is backwards-compatible, in that if a config file exists in the old default locations, we will check those first.
2024-08-22 01:00:55 +00:00
Clement Tsang 5a009987ac docs: update docs around disable_gpu change. (#1562)
* docs: update changelog

* update docs
2024-08-14 20:27:32 -04:00
Clement Tsang b5b36f7c73 docs: update docs and requirements as of 2024-08-05 (#1545) 2024-08-05 19:03:18 -04:00
Clement Tsang feb0c6912c bug: fix default_cpu_entry arg not being used and missing from docs (#1543) 2024-08-05 18:55:05 -04:00
Zeb Piasecki d6c2ef3e22 feat: add option to move avg CPU to another row (#1487)
Adds an `average_cpu_row` option to move the average CPU usage to its own row
when using basic mode.
2024-08-03 01:10:36 -04:00
Clement Tsang 9364955bcd docs: fix invalid flag in docs (#1523)
The docs set the colour theme as a config flag, but we moved colours to styles.theme so that's invalid.
2024-08-01 11:03:14 -04:00
Clement Tsang a6e1ea3bd8 docs: update docs on filter (#1519)
Updates some outdated docs on filtering, and adds some tests as well. In particular, this also adds a cfg_attr on tests to try and catch unknown fields; we'll be more lenient in prod builds though and allow them.
2024-07-31 06:41:30 +00:00
Clement Tsang 2c0fb2a723 other: clarify config file creation logic/code (#1518) 2024-07-31 05:33:32 +00:00
Clement Tsang f091ebdc6a feature: support simple colour settings for text fields too (#1511)
* feature: support simple colour settings for text fields too

* also add 'color' back to some options

* tests
2024-07-30 07:15:23 +00:00
Clement Tsang 28972a1e64 refactor: refactor styling options (#1499)
Introduce a new configuration system for styling.
2024-07-29 09:03:35 +00:00
Clement Tsang ee2e1fee1c refactor: use struct for args instead of builder interface (#1472)
* start moving args

* tmp

* refactor config

* port over ags

* update changelog
2024-05-27 01:16:37 -04:00
Michal Bryxí e4f3b6911a docs: Which table goes "flags" under? (#1452)
- There is currently no indication under which [table](https://toml.io/en/v1.0.0#table) do "flags" go in the config file.
- I think having that being explicitly spelled out & having an example saves quite a bit of people's time. Would for me 🙃
2024-04-30 11:13:23 -04:00