Commit Graph

2499 Commits

Author SHA1 Message Date
ClementTsang e55bb7b59f update changelog 2026-05-19 02:56:46 -04:00
Clement Tsang acb0ddfa53 docs: update wording for auto-completion (#2068) 2026-05-19 02:37:49 -04:00
Clement Tsang 6aabb589b8 docs: update changelog (#2067) 2026-05-18 03:39:28 -04:00
Clement Tsang a629056da9 other: support cgroups for CPU usage% calculations (#2066)
This change makes it so we consider cgroup settings (namely, number of allowed CPUs) when considering average CPU usage/process CPU usage.
2026-05-18 07:36:53 +00:00
Clement Tsang a0c96cfd6e other: clean up config file migrations (#2065)
Cleaning up a bunch of config file migration work.
2026-05-16 01:49:33 -04:00
Clement Tsang 65acf5e49e other: move cpu and memory settings over (#2064) 2026-05-15 20:00:44 -04:00
Clement Tsang 899914591e other: migrate over process config fields to [processes] (#2063)
Migrate over process config fields from the general `[flags]` to `[processes]`. Similar to #2062, this only deprecates them at the moment.
2026-05-13 03:14:19 -04:00
Clement Tsang edc295e3ed other: partial migration of network/memory config options from flags (#2062)
This change moves some options to a more appropriate section for the config file. This only deprecates the old options for now, so they're still valid, but we will remove them later (maybe after the next stable release, to give warning).

One thing I want to do for the legend position options is maybe expand it, and now is the best time to do so, but for now I'm just copying it over verbatim.

The deprecated options will also emit a warning to stderr.

This PR also contains a driveby to alias `[network]` to `[network_graph]`.
2026-05-12 04:59:59 -04:00
Clement Tsang 859ec27a05 feature: take cgroups into account for memory usage (#2061)
This PR adds support for taking cgroup usage/total into account when calculating memory and swap usage.
2026-05-10 07:40:18 +00:00
Adarsh Das 0b783a0176 feature: add search in help dialog (#1953)
This PR adds fuzzy search to the help dialog spawned by ? shortcut.

---

Co-authored-by: ClementTsang <dev@cjhtsang.ca>
2026-05-09 22:26:58 -04:00
Clement Tsang 55d5402603 refactor: small time series graph refactor (#2060)
Just a quick refactor.
2026-05-09 07:30:34 +00:00
Clement Tsang 2c7c6c25be refactor: group together time series graph component logic (#2059)
This refactor unifies the draw and state logic for the time series graph
"components" - things that we build bottom widgets out of. In this case,
it's just the time series graphs, which things like the temperature graph,
network graph, memory usage graph, and cpu graph use.

This is a pretty big refactor in terms of things moved around, but
functionality-wise there is no change.
2026-05-08 02:40:43 -04:00
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
allcontributors[bot] abad5b6f1e docs: add ChrisJr404 as a contributor for code (#2057)
Adds @ChrisJr404 as a contributor for code.

This was requested by ClementTsang [in this
comment](https://github.com/ClementTsang/bottom/pull/2053#issuecomment-4403347027)

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2026-05-08 00:31:23 -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 a45a66278b docs: update README (#2056)
<!-- 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**:_

## 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)_
- [ ] _Linux (specify distro below)_
- [ ] _Other (specify below)_

## Checklist

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

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

## Other

_Anything else that maintainers should know about this PR:_
2026-05-07 23:25:45 -04:00
Clement Tsang f52ad0acab refactor: more time series graph cleanup (#2054)
Moves all the stuff I was passing around on each zoom function call as just part of the widget state.
2026-05-07 01:47:25 -04:00
Clement Tsang e6700c9899 refactor: wrap timeseries state access (#2051)
Wrap the common code around timeseries state access as a helper. Should help with code deduplication.
2026-05-05 05:23:50 +00:00
Clement Tsang 9aa3e24b9a refactor: unify some time series graph logic, part 1 (#2050)
Part 1 of a series of PRs to unify and clean up time series graph logic. This PR mostly just unifies the zoom logic and common states.
2026-05-04 06:54:07 +00: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 735543f1bf ci: temp workaround caused by FreeBSD repo returning error (#2049)
Based on the discussion in https://github.com/freebsd/pkg/issues/2653, it seems like just manually fetching might work...?
2026-05-03 00:13:06 -04:00
Clement Tsang a9863107c8 refactor: clean up some duplicated code when parsing options (#2047)
Cleans up some duplicated code for parsing args/config files using macros/wrapper functions.
2026-04-25 10:38:18 +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 711584badd deps: bump rand to 0.8.6 (#2043)
See https://github.com/rust-random/rand/issues/1770. We were basically
never going to hit this edge case anyway but might as well.
2026-04-18 06:33:09 +00:00
Clement Tsang b0ab3e99e7 bug: address possible memory usage growth in AMD GPU stat gathering (#2042)
* driveby changelog update

* fix missing cleanup for AMD GPU stat gathering

* update changelog

* relegate counter to get_amd_vecs
2026-04-18 02:00:35 -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 f8b4fef9d3 ci: bump rust version in CI to 1.95.0 (#2041) 2026-04-17 07:16:51 +00:00
Clement Tsang f98041ea18 docs: update changelog (#2038) 2026-04-14 01:40:46 -04:00
Ada Freya Ahmed fc7f9f4ce1 other: update amdgpu marketing names (#2037) 2026-04-14 01:40:29 -04:00
Clement Tsang 8b548ada95 refactor: run nightly fmt (#2036)
* refactor: run nightly fmt

* manually fix some multilines

* run it again
2026-04-13 05:34:53 +00:00
Clement Tsang d187559af9 refactor: generalize input field logic for easier reuse (#2035)
* add generalized input field file

* partial migration

* even more!

* app is clean

* move over canvas

* finish migrating

* fmt

* update and generate some tests

* Add test comments

* fix logic issue with me trying to avoid a second cursor

* fix delete word behaviour with unicode

* update changelog

* remove unused reset

* some test updates + cleanup

* clippy

* comment

* remove redundant shrink_to_fit
2026-04-13 01:24:24 -04:00
Clement Tsang 3545a31881 refactor: run nightly format (#2033)
Run `cargo +nightly fmt` using the nightly options (other than wrap comments).
2026-04-12 20:39:30 +00:00
Clement Tsang 92451063bc docs: update changelog (#2032) 2026-04-12 14:48:59 -04:00
Clement Tsang 0f0fa21f91 feature: show graph legend in more situations (#2031)
This PR makes it so that instead of always just hiding the entire legend if it's too big for the current size, we instead show less parts of the legend to make it fit. For example, if it's too tall, we just show less entries. If it is too wide, but other entries still would fit, we truncate the entries that are too long so they fit.

This is somewhat helpful because in the memory widget, the GPU entry at the moment is causing the legend to hide in situations where it used to not. We can also do more work to make that better, but IMO not always hiding the legend also makes sense to have in general.
2026-04-12 03:03:16 -04:00
Clement Tsang ddd8d87324 ci: fix else if -> elif typo in docs.yml (#2030) 2026-04-12 00:21:38 -04:00
Clement Tsang 0af259c878 ci: fix incorrect asset name for 2.17 linux builds (#2029)
* ci: fix incorrect asset name for 2.17 linux builds

* other stufF
2026-04-11 23:56:57 -04:00
Clement Tsang ede0070ac7 ci: fix post-release trigger + typo in post-release (#2028) 2026-04-11 23:15:29 -04:00
Clement Tsang 8f962d4bde ci: clean up doc CI jobs (#2027)
* remove unnecessary nightly release override

* unify to use docs.yml
2026-04-11 22:46:48 -04:00
Clement Tsang 056748ba9f ci: tweak workflow permissions more (#2026)
* ci: fix clear cache workflow permissions

* fix perms for deployment/nightly

* more finely scope other tasks

* fix nightly

* change name

* fix docs permissions
2026-04-11 22:50:03 +00:00
Clement Tsang 731564b656 ci: test using no permissions by default for most CI jobs + bump setup-python (#2025)
* ci: test using no permissions by default for most CI jobs

* Also require production approval for a release upload

* remove build_release individual 'job'

* tweak some stuff

* driveby bump on setup-python to 6.2.0 to fix node20 warnings

* remove bsd vm check name
2026-04-11 17:48:58 -04: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 13a36016ed ci: update rust-cache and actions/checkout with node 24 support (#2024)
Progressively updating more GHA things to work with node24.
2026-04-11 16:52:16 -04:00
Clement Tsang 336e716232 ci: replace skip-duplicate-actions with personal fork to fix node 20 warnings (#2023)
Use a personal fork of skip-duplicate-actions that bumps it to node 24.
2026-04-11 16:29:26 -04:00
Clement Tsang 8353f15a55 refactor: effectively vendor nohash (#2019) 2026-04-11 04:55:33 -04:00
Clement Tsang a797ad79c5 docs: update contribution docs (#2018) 2026-04-11 08:14:36 +00:00
allcontributors[bot] 6122daa9f4 docs: add dastarruer as a contributor for code (#2017)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2026-04-11 08:00:50 +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