Skip to content

Commit

Permalink
parse: add os.name_id + main: fix ascii-logo-type
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Nov 4, 2024
1 parent ab58a2a commit a3c7cd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ NOTE: there are modules such as "user.de_version" that may slow down cufetch bec
cufetch is still fast tho :)
os
name : OS name (pretty_name) [Ubuntu 22.04.4 LTS, Arch Linux]
name : OS name (pretty name) [Ubuntu 22.04.4 LTS, Arch Linux]
name_id : OS name id [ubuntu, arch]
kernel : kernel name and version [Linux 6.9.3-zen1-1-zen]
kernel_name : kernel name [Linux]
kernel_version: kernel version [6.9.3-zen1-1-zen]
Expand Down Expand Up @@ -500,12 +501,16 @@ int main(int argc, char *argv[])

if (!config.ascii_logo_type.empty() && config.m_display_distro)
{
const size_t& pos = path.rfind('.');
std::string logo_type_path{path};
const size_t pos = path.rfind('.');

if (pos != std::string::npos)
path.insert(pos, "_" + config.ascii_logo_type);
logo_type_path.insert(pos, "_" + config.ascii_logo_type);
else
path += "_" + config.ascii_logo_type;
logo_type_path += "_" + config.ascii_logo_type;

if (std::filesystem::exists(logo_type_path))
path = logo_type_path;
}

if (!std::filesystem::exists(path) && !config.m_disable_source)
Expand Down
2 changes: 2 additions & 0 deletions src/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,8 @@ void addValueFromModule(const std::string& moduleName, const std::string& module
{
case "name"_fnv1a16: SYSINFO_INSERT(query_system.os_pretty_name()); break;

case "name_id"_fnv1a16: SYSINFO_INSERT(query_system.os_id()); break;

case "uptime"_fnv1a16:
SYSINFO_INSERT(get_auto_uptime(uptime_days, uptime_hours.count() % 24, uptime_mins.count() % 60,
uptime_secs.count() % 60, config));
Expand Down

0 comments on commit a3c7cd6

Please sign in to comment.