From 6cab38f097f851c155e167990773acaba99a0349 Mon Sep 17 00:00:00 2001 From: Steffen Winter Date: Wed, 23 Apr 2025 21:52:55 +0200 Subject: [PATCH] Fix various typos in code, themes and workflows --- .github/workflows/continuous-build-linux.yml | 2 +- CMakeLists.txt | 2 +- src/btop_cli.cpp | 6 +++--- src/btop_menu.cpp | 14 +++++++------- src/btop_tools.hpp | 2 +- src/netbsd/btop_collect.cpp | 2 +- src/osx/smc.cpp | 2 +- themes/adwaita-dark.theme | 2 +- themes/phoenix-night.theme | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/continuous-build-linux.yml b/.github/workflows/continuous-build-linux.yml index 7d05f4b..78bb603 100644 --- a/.github/workflows/continuous-build-linux.yml +++ b/.github/workflows/continuous-build-linux.yml @@ -115,7 +115,7 @@ jobs: mkdir .artifacts mkdir .package - - name: Create binary atrifacts + - name: Create binary artifacts run: | TOOLCHAIN=${{ matrix.toolchain }} GIT_HASH=$(git rev-parse --short "${{ github.sha }}") diff --git a/CMakeLists.txt b/CMakeLists.txt index 57949eb..7b47aee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,7 +198,7 @@ if(BTOP_STATIC) target_link_options(btop PRIVATE -static LINKER:--fatal-warnings) endif() -# Other platform depdendent flags +# Other platform dependent flags if(APPLE) target_link_libraries(btop $ $ diff --git a/src/btop_cli.cpp b/src/btop_cli.cpp index cfc02b7..e47b59a 100644 --- a/src/btop_cli.cpp +++ b/src/btop_cli.cpp @@ -122,7 +122,7 @@ namespace Cli { auto preset_id = std::clamp(std::stoi(arg.data()), 0, 9); cli.preset = std::make_optional(preset_id); } catch (std::invalid_argument& e) { - error("Preset must be a positiv number"); + error("Preset must be a positive number"); return OrRetCode { 1 }; } continue; @@ -139,7 +139,7 @@ namespace Cli { auto refresh_rate = std::min(std::stoul(arg.data()), 100UL); cli.updates = refresh_rate; } catch (std::invalid_argument& e) { - error("Update must be a positiv number"); + error("Update must be a positive number"); return OrRetCode { 1 }; } continue; @@ -165,7 +165,7 @@ namespace Cli { " {2}-p, --preset {1} Start with a preset (0-9)\n" " {2}-t, --tty{1} Force tty mode with ANSI graph symbols and 16 colors only\n" " {2} --no-tty{1} Force disable tty mode\n" - " {2}-u, --update {1} Set an inital update rate in milliseconds\n" + " {2}-u, --update {1} Set an initial update rate in milliseconds\n" " {2}-h, --help{1} Show this help message and exit\n" " {2}-V, --version{1} Show a version message and exit (more with --version)\n", BOLD_UNDERLINE, RESET, BOLD diff --git a/src/btop_menu.cpp b/src/btop_menu.cpp index 144fa59..289224e 100644 --- a/src/btop_menu.cpp +++ b/src/btop_menu.cpp @@ -1170,8 +1170,8 @@ namespace Menu { return (redraw ? Changed : retval); } - static int optionsMenu(const string& key) { - enum Predispositions { isBool, isInt, isString, is2D, isBrowseable, isEditable}; +static int optionsMenu(const string& key) { + enum Predispositions { isBool, isInt, isString, is2D, isBrowsable, isEditable}; static int y{}; static int x{}; static int height{}; @@ -1383,7 +1383,7 @@ namespace Menu { recollect = true; } } - else if (selPred.test(isBrowseable)) { + else if (selPred.test(isBrowsable)) { auto& optList = optionsList.at(option).get(); int i = v_index(optList, Config::getS(option)); @@ -1438,9 +1438,9 @@ namespace Menu { if (not selPred.test(isString)) selPred.set(is2D); else if (optionsList.contains(selOption)) { - selPred.set(isBrowseable); + selPred.set(isBrowsable); } - if (not selPred.test(isBrowseable) and (selPred.test(isString) or selPred.test(isInt))) + if (not selPred.test(isBrowsable) and (selPred.test(isString) or selPred.test(isInt))) selPred.set(isEditable); } @@ -1475,14 +1475,14 @@ namespace Menu { out += Mv::to(cy++, x + 1) + (c-1 == selected ? Theme::c("selected_bg") + Theme::c("selected_fg") : Theme::c("title")) + Fx::b + cjust(capitalize(s_replace(option, "_", " ")) - + (c-1 == selected and selPred.test(isBrowseable) + + (c-1 == selected and selPred.test(isBrowsable) ? ' ' + to_string(v_index(optionsList.at(option).get(), (option == "color_theme" ? Config::getS("color_theme") : value)) + 1) + '/' + to_string(optionsList.at(option).get().size()) : ""), 29); out += Mv::to(cy++, x + 1) + (c-1 == selected ? "" : Theme::c("main_fg")) + Fx::ub + " " + (c-1 == selected and editing ? cjust(editor(24), 34, true) : cjust(value, 25, true)) + " "; if (c-1 == selected) { - if (not editing and (selPred.test(is2D) or selPred.test(isBrowseable))) { + if (not editing and (selPred.test(is2D) or selPred.test(isBrowsable))) { out += Fx::b + Mv::to(cy-1, x+2) + Symbols::left + Mv::to(cy-1, x+28) + Symbols::right; mouse_mappings["left"] = {cy-2, x, 2, 5}; mouse_mappings["right"] = {cy-2, x+25, 2, 5}; diff --git a/src/btop_tools.hpp b/src/btop_tools.hpp index b07b7af..41399d7 100644 --- a/src/btop_tools.hpp +++ b/src/btop_tools.hpp @@ -211,7 +211,7 @@ namespace Tools { //* Replace in with and return new string string s_replace(const string& str, const string& from, const string& to); - //* Capatilize + //* Capitalize inline string capitalize(string str) { str.at(0) = toupper(str.at(0)); return str; diff --git a/src/netbsd/btop_collect.cpp b/src/netbsd/btop_collect.cpp index 93adb50..89ca564 100644 --- a/src/netbsd/btop_collect.cpp +++ b/src/netbsd/btop_collect.cpp @@ -972,7 +972,7 @@ namespace Net { } } - //? Get total recieved and transmitted bytes + device address if no ip was found + //? Get total received and transmitted bytes + device address if no ip was found for (const auto &iface : interfaces) { for (const string dir : {"download", "upload"}) { auto &saved_stat = net.at(iface).stat.at(dir); diff --git a/src/osx/smc.cpp b/src/osx/smc.cpp index 6c483db..c972d29 100644 --- a/src/osx/smc.cpp +++ b/src/osx/smc.cpp @@ -147,7 +147,7 @@ namespace Cpu { return IOConnectCallStructMethod(conn, index, // inputStructure inputStructure, structureInputSize, - // ouputStructure + // outputStructure outputStructure, &structureOutputSize); } diff --git a/themes/adwaita-dark.theme b/themes/adwaita-dark.theme index a16f672..5702f64 100644 --- a/themes/adwaita-dark.theme +++ b/themes/adwaita-dark.theme @@ -10,7 +10,7 @@ theme[main_fg]="#deddda" # Title color for boxes theme[title]="#deddda" -# Higlight color for keyboard shortcuts +# Highlight color for keyboard shortcuts theme[hi_fg]="#62a0ea" # Background color of selected item in processes box diff --git a/themes/phoenix-night.theme b/themes/phoenix-night.theme index 4ee2e9b..b0ab2eb 100644 --- a/themes/phoenix-night.theme +++ b/themes/phoenix-night.theme @@ -14,7 +14,7 @@ theme[main_fg]="#cfc9c2" # Title color for boxes theme[title]="#cfc9c2" -# Higlight color for keyboard shortcuts +# Highlight color for keyboard shortcuts theme[hi_fg]="#7dcfff" # Background color of selected item in processes box