Skip to content

Commit

Permalink
Fixed: io_graph_speeds config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
aristocratos committed Sep 11, 2022
1 parent c3b6c64 commit 2ed7bdf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/btop_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ namespace Config {

{"io_graph_combined", "#* Set to True to show combined read/write io graphs in io mode."},

{"io_graph_speeds", "#* Set the top speed for the io graphs in MiB/s (100 by default), use format \"mountpoint:speed\" separate disks with whitespace \" \".\n"
"#* Example: \"/mnt/media:100 /:20 /boot:1\"."},
{"io_graph_speeds", "#* Set the top speed for the io graphs in MiB/s (100 by default), use format \"device:\\speed\" separate disks with whitespace \" \".\n"
"#* Example: \"C:\\100 D:\\20 G:\\1\"."},

{"net_download", "#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False."},

Expand Down Expand Up @@ -407,7 +407,7 @@ namespace Config {
const auto maps = ssplit(value);
bool all_good = true;
for (const auto& map : maps) {
const auto map_split = ssplit(map, ':');
const auto map_split = ssplit(map, '\\');
if (map_split.size() != 2)
all_good = false;
else if (map_split.at(0).empty() or not isint(map_split.at(1)))
Expand Down
6 changes: 3 additions & 3 deletions src/btop_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,10 @@ namespace Mem {
if (not Config::getS("io_graph_speeds").empty()) {
auto split = ssplit(Config::getS("io_graph_speeds"));
for (const auto& entry : split) {
auto vals = ssplit(entry);
if (vals.size() == 2 and mem.disks.contains(vals.at(0)) and isint(vals.at(1)))
auto vals = ssplit(entry, '\\');
if (vals.size() == 2 and mem.disks.contains(vals.at(0) + "\\") and isint(vals.at(1)))
try {
custom_speeds[vals.at(0)] = std::stoi(vals.at(1));
custom_speeds[vals.at(0) + "\\"] = std::stoi(vals.at(1));
}
catch (const std::out_of_range&) { continue; }
}
Expand Down
4 changes: 2 additions & 2 deletions src/btop_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ namespace Menu {
"equals 100 percent in the io graphs.",
"(100 MiB/s by default).",
"",
"Format: \"device:speed\" separate disks with",
"Format: \"device:\\speed\" separate disks with",
"whitespace \" \".",
"",
"Example: \"/dev/sda:100, /dev/sdb:20\"."},
"Example: \"C:\\100, D:\\20\"."},
{"show_page",
"If page memory should be shown in memory box.",
"",
Expand Down

0 comments on commit 2ed7bdf

Please sign in to comment.