From 427864346260ab2ddfb1b4dcba3e2cbe000ec18a Mon Sep 17 00:00:00 2001 From: murat Date: Sun, 24 May 2026 21:33:16 +0300 Subject: [PATCH 01/17] show pretty name instead of name --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a29570a..6762499 100644 --- a/main.cpp +++ b/main.cpp @@ -113,7 +113,7 @@ string getDistro() { if(delimiter != string::npos) { string key = line.substr(0, delimiter); - if (key == "NAME"){ + if (key == "PRETTY_NAME"){ distroName = line.substr(delimiter + 1); distroName = distroName.substr(1, distroName.length() - 2); } From 1e368b778c6ef78c9d651ba8fe0489aa90bedacd Mon Sep 17 00:00:00 2001 From: murat Date: Sun, 24 May 2026 21:35:36 +0300 Subject: [PATCH 02/17] deleted unnecessary arguments from main function --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 6762499..3a70164 100644 --- a/main.cpp +++ b/main.cpp @@ -50,7 +50,7 @@ std::vector getGpuIds() { return gpus; } -int main (int argc, const char *argv[]) { +int main () { const string colorRED = "\033[1;31m"; const string colorGREEN = "\033[1;32m"; const string colorBLUE = "\033[1;34m"; From e48d93e9f3b7055b4ae2d316503f06a86dee3034 Mon Sep 17 00:00:00 2001 From: murat Date: Sun, 24 May 2026 21:42:55 +0300 Subject: [PATCH 03/17] getting distroID from Os Release --- main.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/main.cpp b/main.cpp index 3a70164..3b65018 100644 --- a/main.cpp +++ b/main.cpp @@ -17,6 +17,7 @@ namespace fs = std::filesystem; string getUser(); string getHost(); string getDistro(); +string distroArt(); string getKernel(); string getUptime(); string getShell(); @@ -68,6 +69,8 @@ int main () { cout << colorRED << "\t\t RAM: \t" << colorRESET << getRAM() << "\n"; cout << colorBLUE << "\t\t OS Date:\t" << colorRESET << getOsDate() << "\n"; + cout << "distroID: " << distroArt() << "\n"; + return 0; } @@ -126,6 +129,36 @@ string getDistro() { else return ""; } +string distroArt() { + std::ifstream readOsRelease("/etc/os-release"); + + if(!readOsRelease.is_open()) { + std::cerr << "Error: Couldn't read /etc/os-release\n"; + return ""; + } + + string distroID; + string line; + while (std::getline(readOsRelease, line)) { + if(line.empty() || line[0] == '#') continue; + + std::size_t delimiter = line.find("="); + if(delimiter != string::npos) { + string key = line.substr(0, delimiter); + + if (key == "ID"){ + distroID = line.substr(delimiter + 1); + if (distroID[0] == '"' && distroID[distroID.length() - 1] == '"') distroID = distroID.substr(1, distroID.length() - 2); + } + } + } + + readOsRelease.close(); + + if (!distroID.empty()) return distroID; + else return ""; +} + string getKernel() { struct utsname kernelInfo; From 01fcee75d1fb77b29e1ad0a5dcd041c52ff2c17b Mon Sep 17 00:00:00 2001 From: murat Date: Sun, 24 May 2026 22:04:16 +0300 Subject: [PATCH 04/17] cachyos logo added --- main.cpp | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index 3b65018..3d6808c 100644 --- a/main.cpp +++ b/main.cpp @@ -17,7 +17,7 @@ namespace fs = std::filesystem; string getUser(); string getHost(); string getDistro(); -string distroArt(); +void distroArt(); string getKernel(); string getUptime(); string getShell(); @@ -69,7 +69,7 @@ int main () { cout << colorRED << "\t\t RAM: \t" << colorRESET << getRAM() << "\n"; cout << colorBLUE << "\t\t OS Date:\t" << colorRESET << getOsDate() << "\n"; - cout << "distroID: " << distroArt() << "\n"; + distroArt(); return 0; } @@ -129,12 +129,11 @@ string getDistro() { else return ""; } -string distroArt() { +void distroArt() { std::ifstream readOsRelease("/etc/os-release"); if(!readOsRelease.is_open()) { std::cerr << "Error: Couldn't read /etc/os-release\n"; - return ""; } string distroID; @@ -155,8 +154,38 @@ string distroArt() { readOsRelease.close(); - if (!distroID.empty()) return distroID; - else return ""; + string asciiArts[][9] = { + { + "arch", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { + "cachyos", + " /''''''''''''/ ", + " /''''''''''''/ ", + " /''''''/ ", + "/''''''/ ", + "\\......\\ ", + " \\......\\ ", + " \\.............../", + " \\............./", + } + }; + + for (int i = 0; i < sizeof(asciiArts) / sizeof(asciiArts[0]); ++i) { + if (asciiArts[i][0] == distroID) { + for (int j = 1; j < 9; ++j) { + cout << asciiArts[i][j] << "\n"; + } + } + } } string getKernel() { From 32ac411e0b819bf5c7a9dfe3a45d6e45c204c060 Mon Sep 17 00:00:00 2001 From: murat Date: Sun, 24 May 2026 22:13:05 +0300 Subject: [PATCH 05/17] arch logo added --- main.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/main.cpp b/main.cpp index 3d6808c..ea65009 100644 --- a/main.cpp +++ b/main.cpp @@ -69,6 +69,7 @@ int main () { cout << colorRED << "\t\t RAM: \t" << colorRESET << getRAM() << "\n"; cout << colorBLUE << "\t\t OS Date:\t" << colorRESET << getOsDate() << "\n"; + cout << "\n\n"; distroArt(); return 0; @@ -157,25 +158,25 @@ void distroArt() { string asciiArts[][9] = { { "arch", - "", - "", - "", - "", - "", - "", - "", - "", + " /\\ ", + " / \\ ", + " / \\ ", + " / \\ ", + " / ,, \\ ", + " / | | \\ ", + "/_-'' ''-_\\ ", + " " }, { "cachyos", - " /''''''''''''/ ", - " /''''''''''''/ ", - " /''''''/ ", - "/''''''/ ", - "\\......\\ ", - " \\......\\ ", - " \\.............../", - " \\............./", + " /''''''''''''/ ", + " /''''''''''''/ ", + " /''''''/ ", + "/''''''/ ", + "\\......\\ ", + " \\......\\ ", + " \\.............../ ", + " \\............./ " } }; From de99f162d0b7b456a9c6011af96440cc43784a65 Mon Sep 17 00:00:00 2001 From: murat Date: Sun, 24 May 2026 22:15:56 +0300 Subject: [PATCH 06/17] debian logo added --- main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.cpp b/main.cpp index ea65009..24e17d7 100644 --- a/main.cpp +++ b/main.cpp @@ -177,6 +177,15 @@ void distroArt() { " \\......\\ ", " \\.............../ ", " \\............./ " + }, + { + "debian", + " _____ ", + " / __ \\ ", + "| / | ", + "| \\___- ", + "-_ ", + " --_ " } }; From f3d54a04f8a082a59a34716229ce9ae50540128c Mon Sep 17 00:00:00 2001 From: murat Date: Sun, 24 May 2026 22:19:39 +0300 Subject: [PATCH 07/17] debian logo align fix --- main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 24e17d7..4852c82 100644 --- a/main.cpp +++ b/main.cpp @@ -181,11 +181,13 @@ void distroArt() { { "debian", " _____ ", - " / __ \\ ", + " / __ \\ ", "| / | ", - "| \\___- ", + "| \\___- ", "-_ ", - " --_ " + " --_ ", + " ", + " " } }; From b076c02bd41d1725fa873a75ec34f7983c5ace0d Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 19:25:01 +0300 Subject: [PATCH 08/17] logo moved to left side of the text --- main.cpp | 63 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/main.cpp b/main.cpp index 4852c82..5d07cc5 100644 --- a/main.cpp +++ b/main.cpp @@ -17,7 +17,7 @@ namespace fs = std::filesystem; string getUser(); string getHost(); string getDistro(); -void distroArt(); +std::vector distroArt(); string getKernel(); string getUptime(); string getShell(); @@ -59,18 +59,47 @@ int main () { const string colorMAGENTA = "\033[1;35m"; const string colorRESET = "\033[0m"; - cout << "\t\t\t--- " << colorGREEN << getUser() << colorRESET << "@" << colorRED << getHost() << colorRESET << " ---\n"; - cout << colorGREEN << "\t\t distro:\t" << colorRESET << getDistro() << "\n"; - cout << colorMAGENTA << "\t\t kernel:\t" << colorRESET << getKernel() << "\n"; - cout << colorBLUE << "\t\t uptime:\t" << colorRESET << getUptime() << "\n"; - cout << colorMAGENTA << "\t\t shell:\t" << colorRESET << getShell() << "\n"; - cout << colorYELLOW <<"\t\t󰍛 CPU: \t" << colorRESET << getCPU() << "\n"; - cout << colorYELLOW <<"\t\t󰾲 GPU: \t" << colorRESET << getGPU() << "\n"; - cout << colorRED << "\t\t RAM: \t" << colorRESET << getRAM() << "\n"; - cout << colorBLUE << "\t\t OS Date:\t" << colorRESET << getOsDate() << "\n"; + cout << "--- " << colorGREEN << getUser() << colorRESET << "@" << colorRED << getHost() << colorRESET << " ---\n"; - cout << "\n\n"; - distroArt(); + std::vector infoLines = { + colorGREEN + " distro:\t" + colorRESET + getDistro(), + colorMAGENTA + " kernel:\t" + colorRESET + getKernel(), + colorBLUE + " uptime:\t" + colorRESET + getUptime(), + colorMAGENTA + " shell:\t" + colorRESET + getShell(), + colorYELLOW + "󰍛 CPU: \t" + colorRESET + getCPU(), + colorYELLOW + "󰾲 GPU: \t" + colorRESET + getGPU(), + colorRED + " RAM: \t" + colorRESET + getRAM(), + colorBLUE + " OS Date:\t" + colorRESET + getOsDate() + }; + + std::vector logoLines = distroArt(); + size_t logoWidth = 0; + for (const auto& line : logoLines) { + if (line.size() > logoWidth) logoWidth = line.size(); + } + + size_t totalLines = infoLines.size(); + if (logoLines.size() > totalLines) totalLines = logoLines.size(); + + const string gap = " "; + for (size_t i = 0; i < totalLines; ++i) { + if (i < logoLines.size()) { + cout << logoLines[i]; + if (logoLines[i].size() < logoWidth) { + cout << string(logoWidth - logoLines[i].size(), ' '); + } + } else { + cout << string(logoWidth, ' '); + } + + cout << gap; + + if (i < infoLines.size()) { + cout << infoLines[i]; + } + + cout << "\n"; + } return 0; } @@ -130,7 +159,7 @@ string getDistro() { else return ""; } -void distroArt() { +std::vector distroArt() { std::ifstream readOsRelease("/etc/os-release"); if(!readOsRelease.is_open()) { @@ -191,13 +220,17 @@ void distroArt() { } }; - for (int i = 0; i < sizeof(asciiArts) / sizeof(asciiArts[0]); ++i) { + std::vector out; + for (int i = 0; i < static_cast(sizeof(asciiArts) / sizeof(asciiArts[0])); ++i) { if (asciiArts[i][0] == distroID) { for (int j = 1; j < 9; ++j) { - cout << asciiArts[i][j] << "\n"; + out.push_back(asciiArts[i][j]); } + return out; } } + + return out; } string getKernel() { From 3349a53f53aae5f48c3d0428506863b43a86b362 Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 19:27:04 +0300 Subject: [PATCH 09/17] top line align fix --- main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 5d07cc5..af27aa2 100644 --- a/main.cpp +++ b/main.cpp @@ -59,8 +59,6 @@ int main () { const string colorMAGENTA = "\033[1;35m"; const string colorRESET = "\033[0m"; - cout << "--- " << colorGREEN << getUser() << colorRESET << "@" << colorRED << getHost() << colorRESET << " ---\n"; - std::vector infoLines = { colorGREEN + " distro:\t" + colorRESET + getDistro(), colorMAGENTA + " kernel:\t" + colorRESET + getKernel(), @@ -78,10 +76,14 @@ int main () { if (line.size() > logoWidth) logoWidth = line.size(); } + const string gap = " "; + cout << string(logoWidth, ' ') << gap + << "--- " << colorGREEN << getUser() << colorRESET << "@" << colorRED << getHost() << colorRESET << " ---\n"; + cout << "\n"; + size_t totalLines = infoLines.size(); if (logoLines.size() > totalLines) totalLines = logoLines.size(); - const string gap = " "; for (size_t i = 0; i < totalLines; ++i) { if (i < logoLines.size()) { cout << logoLines[i]; From 102968d76518b19d9f40d03851acb211d6dec094 Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 19:38:13 +0300 Subject: [PATCH 10/17] spacing fix for logos --- main.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/main.cpp b/main.cpp index af27aa2..a709824 100644 --- a/main.cpp +++ b/main.cpp @@ -189,36 +189,36 @@ std::vector distroArt() { string asciiArts[][9] = { { "arch", - " /\\ ", - " / \\ ", - " / \\ ", - " / \\ ", - " / ,, \\ ", - " / | | \\ ", - "/_-'' ''-_\\ ", - " " + " /\\ ", + " / \\ ", + " / \\ ", + " / \\ ", + " / ,, \\ ", + " / | | \\ ", + "/_-'' ''-_\\", + " " }, { "cachyos", - " /''''''''''''/ ", - " /''''''''''''/ ", - " /''''''/ ", - "/''''''/ ", - "\\......\\ ", - " \\......\\ ", - " \\.............../ ", - " \\............./ " + " /''''''''''''/ ", + " /''''''''''''/ ", + " /''''''/ ", + "/''''''/ ", + "\\......\\ ", + " \\......\\ ", + " \\.............../", + " \\............./ " }, { "debian", - " _____ ", - " / __ \\ ", - "| / | ", - "| \\___- ", - "-_ ", - " --_ ", - " ", - " " + " _____ ", + " / __ \\", + "| / |", + "| \\___-", + "-_ ", + " --_ ", + " ", + " " } }; From 4e3089c84e0a47a9870cd0b708bb62ea64801c9d Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 19:43:54 +0300 Subject: [PATCH 11/17] info lines alignment fix --- main.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/main.cpp b/main.cpp index a709824..9dc5cde 100644 --- a/main.cpp +++ b/main.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include using std::string, std::cout; namespace fs = std::filesystem; @@ -52,6 +54,7 @@ std::vector getGpuIds() { } int main () { + std::setlocale(LC_ALL, ""); const string colorRED = "\033[1;31m"; const string colorGREEN = "\033[1;32m"; const string colorBLUE = "\033[1;34m"; @@ -59,15 +62,47 @@ int main () { const string colorMAGENTA = "\033[1;35m"; const string colorRESET = "\033[0m"; + auto displayWidth = [&](const string& text) { + std::mbstate_t state{}; + const char* src = text.c_str(); + size_t len = std::mbsrtowcs(nullptr, &src, 0, &state); + if (len == static_cast(-1)) { + return static_cast(text.size()); + } + std::wstring wide(len, L'\0'); + state = std::mbstate_t{}; + src = text.c_str(); + std::mbsrtowcs(wide.data(), &src, len, &state); + + int width = 0; + for (wchar_t ch : wide) { + int w = wcwidth(ch); + if (w > 0) width += w; + } + return width; + }; + + auto formatLine = [&](const string& color, const string& label, const string& value) { + const size_t labelWidth = 12; + const size_t valueGap = 2; + string padded = label; + int currentWidth = displayWidth(padded); + if (currentWidth < static_cast(labelWidth)) { + padded += string(labelWidth - currentWidth, ' '); + } + padded += string(valueGap, ' '); + return color + padded + colorRESET + value; + }; + std::vector infoLines = { - colorGREEN + " distro:\t" + colorRESET + getDistro(), - colorMAGENTA + " kernel:\t" + colorRESET + getKernel(), - colorBLUE + " uptime:\t" + colorRESET + getUptime(), - colorMAGENTA + " shell:\t" + colorRESET + getShell(), - colorYELLOW + "󰍛 CPU: \t" + colorRESET + getCPU(), - colorYELLOW + "󰾲 GPU: \t" + colorRESET + getGPU(), - colorRED + " RAM: \t" + colorRESET + getRAM(), - colorBLUE + " OS Date:\t" + colorRESET + getOsDate() + formatLine(colorGREEN, " distro:", getDistro()), + formatLine(colorMAGENTA, " kernel:", getKernel()), + formatLine(colorBLUE, " uptime:", getUptime()), + formatLine(colorMAGENTA, " shell:", getShell()), + formatLine(colorYELLOW, "󰍛 CPU:", getCPU()), + formatLine(colorYELLOW, "󰾲 GPU:", getGPU()), + formatLine(colorRED, " RAM:", getRAM()), + formatLine(colorBLUE, " OS Date:", getOsDate()) }; std::vector logoLines = distroArt(); From e0d49b76f89245a1092e02ae81a42c82ba03b171 Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 19:50:24 +0300 Subject: [PATCH 12/17] feat: created a color function for ANSI colors --- main.cpp | 59 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/main.cpp b/main.cpp index 9dc5cde..48b90fb 100644 --- a/main.cpp +++ b/main.cpp @@ -28,6 +28,17 @@ string getGPU(); string getRAM(); string getOsDate(); +enum class Color { + Red, + Green, + Blue, + Yellow, + Magenta, + Reset +}; + +string color(Color c); + struct gpuId { string vendor; string device; @@ -55,12 +66,6 @@ std::vector getGpuIds() { int main () { std::setlocale(LC_ALL, ""); - const string colorRED = "\033[1;31m"; - const string colorGREEN = "\033[1;32m"; - const string colorBLUE = "\033[1;34m"; - const string colorYELLOW = "\033[1;33m"; - const string colorMAGENTA = "\033[1;35m"; - const string colorRESET = "\033[0m"; auto displayWidth = [&](const string& text) { std::mbstate_t state{}; @@ -82,7 +87,7 @@ int main () { return width; }; - auto formatLine = [&](const string& color, const string& label, const string& value) { + auto formatLine = [&](Color c, const string& label, const string& value) { const size_t labelWidth = 12; const size_t valueGap = 2; string padded = label; @@ -91,18 +96,18 @@ int main () { padded += string(labelWidth - currentWidth, ' '); } padded += string(valueGap, ' '); - return color + padded + colorRESET + value; + return color(c) + padded + color(Color::Reset) + value; }; std::vector infoLines = { - formatLine(colorGREEN, " distro:", getDistro()), - formatLine(colorMAGENTA, " kernel:", getKernel()), - formatLine(colorBLUE, " uptime:", getUptime()), - formatLine(colorMAGENTA, " shell:", getShell()), - formatLine(colorYELLOW, "󰍛 CPU:", getCPU()), - formatLine(colorYELLOW, "󰾲 GPU:", getGPU()), - formatLine(colorRED, " RAM:", getRAM()), - formatLine(colorBLUE, " OS Date:", getOsDate()) + formatLine(Color::Green, " distro:", getDistro()), + formatLine(Color::Magenta, " kernel:", getKernel()), + formatLine(Color::Blue, " uptime:", getUptime()), + formatLine(Color::Magenta, " shell:", getShell()), + formatLine(Color::Yellow, "󰍛 CPU:", getCPU()), + formatLine(Color::Yellow, "󰾲 GPU:", getGPU()), + formatLine(Color::Red, " RAM:", getRAM()), + formatLine(Color::Blue, " OS Date:", getOsDate()) }; std::vector logoLines = distroArt(); @@ -113,7 +118,8 @@ int main () { const string gap = " "; cout << string(logoWidth, ' ') << gap - << "--- " << colorGREEN << getUser() << colorRESET << "@" << colorRED << getHost() << colorRESET << " ---\n"; + << "--- " << color(Color::Green) << getUser() << color(Color::Reset) + << "@" << color(Color::Red) << getHost() << color(Color::Reset) << " ---\n"; cout << "\n"; size_t totalLines = infoLines.size(); @@ -196,6 +202,25 @@ string getDistro() { else return ""; } +string color(Color c) { + switch (c) { + case Color::Red: + return "\033[1;31m"; + case Color::Green: + return "\033[1;32m"; + case Color::Blue: + return "\033[1;34m"; + case Color::Yellow: + return "\033[1;33m"; + case Color::Magenta: + return "\033[1;35m"; + case Color::Reset: + return "\033[0m"; + } + + return "\033[0m"; +} + std::vector distroArt() { std::ifstream readOsRelease("/etc/os-release"); From e9f1bd31f19ec3be85657bfbcd380dbd72e4f4e8 Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 19:57:02 +0300 Subject: [PATCH 13/17] added new colors --- main.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/main.cpp b/main.cpp index 48b90fb..3d3539c 100644 --- a/main.cpp +++ b/main.cpp @@ -30,10 +30,26 @@ string getOsDate(); enum class Color { Red, + RedLight, + RedDeep, Green, + GreenLight, + GreenDeep, Blue, + BlueLight, + BlueDeep, Yellow, + YellowLight, Magenta, + Purple, + PurpleLight, + PurpleDeep, + Orange, + OrangeLight, + OrangeDeep, + Cyan, + Gray, + Dark, Reset }; @@ -205,15 +221,33 @@ string getDistro() { string color(Color c) { switch (c) { case Color::Red: + case Color::RedLight: + case Color::RedDeep: return "\033[1;31m"; case Color::Green: + case Color::GreenLight: + case Color::GreenDeep: return "\033[1;32m"; case Color::Blue: + case Color::BlueLight: + case Color::BlueDeep: return "\033[1;34m"; case Color::Yellow: + case Color::YellowLight: + case Color::Orange: + case Color::OrangeLight: + case Color::OrangeDeep: return "\033[1;33m"; case Color::Magenta: + case Color::Purple: + case Color::PurpleLight: + case Color::PurpleDeep: return "\033[1;35m"; + case Color::Cyan: + return "\033[1;36m"; + case Color::Gray: + case Color::Dark: + return "\033[1;37m"; case Color::Reset: return "\033[0m"; } From d07b345b79254d4ba5e7942e07edeb439e419cac Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 20:07:47 +0300 Subject: [PATCH 14/17] feat: colored the ascii logos added enum colors to distro art arrays code refactor: logo items are now structs --- main.cpp | 76 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/main.cpp b/main.cpp index 3d3539c..a30f1f2 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,12 @@ enum class Color { string color(Color c); +struct DistroLogo { + string id; + Color color; + std::array art; +}; + struct gpuId { string vendor; string device; @@ -280,47 +287,58 @@ std::vector distroArt() { readOsRelease.close(); - string asciiArts[][9] = { + const std::vector logos = { { "arch", - " /\\ ", - " / \\ ", - " / \\ ", - " / \\ ", - " / ,, \\ ", - " / | | \\ ", - "/_-'' ''-_\\", - " " + Color::Blue, + { + " /\\ ", + " / \\ ", + " / \\ ", + " / \\ ", + " / ,, \\ ", + " / | | \\ ", + "/_-'' ''-_\\", + " " + } }, { "cachyos", - " /''''''''''''/ ", - " /''''''''''''/ ", - " /''''''/ ", - "/''''''/ ", - "\\......\\ ", - " \\......\\ ", - " \\.............../", - " \\............./ " + Color::Green, + { + " /''''''''''''/ ", + " /''''''''''''/ ", + " /''''''/ ", + "/''''''/ ", + "\\......\\ ", + " \\......\\ ", + " \\.............../", + " \\............./ " + } }, { "debian", - " _____ ", - " / __ \\", - "| / |", - "| \\___-", - "-_ ", - " --_ ", - " ", - " " + Color::Red, + { + " _____ ", + " / __ \\", + "| / |", + "| \\___-", + "-_ ", + " --_ ", + " ", + " " + } } }; std::vector out; - for (int i = 0; i < static_cast(sizeof(asciiArts) / sizeof(asciiArts[0])); ++i) { - if (asciiArts[i][0] == distroID) { - for (int j = 1; j < 9; ++j) { - out.push_back(asciiArts[i][j]); + for (const auto& logo : logos) { + if (logo.id == distroID) { + const string prefix = color(logo.color); + const string suffix = color(Color::Reset); + for (const auto& line : logo.art) { + out.push_back(prefix + line + suffix); } return out; } From 8dd27b7d36bfe780c80e278a0c414b9963cf68a8 Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 20:52:48 +0300 Subject: [PATCH 15/17] added 9 more distros to the list --- main.cpp | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index a30f1f2..b058330 100644 --- a/main.cpp +++ b/main.cpp @@ -329,12 +329,136 @@ std::vector distroArt() { " ", " " } - } + }, + { + "ubuntu", + Color::Orange, + { + "------ |\\ ", // TODO: + " | | \\ ", + " | | / ", + " | |/ ", + " ", + " ", + " ", + " " + } + }, + { + "fedora", + Color::Blue, + { + "------ |\\ ", // TODO: + " | | \\ ", + " | | / ", + " | |/ ", + " ", + " ", + " ", + " " + } + }, + { + "manjaro", + Color::Green, + { + "||||||||| ||||", + "||||||||| ||||", + "|||| ||||", + "|||| |||| ||||", + "|||| |||| ||||", + "|||| |||| ||||", + "|||| |||| ||||", + " " + } + }, + { + "opensuse", + Color::Green, + { + " _______ ", + "__| __ \\ ", + " / .\\ \\", + " \\__/ |", + " _______|", + " \\_______", + "__________/", + " " + } + }, + { + "pop", + Color::Purple, + { + "______ ", + "\\ _ \\ __", + " \\ \\ \\ \\ / /", + " \\ \\_\\ \\ / / ", + " \\ ___\\ /_/ ", + " \\ \\ _ ", + " __\\_\\__(_)_ ", + " (___________)` " + } + }, + { + "linuxmint", + Color::Green, + { + " __________ ", + "|_ \\", + " | | _____ |", + " | | | | | |", + " | | | | | |", + " | \\_____/ |", + " \\_________/", + } + }, + { + "endeavouros", + Color::Purple, + { + " /o. ", + " /sssso- ", + " /ossssssso: ", + " /ssssssssssso+ ", + " /ssssssssssssssso+", + "//osssssssssssssso+-", + " `+++++++++++++++-` " + } + }, + { + "void", + Color::Gray, + { + " ____ ", + " 'pfPfp.% ", + "// _._ \\\\", + "UU |===| UU", + "\\\\ ^~^ //", + " `0PpppP' ", + " ````` " + } + }, + { + "alpine", + Color::Blue, + { + " /\\ /\\ ", + " // \\ \\ ", + " // \\ \\ ", + "/// \\ \\ ", + "// \\ \\", + " \\ " + } + }, }; + // Ubuntu: Orange (+ Light/Deep Orange) + // Fedora: Blue + Gray/White + std::vector out; for (const auto& logo : logos) { - if (logo.id == distroID) { + if (logo.id == "alpine") { const string prefix = color(logo.color); const string suffix = color(Color::Reset); for (const auto& line : logo.art) { From 0b07013eeb69ceb19681b14d8db75e3aba14b42c Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 20:54:54 +0300 Subject: [PATCH 16/17] pop_os and void linux color correction --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index b058330..82d1842 100644 --- a/main.cpp +++ b/main.cpp @@ -388,7 +388,7 @@ std::vector distroArt() { }, { "pop", - Color::Purple, + Color::Cyan, { "______ ", "\\ _ \\ __", @@ -428,7 +428,7 @@ std::vector distroArt() { }, { "void", - Color::Gray, + Color::Green, { " ____ ", " 'pfPfp.% ", @@ -458,7 +458,7 @@ std::vector distroArt() { std::vector out; for (const auto& logo : logos) { - if (logo.id == "alpine") { + if (logo.id == distroID) { const string prefix = color(logo.color); const string suffix = color(Color::Reset); for (const auto& line : logo.art) { From 69f97442a3aae6090b175dfab497a6324561a809 Mon Sep 17 00:00:00 2001 From: murat Date: Mon, 25 May 2026 21:08:00 +0300 Subject: [PATCH 17/17] added 2 more ascii logos ubuntu and fedora logos added --- main.cpp | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/main.cpp b/main.cpp index 82d1842..41acd73 100644 --- a/main.cpp +++ b/main.cpp @@ -334,28 +334,26 @@ std::vector distroArt() { "ubuntu", Color::Orange, { - "------ |\\ ", // TODO: - " | | \\ ", - " | | / ", - " | |/ ", - " ", - " ", - " ", - " " + " _ ", + " ,--(_) ", + " _/ ;-._\\ ", + "(_)( ) )", + " \\ ;-'_/ ", + " `--(_) " } }, { "fedora", Color::Blue, { - "------ |\\ ", // TODO: - " | | \\ ", - " | | / ", - " | |/ ", - " ", - " ", - " ", - " " + " _____ ", + " / __)\\ ", + " | / \\ \\", + " ___| |__/ /", + " / (_ _)_/ ", + "/ / | | ", + "\\ \\__/ | ", + " \\(_____/ ", } }, { @@ -453,9 +451,6 @@ std::vector distroArt() { }, }; - // Ubuntu: Orange (+ Light/Deep Orange) - // Fedora: Blue + Gray/White - std::vector out; for (const auto& logo : logos) { if (logo.id == distroID) {