Skip to content

Commit a3c7cd6

Browse files
committed
parse: add os.name_id + main: fix ascii-logo-type
1 parent ab58a2a commit a3c7cd6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/main.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ NOTE: there are modules such as "user.de_version" that may slow down cufetch bec
140140
cufetch is still fast tho :)
141141
142142
os
143-
name : OS name (pretty_name) [Ubuntu 22.04.4 LTS, Arch Linux]
143+
name : OS name (pretty name) [Ubuntu 22.04.4 LTS, Arch Linux]
144+
name_id : OS name id [ubuntu, arch]
144145
kernel : kernel name and version [Linux 6.9.3-zen1-1-zen]
145146
kernel_name : kernel name [Linux]
146147
kernel_version: kernel version [6.9.3-zen1-1-zen]
@@ -500,12 +501,16 @@ int main(int argc, char *argv[])
500501

501502
if (!config.ascii_logo_type.empty() && config.m_display_distro)
502503
{
503-
const size_t& pos = path.rfind('.');
504+
std::string logo_type_path{path};
505+
const size_t pos = path.rfind('.');
504506

505507
if (pos != std::string::npos)
506-
path.insert(pos, "_" + config.ascii_logo_type);
508+
logo_type_path.insert(pos, "_" + config.ascii_logo_type);
507509
else
508-
path += "_" + config.ascii_logo_type;
510+
logo_type_path += "_" + config.ascii_logo_type;
511+
512+
if (std::filesystem::exists(logo_type_path))
513+
path = logo_type_path;
509514
}
510515

511516
if (!std::filesystem::exists(path) && !config.m_disable_source)

src/parse.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,8 @@ void addValueFromModule(const std::string& moduleName, const std::string& module
885885
{
886886
case "name"_fnv1a16: SYSINFO_INSERT(query_system.os_pretty_name()); break;
887887

888+
case "name_id"_fnv1a16: SYSINFO_INSERT(query_system.os_id()); break;
889+
888890
case "uptime"_fnv1a16:
889891
SYSINFO_INSERT(get_auto_uptime(uptime_days, uptime_hours.count() % 24, uptime_mins.count() % 60,
890892
uptime_secs.count() % 60, config));

0 commit comments

Comments
 (0)