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; }