Skip to content

Commit

Permalink
assets: add cachyos
Browse files Browse the repository at this point in the history
some code chore too
  • Loading branch information
Toni500github committed Oct 30, 2024
1 parent ec3d35e commit 2372925
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
22 changes: 22 additions & 0 deletions assets/ascii/cachyos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
${green} .-------------------------:
${green} .${blue}+=${green}========================.
${green} :${blue}++${green}===${blue}++===${green}===============- :${blue}++${green}-
${green} :${blue}*++${green}====${blue}+++++==${green}===========- .==:
${green} -${blue}*+++${green}=====${blue}+***++=${green}=========:
${green} =${blue}*++++=${green}=======------------:
${green} =${blue}*+++++=${green}====- ...${green}
${green} .${blue}+*+++++${green}=-===: .${blue}=+++=${green}:
${green} :${blue}++++${green}=====-==: -***${blue}**${green}+
${green} :${blue}++=${green}=======-=. .=+**+.${green}
${green}.${blue}+${green}==========-. .${green}
${green} :${blue}+++++++${green}====- .${green}--==-.${green}
${green} :${blue}++${green}==========. :${blue}+++++++${green}:
${green} ${green}.-===========. =*****+*+
${green} ${green}.-===========: .+*****+:
${green} ${green}-=======${blue}++++${green}:::::::::::::::::::::::::-: .${green}---:
${green} :======${blue}++++${green}====${blue}+++******************=.
${green} ${green}:=====${blue}+++${green}==========${blue}++++++++++++++*-
${green} ${green}.====${blue}++${green}==============${blue}++++++++++*-
${green} ${green}.===${blue}+${green}==================${blue}+++++++:
${green} ${green}.-=======================${blue}+++:
${green} ..........................
8 changes: 8 additions & 0 deletions assets/ascii/cachyos_small.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
${green} /''''''''''''/
${green} /''''''''''''/
${green} /''''''/
${green}/''''''/
${green}\\......\\
${green} \\......\\
${green} \\.............../
${green} \\............./
8 changes: 4 additions & 4 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
*/

/* Implementation of the system behind displaying/rendering the information */
// Implementation of the system behind displaying/rendering the information

#include "display.hpp"

Expand Down Expand Up @@ -71,7 +71,7 @@ std::string Display::detect_distro(const Config& config)
if (std::filesystem::exists(format))
return format;

return fmt::format("{}/ascii/linux.txt", config.data_dir);
return config.data_dir + "/ascii/linux.txt";
}
}

Expand Down Expand Up @@ -103,7 +103,8 @@ static std::vector<std::string> render_with_image(systemInfo_t& systemInfo, std:
layout.erase(std::remove_if(layout.begin(), layout.end(),
[](const std::string_view str) { return str.find(MAGIC_LINE) != std::string::npos; }),
layout.end());


// took math from neofetch in get_term_size() and get_image_size(). seems to work nice
const size_t width = image_width / font_width;
const size_t height = image_height / font_height;

Expand All @@ -126,7 +127,6 @@ static std::vector<std::string> render_with_image(systemInfo_t& systemInfo, std:
}

for (size_t i = 0; i < layout.size(); ++i)
// took math from neofetch in get_term_size() and get_image_size(). seems to work nice
for (size_t _ = 0; _ < width + config.offset; ++_)
layout.at(i).insert(0, " ");

Expand Down
9 changes: 3 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,15 @@ int main(int argc, char *argv[])
path += "_" + config.ascii_logo_type;
}

if (!std::filesystem::exists(path) && !std::filesystem::exists((path = config.data_dir + "/ascii/linux.txt")))
{
if (!config.m_disable_source)
die("'{}' doesn't exist. Can't load image/text file", path);
}
if (!std::filesystem::exists(path) && !config.m_disable_source)
die("'{}' doesn't exist. Can't load image/text file", path);

debug("{} path = {}", __PRETTY_FUNCTION__, path);

#ifdef GUI_MODE
if (config.gui)
{
const auto& app = Gtk::Application::create("org.toni.customfetch");
const auto app = Gtk::Application::create("org.toni.customfetch");
GUI::Window window(config, colors, path);
return app->run(window);
}
Expand Down

0 comments on commit 2372925

Please sign in to comment.