Skip to content

Commit

Permalink
misc: rename some modules names such as user.term and theme.cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Oct 2, 2024
1 parent 7579862 commit 1673321
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 11 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "config.hpp"
#include "display.hpp"
#include "fmt/compile.h"
#include "gui.hpp"
#include "switch_fnv1a.hpp"
#include "util.hpp"
Expand All @@ -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");
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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}
};
Expand Down
8 changes: 4 additions & 4 deletions src/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 1673321

Please sign in to comment.