diff --git a/Makefile b/Makefile index 07a961d..aa87d25 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ $(TARGET): fmt toml $(OBJ) mkdir -p $(BUILDDIR) $(CXX) $(OBJ) $(BUILDDIR)/toml++/toml.o -o $(BUILDDIR)/$(TARGET) $(LDFLAGS) -dist: $(TARGET) +dist: bsdtar -zcf $(NAME)-v$(VERSION).tar.gz LICENSE cufetch.1 assets/ascii/ -C $(BUILDDIR) $(TARGET) clean: diff --git a/include/parse.hpp b/include/parse.hpp index 466bed8..a8e734f 100644 --- a/include/parse.hpp +++ b/include/parse.hpp @@ -8,7 +8,7 @@ // Documentation on formatting is in the default config.toml file. // pureOutput is set to the string, but without the brackets. std::string parse(const std::string_view input, systemInfo_t& systemInfo, std::string& pureOutput, const Config& config, - colors_t& colors, bool parsingLaoyut); + const colors_t& colors, const bool parsingLaoyut, const bool is_image = false); // Set module values to a systemInfo_t map. // If the name of said module matches any module name, it will be added diff --git a/src/gui.cpp b/src/gui.cpp index 8254f8f..cb54908 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -44,11 +44,11 @@ static std::vector& render_with_image(Config& config, colors_t& col stbi_image_free(img); else die("Unable to load image '{}'", config.source_path); - + + std::string _; for (std::string& layout : config.layouts) { - std::string _; - layout = parse(layout, systemInfo, _, config, colors, true); + layout = parse(layout, systemInfo, _, config, colors, true, true); } // erase each element for each instance of MAGIC_LINE @@ -61,7 +61,6 @@ static std::vector& render_with_image(Config& config, colors_t& col for (size_t _ = 0; _ < config.offset; _++) // I use _ because we don't need it config.layouts.at(i).insert(0, " "); } - config.offset = 0; return config.layouts; } diff --git a/src/parse.cpp b/src/parse.cpp index 524c64a..7f03a8d 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -115,7 +115,7 @@ std::string getInfoFromName(const systemInfo_t& systemInfo, const std::string_vi } std::string parse(const std::string_view input, systemInfo_t& systemInfo, std::string& pureOutput, const Config& config, - colors_t& colors, bool parsingLaoyut) + const colors_t& colors, const bool parsingLaoyut, const bool is_image) { std::string output = input.data(); pureOutput = output; @@ -229,12 +229,12 @@ std::string parse(const std::string_view input, systemInfo_t& systemInfo, std::s // "ehhmmm why goto and double code? that's ugly and unconvienient :nerd:" // I don't care, it does the work and well if (command == *it_name) - command = config.m_arg_colors_value[it_value]; + command = config.m_arg_colors_value.at(it_value); goto jump; } if (command == *it_name) - command = config.m_arg_colors_value[it_value]; + command = config.m_arg_colors_value.at(it_value); } } @@ -245,7 +245,12 @@ std::string parse(const std::string_view input, systemInfo_t& systemInfo, std::s ver = 0; if (auto_colors.empty()) - auto_colors.push_back(config.gui ? "" : "\033[0m\033[1m"); + { + if (is_image) + auto_colors.push_back(config.gui ? "white" : "\033[0m\033[1m"); + else + auto_colors.push_back(config.gui ? "" : "\033[0m\033[1m"); + } command = auto_colors.at(ver); }