uptick: 0.10.0 (#1510)

* uptick: 0.10.0

* docs: fix changelog

* bump lockfile

* match clap

* add/update schema

* add note
This commit is contained in:
Clement Tsang 2024-08-01 06:45:57 +00:00 committed by GitHub
parent a6e1ea3bd8
commit 8afae3fbe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1471 additions and 47 deletions

View file

@ -79,7 +79,7 @@ body:
It would also be helpful if you are not running [the latest version](https://github.com/ClementTsang/bottom/releases/latest)
to try that as well to see if the issue has already been resolved.
placeholder: 0.9.7
placeholder: 0.10.0
- type: textarea
id: install

View file

@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.10.0] - Unreleased
## [0.10.0] - 2024-08-01
### Features
@ -47,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1355](https://github.com/ClementTsang/bottom/pull/1355): Reduce chances of non-D0 devices waking up due to temperature checks on Linux.
- [#1410](https://github.com/ClementTsang/bottom/pull/1410): Fix uptime calculation for Linux.
## [0.9.7] - 2023-08-26
## [0.9.7] - 2024-07-26
## Bug Fixes

49
Cargo.lock generated
View file

@ -243,9 +243,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.6"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f"
checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
[[package]]
name = "cfg-if"
@ -267,9 +267,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "clap"
version = "4.5.11"
version = "4.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3"
checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc"
dependencies = [
"clap_builder",
"clap_derive",
@ -277,9 +277,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.11"
version = "4.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa"
checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99"
dependencies = [
"anstream",
"anstyle",
@ -290,9 +290,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "4.5.11"
version = "4.5.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6ae69fbb0833c6fcd5a8d4b8609f108c7ad95fc11e248d853ff2c42a90df26a"
checksum = "a8670053e87c316345e384ca1f3eba3006fc6355ed8b8a1140d104e109e3df34"
dependencies = [
"clap",
]
@ -319,9 +319,9 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.11"
version = "4.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e"
checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@ -657,9 +657,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "indexmap"
version = "2.2.6"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
dependencies = [
"equivalent",
"hashbrown",
@ -763,9 +763,9 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "lru"
version = "0.12.3"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc"
checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904"
dependencies = [
"hashbrown",
]
@ -1267,11 +1267,12 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.120"
version = "1.0.121"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609"
dependencies = [
"itoa",
"memchr",
"ryu",
"serde",
]
@ -1355,9 +1356,9 @@ dependencies = [
[[package]]
name = "signal-hook-mio"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af"
checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd"
dependencies = [
"libc",
"mio",
@ -1561,18 +1562,18 @@ dependencies = [
[[package]]
name = "toml_datetime"
version = "0.6.7"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db"
checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
version = "0.22.17"
version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [
"indexmap",
"serde",
@ -1928,9 +1929,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
version = "0.6.16"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c"
checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
dependencies = [
"memchr",
]

View file

@ -82,7 +82,7 @@ generate_schema = ["schemars", "serde_json", "strum"]
anyhow = "1.0.86"
backtrace = "0.3.73"
cfg-if = "1.0.0"
clap = { version = "4.5.11", features = ["default", "cargo", "wrap_help", "derive"] }
clap = { version = "4.5.13", features = ["default", "cargo", "wrap_help", "derive"] }
concat-string = "1.0.1"
crossterm = "0.27.0"
ctrlc = { version = "3.4.4", features = ["termination"] }
@ -148,8 +148,8 @@ predicates = "3.1.0"
portable-pty = "0.8.1"
[build-dependencies]
clap = { version = "4.5.11", features = ["default", "cargo", "wrap_help", "derive"] }
clap_complete = "4.5.11"
clap = { version = "4.5.13", features = ["default", "cargo", "wrap_help", "derive"] }
clap_complete = "4.5.12"
clap_complete_nushell = "4.5.3"
clap_complete_fig = "4.5.2"
clap_mangen = "0.2.23"

View file

@ -175,16 +175,16 @@ A `.deb` file is provided on each [stable release](https://github.com/ClementTsa
```bash
# x86-64
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.9.7/bottom_0.9.7_amd64.deb
sudo dpkg -i bottom_0.9.7_amd64.deb
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.10.0/bottom_0.10.0_amd64.deb
sudo dpkg -i bottom_0.10.0_amd64.deb
# ARM64
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.9.7/bottom_0.9.7_arm64.deb
sudo dpkg -i bottom_0.9.7_arm64.deb
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.10.0/bottom_0.10.0_arm64.deb
sudo dpkg -i bottom_0.10.0_arm64.deb
# ARM
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.9.7/bottom_0.9.7_armhf.deb
sudo dpkg -i bottom_0.9.7_armhf.deb
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.10.0/bottom_0.10.0_armhf.deb
sudo dpkg -i bottom_0.10.0_armhf.deb
```
### Exherbo Linux
@ -210,12 +210,12 @@ something like:
```bash
# x86-64
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.9.7/bottom-0.9.7-1.x86_64.rpm
sudo rpm -i bottom-0.9.7-1.x86_64.rpm
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.10.0/bottom-0.10.0-1.x86_64.rpm
sudo rpm -i bottom-0.10.0-1.x86_64.rpm
# Nightly x86-64
curl -LO https://github.com/ClementTsang/bottom/releases/download/nightly/bottom-0.9.7-1.x86_64.rpm
sudo rpm -i bottom-0.9.7-1.x86_64.rpm
curl -LO https://github.com/ClementTsang/bottom/releases/download/nightly/bottom-0.10.0-1.x86_64.rpm
sudo rpm -i bottom-0.10.0-1.x86_64.rpm
```
### Gentoo
@ -326,8 +326,8 @@ to do so using the most recent version of stable Rust, which is how the binaries
rustup update stable
# Option 1 - Download from releases and install
curl -LO https://github.com/ClementTsang/bottom/archive/0.9.7.tar.gz
tar -xzvf 0.9.7.tar.gz
curl -LO https://github.com/ClementTsang/bottom/archive/0.10.0.tar.gz
tar -xzvf 0.10.0.tar.gz
cargo install --path . --locked
# Option 2 - Clone the repo and install manually

View file

@ -1,7 +1,18 @@
# Config Schema
# Config JSON Schema
## Usage
## Generation
## Development
These are automatically generated from code using [`schemars`](https://github.com/GREsau/schemars). They're locked
behind a feature flag to avoid building unnecessary code for release builds, and you can generate them like so:
### How to add a new version
```bash
cargo run --features="generate_schema" -- --generate_schema > schema/nightly/bottom.json
```
## Publication
To publish these schemas, cut a new version by copying `nightly` to a new folder with a version number matching bottom's
(e.g. v0.10 if bottom is on v0.10.x bottom). Then, make a PR to [schemastore](https://github.com/SchemaStore/schemastore)
updating the catalog.
For more info, see the schemastore repo. An example PR can be found [here](https://github.com/SchemaStore/schemastore/pull/3571).

1023
schema/v0.10/bottom.json Normal file

File diff suppressed because it is too large Load diff

385
schema/v0.9/bottom.json Normal file
View file

@ -0,0 +1,385 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v1.0/bottom.json",
"$comment": "https://clementtsang.github.io/bottom/0.9.6/configuration/config-file/default-config/",
"title": "Schema for bottom's configs (v1.0)",
"type": "object",
"definitions": {
"row": {
"items": {
"properties": {
"ratio": {
"default": 1,
"type": "integer"
},
"type": {
"enum": ["cpu", "mem", "proc", "net", "temp", "disk", "empty"],
"type": "string"
},
"default": {
"default": true,
"type": "boolean"
}
},
"patternProperties": {
"row(.child)+": {
"$ref": "#/definitions/row"
}
},
"type": "object"
},
"type": "array"
},
"filter": {
"description": "hide specific temperature sensors, network interfaces, and disks using filters",
"properties": {
"is_list_ignored": {
"default": true,
"type": "boolean"
},
"list": {
"type": "array"
},
"regex": {
"default": true,
"type": "boolean"
},
"case_sensitive": {
"default": false,
"type": "boolean"
},
"whole_word": {
"default": false,
"type": "boolean"
}
},
"type": "object"
}
},
"properties": {
"flags": {
"description": "This group of options represents a command-line flag/option. Flags explicitly added when running (ie: btm -a) will override this config file if an option is also set here",
"properties": {
"hide_avg_cpu": {
"default": false,
"description": "Whether to hide the average cpu entry",
"type": "boolean"
},
"dot_marker": {
"default": false,
"description": "Whether to use dot markers rather than braille",
"type": "boolean"
},
"rate": {
"default": 1000,
"description": "The update rate of the application",
"type": "integer"
},
"left_legend": {
"default": false,
"description": "Whether to put the CPU legend to the left",
"type": "boolean"
},
"current_usage": {
"default": false,
"description": "Whether to set CPU% on a process to be based on the total CPU or just current usage",
"type": "boolean"
},
"unnormalized_cpu": {
"default": false,
"description": "Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus)",
"type": "boolean"
},
"group_processes": {
"default": false,
"description": "Whether to group processes with the same name together by default",
"type": "boolean"
},
"case_sensitive": {
"default": false,
"description": "Whether to make process searching case sensitive by default",
"type": "boolean"
},
"whole_word": {
"default": false,
"description": "Whether to make process searching look for matching the entire word by default",
"type": "boolean"
},
"regex": {
"default": false,
"description": "Whether to make process searching use regex by default",
"type": "boolean"
},
"temperature_type": {
"default": "k",
"enum": ["k", "f", "c", "kelvin", "fahrenheit", "celsius"],
"description": "Defaults to Celsius",
"type": "string"
},
"default_time_value": {
"default": 60000,
"description": "The default time interval in milliseconds",
"type": "integer"
},
"time_delta": {
"default": 15000,
"description": "The time delta on each zoom in/out action in milliseconds",
"type": "integer"
},
"hide_time": {
"default": false,
"description": "Hides the time scale",
"type": "boolean"
},
"default_widget_type": {
"default": "proc",
"description": "Override layout default widget",
"type": "string"
},
"default_widget_count": {
"default": 1,
"description": "Override layout default widget",
"type": "integer"
},
"expanded_on_startup": {
"default": true,
"description": "Expand selected widget upon starting the app",
"type": "boolean"
},
"basic": {
"default": false,
"description": "Use basic mode",
"type": "boolean"
},
"use_old_network_legend": {
"default": false,
"description": "Use the old network legend style",
"type": "boolean"
},
"hide_table_gap": {
"default": false,
"description": "Remove space in tables",
"type": "boolean"
},
"battery": {
"default": false,
"description": "Show the battery widgets",
"type": "boolean"
},
"disable_click": {
"default": false,
"description": "Disable mouse clicks",
"type": "boolean"
},
"color": {
"default": "default",
"enum": [
"default",
"default-light",
"gruvbox",
"gruvbox-light",
"nord",
"nord-light"
],
"description": "Built-in themes",
"type": "string"
},
"process_memory_as_value": {
"default": false,
"description": "Show memory values in the processes widget as values by default",
"type": "boolean"
},
"tree": {
"default": false,
"description": "Show tree mode by default in the processes widget",
"type": "boolean"
},
"show_table_scroll_position": {
"default": false,
"description": "Shows an indicator in table widgets tracking where in the list you are",
"type": "boolean"
},
"process_command": {
"default": false,
"description": "Show processes as their commands by default in the process widget",
"type": "boolean"
},
"network_use_binary_prefix": {
"default": false,
"description": "Displays the network widget with binary prefixes",
"type": "boolean"
},
"network_use_bytes": {
"default": false,
"description": "Displays the network widget using bytes",
"type": "boolean"
},
"network_use_log": {
"default": false,
"description": "Displays the network widget with a log scale",
"type": "boolean"
},
"disable_advanced_kill": {
"default": false,
"description": "Hides advanced options to stop a process on Unix-like systems",
"type": "boolean"
},
"enable_gpu_memory": {
"default": false,
"description": "Shows GPU(s) memory",
"type": "boolean"
},
"retention": {
"default": "10m",
"description": "How much data is stored at once in terms of time",
"type": "string"
}
},
"type": "object"
},
"colors": {
"description": "These are all the components that support custom theming. Note that colour support will depend on terminal support",
"properties": {
"table_header_color": {
"default": "LightBlue",
"description": "Represents the colour of table headers (processes, CPU, disks, temperature)",
"type": "string"
},
"widget_title_color": {
"default": "Gray",
"description": "Represents the colour of the label each widget has",
"type": "string"
},
"avg_cpu_color": {
"default": "Red",
"description": "Represents the average CPU color",
"type": "string"
},
"cpu_core_colors": {
"items": {
"uniqueItems": true,
"minItems": 1,
"type": "string"
},
"default": [
"LightMagenta",
"LightYellow",
"LightCyan",
"LightGreen",
"LightBlue",
"LightRed",
"Cyan",
"Green",
"Blue",
"Red"
],
"description": "Represents the colour the core will use in the CPU legend and graph",
"type": "array"
},
"ram_color": {
"default": "LightMagenta",
"description": "Represents the colour RAM will use in the memory legend and graph",
"type": "string"
},
"swap_color": {
"default": "LightYellow",
"description": "Represents the colour SWAP will use in the memory legend and graph",
"type": "string"
},
"arc_color": {
"default": "LightCyan",
"description": "Represents the colour ARC will use in the memory legend and graph",
"type": "string"
},
"gpu_core_colors": {
"items": {
"uniqueItems": true,
"minItems": 1,
"type": "string"
},
"default": [
"LightGreen",
"LightBlue",
"LightRed",
"Cyan",
"Green",
"Blue",
"Red"
],
"description": "Represents the colour the GPU will use in the memory legend and graph",
"type": "array"
},
"rx_color": {
"default": "LightCyan",
"description": "Represents the colour rx will use in the network legend and graph",
"type": "string"
},
"tx_color": {
"default": "LightGreen",
"description": "Represents the colour tx will use in the network legend and graph",
"type": "string"
},
"border_color": {
"default": "Gray",
"description": "Represents the colour of the border of unselected widgets",
"type": "string"
},
"highlighted_border_color": {
"default": "LightBlue",
"description": "Represents the colour of the border of selected widgets",
"type": "string"
},
"text_color": {
"default": "Gray",
"description": "Represents the colour of most text",
"type": "string"
},
"selected_text_color": {
"default": "Black",
"description": "Represents the colour of text that is selected",
"type": "string"
},
"selected_bg_color": {
"default": "LightBlue",
"description": "Represents the background colour of text that is selected",
"type": "string"
},
"graph_color": {
"default": "Gray",
"description": "Represents the colour of the lines and text of the graph",
"type": "string"
},
"high_battery_color": {
"default": "green",
"description": "Represents the colours of the battery based on charge",
"type": "string"
},
"medium_battery_color": {
"default": "yellow",
"description": "Represents the colours of the battery based on charge",
"type": "string"
},
"low_battery_color": {
"default": "red",
"description": "Represents the colours of the battery based on charge",
"type": "string"
}
}
},
"row": {
"$ref": "#/definitions/row"
},
"disk_filter": {
"$ref": "#/definitions/filter"
},
"mount_filter": {
"$ref": "#/definitions/filter"
},
"temp_filter": {
"$ref": "#/definitions/filter"
},
"net_filter": {
"$ref": "#/definitions/filter"
}
}
}

3
schema/v1.0/README.md Normal file
View file

@ -0,0 +1,3 @@
# v1.0
Note - this will be deleted soon in favour of moving to a schema versioning that matches bottom's.

View file

@ -308,6 +308,8 @@ fn generate_schema() -> anyhow::Result<()> {
}
fn main() -> anyhow::Result<()> {
// TODO: If there is any panic in any thread, send a cancellation token (or similar) to shut down everything.
// let _profiler = dhat::Profiler::new_heap();
let args = args::get_args();
@ -328,7 +330,6 @@ fn main() -> anyhow::Result<()> {
}
// Read from config file.
let config = get_or_create_config(args.general.config_location.as_deref())?;
// Create the "app" and initialize a bunch of stuff.