From 16733215a26f134c6110add8b6ffd258053f6022 Mon Sep 17 00:00:00 2001 From: Toni500git Date: Wed, 2 Oct 2024 16:45:52 +0200 Subject: [PATCH] misc: rename some modules names such as user.term and theme.cursor --- src/main.cpp | 18 +++++++++++------- src/parse.cpp | 8 ++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3c94221..153c7b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ #include "config.hpp" #include "display.hpp" +#include "fmt/compile.h" #include "gui.hpp" #include "switch_fnv1a.hpp" #include "util.hpp" @@ -18,10 +19,14 @@ : (optarg != NULL)) using namespace std::string_view_literals; +using namespace fmt::literals; static void version() { - fmt::println("customfetch {} branch {}", VERSION, BRANCH); + // {fmt} lib doesn't like fmt::println() + // why? I know that "just put the newline \n and shut up" (nobody said it) + // but would be nice :) + fmt::print("customfetch {} branch {}\n"_cf, VERSION, BRANCH); #ifdef GUI_MODE fmt::println("GUI mode enabled"); @@ -120,9 +125,9 @@ user shell_version : login shell version (may be not correct) [5.9] de_name : Desktop Enviroment current session name [Plasma] wm_name : Windows manager current session name [dwm, xfwm4] - term : Terminal name and version [alacritty 0.13.2] - term_name : Terminal name [alacritty] - term_version : Terminal version [0.13.2] + terminal : Terminal name and version [alacritty 0.13.2] + terminal_name : Terminal name [alacritty] + terminal_version: Terminal version [0.13.2] builtin title : user and hostname colored with ${{auto2}} [toni@arch2] @@ -136,7 +141,7 @@ builtin # such as indeed cursor # because it is not GTK-Qt specific theme - cursor : cursor name [Bibata-Modern-Ice] + cursor_name : cursor name [Bibata-Modern-Ice] cursor_size : cursor size [16] # the N stands for the gtk version number to query @@ -232,8 +237,7 @@ static std::string parse_config_path(int argc, char* argv[], const std::string& int option_index = 0; opterr = 0; const char *optstring = "-C:"; - static const struct option opts[] = - { + static const struct option opts[] = { {"config", required_argument, 0, 'C'}, {0,0,0,0} }; diff --git a/src/parse.cpp b/src/parse.cpp index bbdb0af..736b313 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -1026,14 +1026,14 @@ void addValueFromModule(systemInfo_t& sysInfo, const std::string& moduleName, co SYSINFO_INSERT(query_user.wm_name(query_user.m_bDont_query_dewm, query_user.term_name())); break; - case "term"_fnv1a16: + case "terminal"_fnv1a16: SYSINFO_INSERT(prettify_term_name(query_user.term_name()) + ' ' + query_user.term_version(query_user.term_name())); break; - case "term_name"_fnv1a16: SYSINFO_INSERT(prettify_term_name(query_user.term_name())); break; + case "terminal_name"_fnv1a16: SYSINFO_INSERT(prettify_term_name(query_user.term_name())); break; - case "term_version"_fnv1a16: SYSINFO_INSERT(query_user.term_version(query_user.term_name())); break; + case "terminal_version"_fnv1a16: SYSINFO_INSERT(query_user.term_version(query_user.term_name())); break; } } } @@ -1049,7 +1049,7 @@ void addValueFromModule(systemInfo_t& sysInfo, const std::string& moduleName, co { switch (moduleMember_hash) { - case "cursor"_fnv1a16: SYSINFO_INSERT(query_theme.cursor()); break; + case "cursor_name"_fnv1a16: SYSINFO_INSERT(query_theme.cursor()); break; case "cursor_size"_fnv1a16: SYSINFO_INSERT(query_theme.cursor_size()); break; } }