From d226e6199f0a28c1ff1c7739f024e7dc6cb40a39 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Thu, 30 Sep 2021 22:48:03 +0200 Subject: [PATCH 1/5] Fixed: Cpu percent formatting if over 10'000 --- src/btop_draw.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index 0234d3a..7406d15 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -1418,6 +1418,7 @@ namespace Proc { else if (p.cpu_p >= 10'000) { cpu_str = to_string(p.cpu_p / 1000); cpu_str.resize(3); + if (cpu_str.ends_with('.')) cpu_str.pop_back(); cpu_str += "k"; } string mem_str = (mem_bytes ? floating_humanizer(p.mem, true) : ""); From 304b9af4e86d571530256668a449448ef194a9dd Mon Sep 17 00:00:00 2001 From: aristocratos Date: Thu, 30 Sep 2021 22:49:14 +0200 Subject: [PATCH 2/5] Fixed: Exception handling for faulty net download/upload speed --- src/linux/btop_collect.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index d8ea597..56730e7 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -1007,7 +1007,10 @@ namespace Net { auto& saved_stat = net.at(iface).stat.at(dir); auto& bandwidth = net.at(iface).bandwidth.at(dir); - const uint64_t val = max((uint64_t)stoul(readfile(sys_file, "0")), saved_stat.last); + uint64_t val = saved_stat.last; + try { val = max((uint64_t)stoul(readfile(sys_file, "0")), val); } + catch (const std::invalid_argument&) {} + catch (const std::out_of_range&) {} //? Update speed, total and top values saved_stat.speed = round((double)(val - saved_stat.last) / ((double)(new_timestamp - timestamp) / 1000)); From ae7b8b77ff31f66f2384a4de243e99a6cc5e63a3 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Thu, 30 Sep 2021 22:51:05 +0200 Subject: [PATCH 3/5] Version bump --- src/btop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btop.cpp b/src/btop.cpp index 02ca177..bef5a16 100644 --- a/src/btop.cpp +++ b/src/btop.cpp @@ -55,7 +55,7 @@ namespace Global { {"#801414", "██████╔╝ ██║ ╚██████╔╝██║ ╚═╝ ╚═╝"}, {"#000000", "╚═════╝ ╚═╝ ╚═════╝ ╚═╝"}, }; - const string Version = "1.0.11"; + const string Version = "1.0.12"; int coreCount; string overlay; From 8d393b858feb7ddf8ebe044cfe0ffa5e3bf906ae Mon Sep 17 00:00:00 2001 From: aristocratos Date: Thu, 30 Sep 2021 22:56:14 +0200 Subject: [PATCH 4/5] Version > Release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6278b0a..9cd7ba7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ![Linux](https://img.shields.io/badge/-Linux-grey?logo=linux) ![Usage](https://img.shields.io/badge/Usage-System%20resource%20monitor-yellow) ![c++20](https://img.shields.io/badge/cpp-c%2B%2B20-green) -![btop_version](https://img.shields.io/github/v/tag/aristocratos/btop?label=version) +![latest_release](https://img.shields.io/github/v/tag/aristocratos/btop?label=release) [![Donate](https://img.shields.io/badge/-Donate-yellow?logo=paypal)](https://paypal.me/aristocratos) [![Sponsor](https://img.shields.io/badge/-Sponsor-red?logo=github)](https://github.com/sponsors/aristocratos) [![Coffee](https://img.shields.io/badge/-Buy%20me%20a%20Coffee-grey?logo=Ko-fi)](https://ko-fi.com/aristocratos) From a15f961b2f0fe642ee61e2331c0d109fab7e9b05 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Fri, 1 Oct 2021 15:24:41 +0200 Subject: [PATCH 5/5] Updated Prerequisites --- README.md | 1 + src/btop_tools.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cd7ba7..1247fb5 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ Also needs a UTF8 locale and a font that covers: * Unicode Block “Braille Patterns” U+2800 - U+28FF (Not needed in TTY mode or with graphs set to type: block or tty.) * Unicode Block “Geometric Shapes” U+25A0 - U+25FF * Unicode Block "Box Drawing" and "Block Elements" U+2500 - U+259F +* Unicode Block "General punctuation" U+2005 ### **Notice (Text rendering issues)** diff --git a/src/btop_tools.cpp b/src/btop_tools.cpp index c897b1b..bb75f2f 100644 --- a/src/btop_tools.cpp +++ b/src/btop_tools.cpp @@ -339,7 +339,8 @@ namespace Tools { for (string readstr; getline(file, readstr); out += readstr); } catch (const std::exception& e) { - throw std::runtime_error("readfile() : Exception when reading " + (string)path + " : " + e.what()); + Logger::error("readfile() : Exception when reading " + (string)path + " : " + e.what()); + return fallback; } return (out.empty() ? fallback : out); }