<!-- 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:_
## 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>
<!-- 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:_
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).
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>
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.
* 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
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.
* 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
* 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
* 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>
This PR adds a vhs "tape" file to automatically do the demo gif
recording. The point of this is to make it more consistent/easy to do,
and this has the benefit of making a smaller gif file.