diff --git a/docs/content/configuration/command-line-options.md b/docs/content/configuration/command-line-options.md index cc4f740a..d191df33 100644 --- a/docs/content/configuration/command-line-options.md +++ b/docs/content/configuration/command-line-options.md @@ -77,7 +77,7 @@ see information on these options by running `btm -h`, or run `btm --help` to dis | `--network_use_binary_prefix` | Displays the network widget with binary prefixes. | | `--network_use_log` | Displays the network widget with a log scale. | | `--show_packets` | Displays packet rate and average packet size info. | -| `--use_old_network_legend` | (DEPRECATED) Uses a separate network legend. | +| `--use_old_network_legend` | Uses a separate network legend. | ## Battery Options diff --git a/docs/content/configuration/config-file/flags.md b/docs/content/configuration/config-file/flags.md index 94b191ec..f857b18e 100644 --- a/docs/content/configuration/config-file/flags.md +++ b/docs/content/configuration/config-file/flags.md @@ -14,49 +14,49 @@ hide_avg_cpu = true Most of the [command line flags](../command-line-options.md) 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. | -| `cpu_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) or String (represents human time) | Sets a refresh rate in ms. | -| `default_time_value` | Unsigned Int (represents milliseconds) or String (represents human time) | Default time value for graphs in ms. | -| `time_delta` | Unsigned Int (represents milliseconds) or String (represents human time) | The amount in ms changed upon zooming. | -| `hide_time` | Boolean | Hides the time scale. | -| `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. | -| `enable_cache_memory` | Boolean | Enable cache and buffer memory stats (not available on Windows). | -| `process_memory_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. | -| `show_table_scroll_bar` | Boolean | Shows a scroll bar on the right edge of table widgets. | -| `process_command` | Boolean | Show processes as their commands by default. | -| `disable_advanced_kill` | Boolean | Disable being able to send signals to processes on supported Unix-like systems. Only available on Linux, macOS, and FreeBSD. | -| `read_only` | Boolean | Prevents performing any actions that affect the system (e.g. stopping processes). | -| `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. | -| `disable_gpu` | Boolean | Disable NVIDIA and AMD GPU data collection. | -| `retention` | String (human readable time, such as "10m", "1h", etc.) | How much data is stored at once in terms of time. | -| `unnormalized_cpu` | Boolean | Show process CPU% without normalizing over the number of cores. | -| `expanded` | Boolean | Expand the default widget upon starting the app. | -| `memory_legend` | String (one of ["none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right"]) | Where to place the legend for the memory widget. | -| `network_legend` | String (one of ["none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right"]) | Where to place the legend for the network widget. | -| `average_cpu_row` | Boolean | Moves the average CPU usage entry to its own row when using basic mode. | -| `tree_collapse` | Boolean | Collapse process tree by default. | -| `autohide_time` | Boolean | Temporarily shows the time scale in graphs. | -| `table_gap` | String (one of ["none", "space", "line"]) | Controls the gap between table headers and data rows. Defaults to "space". | -| `disable_keys` | Boolean | Disables keyboard shortcuts, including the ones that stop bottom. | -| `no_write` | Boolean | Disables writing to the config file. | -| `hide_k_threads` | Boolean | Hide kernel threads from being shown. | -| `free_arc` | Boolean | Subtract freeable ARC from memory usage. | +| Field | Type | Functionality | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `hide_avg_cpu` | Boolean | Deprecated - use `cpu.hide_avg_cpu`. Hides the average CPU usage. | +| `dot_marker` | Boolean | Uses a dot marker for graphs. | +| `cpu_left_legend` | Boolean | Deprecated - use `cpu.left_legend`. Puts the CPU chart legend to the left side. | +| `current_usage` | Boolean | Deprecated - use `processes.current_usage`. Sets process CPU% to be based on current CPU%. | +| `group_processes` | Boolean | Deprecated - use `processes.default_grouped`. Groups processes with the same name by default. | +| `case_sensitive` | Boolean | Deprecated - use `processes.case_sensitive`. Enables case sensitivity by default. | +| `whole_word` | Boolean | Deprecated - use `processes.whole_word`. Enables whole-word matching by default. | +| `regex` | Boolean | Deprecated - use `processes.regex`. 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) or String (represents human time) | Sets a refresh rate in ms. | +| `default_time_value` | Unsigned Int (represents milliseconds) or String (represents human time) | Default time value for graphs in ms. | +| `time_delta` | Unsigned Int (represents milliseconds) or String (represents human time) | The amount in ms changed upon zooming. | +| `hide_time` | Boolean | Hides the time scale. | +| `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. | +| `enable_cache_memory` | Boolean | Deprecated - use `memory.cache_memory`. Enable cache and buffer memory stats (not available on Windows). | +| `process_memory_as_value` | Boolean | Deprecated - use `processes.default_memory_value`. Defaults to showing process memory usage by value. | +| `tree` | Boolean | Deprecated - use `processes.default_tree`. Defaults to showing the process widget in tree mode. | +| `show_table_scroll_position` | Boolean | Shows the scroll position tracker in table widgets. | +| `show_table_scroll_bar` | Boolean | Shows a scroll bar on the right edge of table widgets. | +| `process_command` | Boolean | Deprecated - use `processes.process_command`. Show processes as their commands by default. | +| `disable_advanced_kill` | Boolean | Deprecated - use `processes.disable_advanced_kill`. Disable being able to send signals to processes on supported Unix-like systems. Only available on Linux, macOS, and FreeBSD. | +| `read_only` | Boolean | Prevents performing any actions that affect the system (e.g. stopping processes). | +| `network_use_binary_prefix` | Boolean | Deprecated - use `network_graph.use_binary_prefix`. Displays the network widget with binary prefixes. | +| `network_use_bytes` | Boolean | Deprecated - use `network_graph.use_bytes`. Displays the network widget using bytes. | +| `network_use_log` | Boolean | Deprecated - use `network_graph.use_log`. Displays the network widget with a log scale. | +| `disable_gpu` | Boolean | Disable NVIDIA and AMD GPU data collection. | +| `retention` | String (human readable time, such as "10m", "1h", etc.) | How much data is stored at once in terms of time. | +| `unnormalized_cpu` | Boolean | Deprecated - use `processes.unnormalized_cpu`. Show process CPU% without normalizing over the number of cores. | +| `expanded` | Boolean | Expand the default widget upon starting the app. | +| `memory_legend` | String (one of ["none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right"]) | Deprecated - use `memory.legend_position`. Where to place the legend for the memory widget. | +| `network_legend` | String (one of ["none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right"]) | Deprecated - use `network_graph.legend_position`. Where to place the legend for the network widget. | +| `average_cpu_row` | Boolean | Deprecated - use `cpu.basic_average_cpu_row`. Moves the average CPU usage entry to its own row when using basic mode. | +| `tree_collapse` | Boolean | Deprecated - use `processes.tree_collapse`. Collapse process tree by default. | +| `autohide_time` | Boolean | Temporarily shows the time scale in graphs. | +| `table_gap` | String (one of ["none", "space", "line"]) | Controls the gap between table headers and data rows. Defaults to "space". | +| `disable_keys` | Boolean | Disables keyboard shortcuts, including the ones that stop bottom. | +| `no_write` | Boolean | Disables writing to the config file. | +| `hide_k_threads` | Boolean | Deprecated - use `processes.hide_k_threads`. Hide kernel threads from being shown. | +| `free_arc` | Boolean | Deprecated - use `memory.free_arc`. Subtract freeable ARC from memory usage. | diff --git a/docs/content/configuration/config-file/temperature-graph.md b/docs/content/configuration/config-file/temperature-graph.md index cde48985..c033f625 100644 --- a/docs/content/configuration/config-file/temperature-graph.md +++ b/docs/content/configuration/config-file/temperature-graph.md @@ -14,9 +14,9 @@ legend_position = "top-right" ## Upper Limit -By default, the y-axis is bounded at 100°C (or the equivalent in the configured `temperature_type`) and grows +By default, the y-axis is bounded at 100°C (or the equivalent in the configured temperature unit) and grows automatically if a reading exceeds that. An explicit upper bound can be set with `max_temp` (uses the same unit as -`temperature_type`). Sensor readings above this value will be drawn off the chart. +the configured temperature unit). Sensor readings above this value will be drawn off the chart. ```toml [temperature_graph] diff --git a/docs/content/usage/widgets/temperature-graph.md b/docs/content/usage/widgets/temperature-graph.md index 91db9686..1074dc54 100644 --- a/docs/content/usage/widgets/temperature-graph.md +++ b/docs/content/usage/widgets/temperature-graph.md @@ -5,7 +5,7 @@ The temperature graph widget provides temperature readings over time. ## Features Each detected sensor is drawn as its own line. The y-axis is in the configured temperature unit (Celsius by default; -see the `temperature_type` flag). +see the `--celsius`/`--fahrenheit`/`--kelvin` arguments or `flags.temperature_type` config option). By default the y-axis is bounded at 100°C (or the equivalent in the configured unit) and grows automatically. An upper bound can also be set explicitly via the [config file](../../configuration/config-file/temperature-graph.md). diff --git a/sample_configs/default_config.toml b/sample_configs/default_config.toml index f26f9d51..82b4178d 100644 --- a/sample_configs/default_config.toml +++ b/sample_configs/default_config.toml @@ -6,9 +6,11 @@ # added when running (ie: btm -a) will override this config file if an option # is also set here. [flags] +# Deprecated - use cpu.hide_avg_cpu. # Whether to hide the average cpu entry. #hide_avg_cpu = false +# Deprecated - use cpu.basic_average_cpu_row. # Whether to use a dedicated row for the average cpu entry #average_cpu_row = false @@ -18,25 +20,32 @@ # The update rate of the application. #rate = "1s" +# Deprecated - use cpu.left_legend. # Whether to put the CPU legend to the left. #cpu_left_legend = false +# Deprecated - use processes.current_usage. # Whether to set CPU% on a process to be based on the total CPU or just current usage. #current_usage = false +# Deprecated - use processes.unnormalized_cpu. # 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). #unnormalized_cpu = false +# Deprecated - use processes.default_grouped. # Whether to group processes with the same name together by default. Doesn't do anything # if tree is set to true or --tree is set. #group_processes = false +# Deprecated - use processes.case_sensitive. # Whether to make process searching case sensitive by default. #case_sensitive = false +# Deprecated - use processes.whole_word. # Whether to make process searching look for matching the entire word by default. #whole_word = false +# Deprecated - use processes.regex. # Whether to make process searching use regex by default. #regex = false @@ -83,9 +92,11 @@ # Disable keyboard shortcuts #disable_keys = false +# Deprecated - use processes.default_memory_value. # Show memory values in the processes widget as values by default #process_memory_as_value = false +# Deprecated - use processes.default_tree. # Show tree mode by default in the processes widget. #tree = false @@ -95,45 +106,56 @@ # Show a scroll bar on the right edge of table widgets. #show_table_scroll_bar = false +# Deprecated - use processes.process_command. # Show processes as their commands by default in the process widget. #process_command = false +# Deprecated - use network_graph.use_binary_prefix. # Displays the network widget with binary prefixes. #network_use_binary_prefix = false +# Deprecated - use network_graph.use_bytes. # Displays the network widget using bytes. #network_use_bytes = false +# Deprecated - use network_graph.use_log. # Displays the network widget with a log scale. #network_use_log = false +# Deprecated - use processes.disable_advanced_kill. # Hides advanced options to stop a process on Unix-like systems. #disable_advanced_kill = false # Prevents performing any actions that affect the system (e.g. stopping processes). #read_only = false -# Hides the kernel threads +# Deprecated - use processes.hide_k_threads. +# Hide kernel threads from being shown. #hide_k_threads = false # Hide GPU(s) information #disable_gpu = false +# Deprecated - use memory.cache_memory. # Shows cache and buffer memory #enable_cache_memory = false +# Deprecated - use memory.free_arc. # Subtract freeable ARC from memory usage #free_arc = false # How much data is stored at once in terms of time. #retention = "10m" +# Deprecated - use memory.legend_position. # Where to place the legend for the memory widget. One of "none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right". #memory_legend = "top-right" +# Deprecated - use network_graph.legend_position. # Where to place the legend for the network widget. One of "none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right". #network_legend = "top-right" + # Processes widget configuration #[processes] # The columns shown by the process widget. The following columns are supported (the GPU columns are only available if the GPU feature is enabled when built): @@ -147,6 +169,43 @@ # Gather process child thread information #get_threads = false +# Hide kernel threads from being shown. Linux only. +#hide_k_threads = false + +# Collapse the process tree by default when tree mode is set. +#tree_collapse = false + +# Shows the full command name instead of the process name by default. +#process_command = false + +# Disable the advanced kill dialog and just show the basic one with no options. Only available on Linux, macOS, and FreeBSD. +#disable_advanced_kill = false + +# Defaults to showing process memory usage by value. +#default_memory_value = false + +# Groups processes with the same name by default. No effect if tree is set. +#default_grouped = false + +# Enables regex by default while searching. +#regex = false + +# Enables case sensitivity by default when searching. +#case_sensitive = false + +# Enables whole-word matching by default while searching. +#whole_word = false + +# Makes the process widget use tree mode by default. +#default_tree = false + +# Calculates process CPU usage as a percentage of current usage rather than total usage. +#current_usage = false + +# Show process CPU% usage without averaging over the number of CPU cores. +#unnormalized_cpu = false + + # CPU widget configuration #[cpu] # One of "all" (default), "average"/"avg" @@ -155,6 +214,7 @@ # Whether to show a decimal place for CPU usage values. #show_decimal = false + # Disk widget configuration #[disk] @@ -203,6 +263,7 @@ # Whether to require matching the whole word. Defaults to false. #whole_word = false + # Temperature widget configuration #[temperature] @@ -229,6 +290,7 @@ # Whether to require matching the whole word. Defaults to false. #whole_word = false + # Temperature graph widget configuration #[temperature_graph] @@ -236,7 +298,7 @@ #legend_position = "top-right" # An upper temperature value for the graph; entries higher than this will be hidden. If not set, -# there is no limit. Is in the unit of `temperature_type`. +# there is no limit. Is in the configured temperature unit. #max_temp = 100.0 # By default, there are no temperature sensor filters enabled. An example use case is provided below. @@ -256,6 +318,7 @@ # Whether to require matching the whole word. Defaults to false. #whole_word = false + # Network widget configuration #[network_graph] # By default, there are no network interface filters enabled. An example use case is provided below. @@ -275,6 +338,7 @@ # Whether to require matching the whole word. Defaults to false. #whole_word = false + # These are all the components that support custom theming. Note that colour support # will depend on terminal support. #[styles] # Uncomment if you want to use custom styling diff --git a/schema/nightly/bottom.json b/schema/nightly/bottom.json index 11764829..2a6affb7 100644 --- a/schema/nightly/bottom.json +++ b/schema/nightly/bottom.json @@ -1268,7 +1268,7 @@ "default": null }, "max_temp": { - "description": "An upper temperature value for the graph; entries higher than this will be hidden. If not set,\nthere is no limit.\n\nIs in the unit of `temperature_type`.", + "description": "An upper temperature value for the graph; entries higher than this will be hidden. If not set,\nthere is no limit.\n\nIs in the configured temperature unit.", "type": [ "number", "null" diff --git a/src/constants.rs b/src/constants.rs index 4665e041..bde6c88d 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -255,9 +255,11 @@ pub(crate) const CONFIG_TEXT: &str = r#"# This is a default config file for bott # added when running (ie: btm -a) will override this config file if an option # is also set here. [flags] +# Deprecated - use cpu.hide_avg_cpu. # Whether to hide the average cpu entry. #hide_avg_cpu = false +# Deprecated - use cpu.basic_average_cpu_row. # Whether to use a dedicated row for the average cpu entry #average_cpu_row = false @@ -267,25 +269,32 @@ pub(crate) const CONFIG_TEXT: &str = r#"# This is a default config file for bott # The update rate of the application. #rate = "1s" +# Deprecated - use cpu.left_legend. # Whether to put the CPU legend to the left. #cpu_left_legend = false +# Deprecated - use processes.current_usage. # Whether to set CPU% on a process to be based on the total CPU or just current usage. #current_usage = false +# Deprecated - use processes.unnormalized_cpu. # 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). #unnormalized_cpu = false +# Deprecated - use processes.default_grouped. # Whether to group processes with the same name together by default. Doesn't do anything # if tree is set to true or --tree is set. #group_processes = false +# Deprecated - use processes.case_sensitive. # Whether to make process searching case sensitive by default. #case_sensitive = false +# Deprecated - use processes.whole_word. # Whether to make process searching look for matching the entire word by default. #whole_word = false +# Deprecated - use processes.regex. # Whether to make process searching use regex by default. #regex = false @@ -332,9 +341,11 @@ pub(crate) const CONFIG_TEXT: &str = r#"# This is a default config file for bott # Disable keyboard shortcuts #disable_keys = false +# Deprecated - use processes.default_memory_value. # Show memory values in the processes widget as values by default #process_memory_as_value = false +# Deprecated - use processes.default_tree. # Show tree mode by default in the processes widget. #tree = false @@ -344,42 +355,52 @@ pub(crate) const CONFIG_TEXT: &str = r#"# This is a default config file for bott # Show a scroll bar on the right edge of table widgets. #show_table_scroll_bar = false +# Deprecated - use processes.process_command. # Show processes as their commands by default in the process widget. #process_command = false +# Deprecated - use network_graph.use_binary_prefix. # Displays the network widget with binary prefixes. #network_use_binary_prefix = false +# Deprecated - use network_graph.use_bytes. # Displays the network widget using bytes. #network_use_bytes = false +# Deprecated - use network_graph.use_log. # Displays the network widget with a log scale. #network_use_log = false +# Deprecated - use processes.disable_advanced_kill. # Hides advanced options to stop a process on Unix-like systems. #disable_advanced_kill = false # Prevents performing any actions that affect the system (e.g. stopping processes). #read_only = false +# Deprecated - use processes.hide_k_threads. # Hide kernel threads from being shown. #hide_k_threads = false # Hide GPU(s) information #disable_gpu = false +# Deprecated - use memory.cache_memory. # Shows cache and buffer memory #enable_cache_memory = false +# Deprecated - use memory.free_arc. # Subtract freeable ARC from memory usage #free_arc = false # How much data is stored at once in terms of time. #retention = "10m" +# Deprecated - use memory.legend_position. # Where to place the legend for the memory widget. One of "none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right". #memory_legend = "top-right" +# Deprecated - use network_graph.legend_position. # Where to place the legend for the network widget. One of "none", "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right". #network_legend = "top-right" @@ -526,7 +547,7 @@ pub(crate) const CONFIG_TEXT: &str = r#"# This is a default config file for bott #legend_position = "top-right" # An upper temperature value for the graph; entries higher than this will be hidden. If not set, -# there is no limit. Is in the unit of `temperature_type`. +# there is no limit. Is in the configured temperature unit. #max_temp = 100.0 # By default, there are no temperature sensor filters enabled. An example use case is provided below. diff --git a/src/options/config/flags.rs b/src/options/config/flags.rs index cafaf54c..ff64c9c5 100644 --- a/src/options/config/flags.rs +++ b/src/options/config/flags.rs @@ -28,7 +28,6 @@ impl TableGap { #[cfg_attr(test, serde(deny_unknown_fields), derive(PartialEq, Eq))] pub(crate) struct GeneralConfig { pub(crate) dot_marker: Option, - pub(crate) temperature_type: Option, pub(crate) rate: Option, pub(crate) basic: Option, pub(crate) default_time_value: Option, @@ -50,6 +49,7 @@ pub(crate) struct GeneralConfig { pub(crate) read_only: Option, pub(crate) disable_gpu: Option, pub(crate) retention: Option, + pub(crate) temperature_type: Option, // FIXME: Deprecate these in the future. pub(crate) hide_avg_cpu: Option, diff --git a/src/options/config/temperature_graph.rs b/src/options/config/temperature_graph.rs index 6565940f..215de474 100644 --- a/src/options/config/temperature_graph.rs +++ b/src/options/config/temperature_graph.rs @@ -17,7 +17,7 @@ pub(crate) struct TempGraphConfig { /// An upper temperature value for the graph; entries higher than this will be hidden. If not set, /// there is no limit. /// - /// Is in the unit of `temperature_type`. + /// Is in the configured temperature unit. #[serde(default)] pub(crate) max_temp: Option, } diff --git a/tests/integration/valid_config_tests.rs b/tests/integration/valid_config_tests.rs index 3718624e..358bad74 100644 --- a/tests/integration/valid_config_tests.rs +++ b/tests/integration/valid_config_tests.rs @@ -38,6 +38,10 @@ fn run_and_kill(args: &[&str]) { handle.kill().unwrap(); } +fn run_and_kill_cfg(path: &str) { + run_and_kill(&["-C", path]); +} + #[test] fn test_basic() { run_and_kill(&[]); @@ -52,7 +56,7 @@ fn test_bad_basic() { #[test] fn test_empty() { - run_and_kill(&["-C", "./tests/valid_configs/empty_config.toml"]); + run_and_kill_cfg("./tests/valid_configs/empty_config.toml"); } #[cfg(feature = "default")] @@ -152,110 +156,121 @@ fn test_demo() { #[test] fn test_many_proc() { - run_and_kill(&["-C", "./tests/valid_configs/many_proc.toml"]); + run_and_kill_cfg("./tests/valid_configs/many_proc.toml"); } #[test] fn test_all_proc() { - run_and_kill(&["-C", "./tests/valid_configs/all_proc.toml"]); + run_and_kill_cfg("./tests/valid_configs/all_proc.toml"); } #[test] fn test_cpu_doughnut() { - run_and_kill(&["-C", "./tests/valid_configs/cpu_doughnut.toml"]); + run_and_kill_cfg("./tests/valid_configs/cpu_doughnut.toml"); } #[test] fn test_theme() { - run_and_kill(&["-C", "./tests/valid_configs/theme.toml"]); + run_and_kill_cfg("./tests/valid_configs/theme.toml"); } #[test] fn test_styling_sanity_check() { - run_and_kill(&["-C", "./tests/valid_configs/styling.toml"]); + run_and_kill_cfg("./tests/valid_configs/styling.toml"); } #[test] fn test_styling_sanity_check_2() { - run_and_kill(&["-C", "./tests/valid_configs/all_styling.toml"]); + run_and_kill_cfg("./tests/valid_configs/all_styling.toml"); } #[test] fn test_color_spelling_is_valid() { - run_and_kill(&["-C", "./tests/valid_configs/all_styling_color.toml"]); + run_and_kill_cfg("./tests/valid_configs/all_styling_color.toml"); } #[test] fn test_filtering() { - run_and_kill(&["-C", "./tests/valid_configs/filtering.toml"]); + run_and_kill_cfg("./tests/valid_configs/filtering.toml"); } #[test] fn test_proc_columns() { - run_and_kill(&["-C", "./tests/valid_configs/proc_columns.toml"]); + run_and_kill_cfg("./tests/valid_configs/proc_columns.toml"); } #[cfg(target_os = "linux")] #[test] fn test_linux_only() { - run_and_kill(&["-C", "./tests/valid_configs/os_specific/linux.toml"]); + run_and_kill_cfg("./tests/valid_configs/os_specific/linux.toml"); } #[test] fn test_temp_disk_sort_columns() { - run_and_kill(&["-C", "./tests/valid_configs/temp_disk_sort_columns.toml"]); + run_and_kill_cfg("./tests/valid_configs/temp_disk_sort_columns.toml"); } #[test] fn test_proc_default_sort() { - run_and_kill(&["-C", "./tests/valid_configs/proc_default_sort.toml"]); + run_and_kill_cfg("./tests/valid_configs/proc_default_sort.toml"); } #[test] fn test_newer_memory() { - run_and_kill(&["-C", "./tests/valid_configs/newer_memory.toml"]); + run_and_kill_cfg("./tests/valid_configs/widget/memory.toml"); } #[test] fn test_newer_cpu() { - run_and_kill(&["-C", "./tests/valid_configs/newer_cpu.toml"]); + run_and_kill_cfg("./tests/valid_configs/widget/cpu.toml"); } #[test] fn test_newer_processes() { - run_and_kill(&["-C", "./tests/valid_configs/newer_processes.toml"]); + run_and_kill_cfg("./tests/valid_configs/widget/processes.toml"); } #[test] fn test_newer_network() { - run_and_kill(&["-C", "./tests/valid_configs/newer_network.toml"]); + run_and_kill_cfg("./tests/valid_configs/widget/network.toml"); } #[test] fn test_network_alias() { - run_and_kill(&["-C", "./tests/valid_configs/network_alias.toml"]); + run_and_kill_cfg("./tests/valid_configs/network_alias.toml"); } /// This uses deprecated network settings - once they are removed, this test file should be moved to invalid configs. #[test] fn test_deprecated_network() { - run_and_kill(&["-C", "./tests/valid_configs/deprecated/network.toml"]); + run_and_kill_cfg("./tests/valid_configs/deprecated/network.toml"); } /// This uses deprecated process settings - once they are removed, this test file should be moved to invalid configs. #[test] fn test_deprecated_processes() { - run_and_kill(&["-C", "./tests/valid_configs/deprecated/processes.toml"]); + run_and_kill_cfg("./tests/valid_configs/deprecated/processes.toml"); } /// This uses deprecated CPU settings - once they are removed, this test file should be moved to invalid configs. #[test] fn test_deprecated_cpu() { - run_and_kill(&["-C", "./tests/valid_configs/deprecated/cpu.toml"]); + run_and_kill_cfg("./tests/valid_configs/deprecated/cpu.toml"); } /// This uses deprecated memory settings - once they are removed, this test file should be moved to invalid configs. #[test] fn test_deprecated_memory() { - run_and_kill(&["-C", "./tests/valid_configs/deprecated/memory.toml"]); + run_and_kill_cfg("./tests/valid_configs/deprecated/memory.toml"); +} + +#[test] +fn test_newer_temperature() { + run_and_kill_cfg("./tests/valid_configs/widget/temperature.toml"); +} + +/// This uses deprecated temperature settings - once they are removed, this test file should be moved to invalid configs. +#[test] +fn test_deprecated_temperature() { + run_and_kill_cfg("./tests/valid_configs/deprecated/temperature.toml"); } diff --git a/tests/valid_configs/deprecated/temperature.toml b/tests/valid_configs/deprecated/temperature.toml new file mode 100644 index 00000000..707a5d3c --- /dev/null +++ b/tests/valid_configs/deprecated/temperature.toml @@ -0,0 +1 @@ +# This uses deprecated temperature settings - once they are removed, this test file should be moved to invalid configs. diff --git a/tests/valid_configs/newer_cpu.toml b/tests/valid_configs/widget/cpu.toml similarity index 100% rename from tests/valid_configs/newer_cpu.toml rename to tests/valid_configs/widget/cpu.toml diff --git a/tests/valid_configs/newer_memory.toml b/tests/valid_configs/widget/memory.toml similarity index 100% rename from tests/valid_configs/newer_memory.toml rename to tests/valid_configs/widget/memory.toml diff --git a/tests/valid_configs/newer_network.toml b/tests/valid_configs/widget/network.toml similarity index 100% rename from tests/valid_configs/newer_network.toml rename to tests/valid_configs/widget/network.toml diff --git a/tests/valid_configs/newer_processes.toml b/tests/valid_configs/widget/processes.toml similarity index 100% rename from tests/valid_configs/newer_processes.toml rename to tests/valid_configs/widget/processes.toml diff --git a/tests/valid_configs/widget/temperature.toml b/tests/valid_configs/widget/temperature.toml new file mode 100644 index 00000000..65f0f0d6 --- /dev/null +++ b/tests/valid_configs/widget/temperature.toml @@ -0,0 +1,11 @@ +# This uses the newer temperature config location. + +[temperature] +default_sort = "Temp" + +[temperature.sensor_filter] +is_list_ignored = true +list = ["cpu", "wifi"] +regex = false +case_sensitive = false +whole_word = false