diff --git a/android/app/src/main/java/org/toni/customfetch_android/widget/customfetchConfigureActivity.kt b/android/app/src/main/java/org/toni/customfetch_android/widget/customfetchConfigureActivity.kt index 214e6a3..7164634 100644 --- a/android/app/src/main/java/org/toni/customfetch_android/widget/customfetchConfigureActivity.kt +++ b/android/app/src/main/java/org/toni/customfetch_android/widget/customfetchConfigureActivity.kt @@ -82,7 +82,7 @@ class customfetchConfigureActivity : Activity() { appWidgetText.setText(loadTitlePref(this@customfetchConfigureActivity, appWidgetId)) argsHelp.text = mainAndroid("customfetch --help") - showModulesList.setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener { buttonView, isChecked -> + showModulesList.setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener { _, isChecked -> if (isChecked) argsHelp.text = mainAndroid("customfetch -l") else diff --git a/android/app/src/main/res/drawable-nodpi/example_appwidget_preview.png b/android/app/src/main/res/drawable-nodpi/example_appwidget_preview.png index 894b069..ecd1855 100644 Binary files a/android/app/src/main/res/drawable-nodpi/example_appwidget_preview.png and b/android/app/src/main/res/drawable-nodpi/example_appwidget_preview.png differ diff --git a/include/parse.hpp b/include/parse.hpp index c71ed62..a533eee 100644 --- a/include/parse.hpp +++ b/include/parse.hpp @@ -95,4 +95,6 @@ void append_styles(fmt::text_style& current_style, Styles&&... styles) current_style |= (styles | ...); } +inline std::vector auto_colors; + #endif diff --git a/include/query.hpp b/include/query.hpp index 91e574b..a53ff2d 100644 --- a/include/query.hpp +++ b/include/query.hpp @@ -107,8 +107,8 @@ class User public: struct User_t { - std::string shell_path{ UNKNOWN }; - std::string shell_name{ UNKNOWN }; + std::string shell_path{ MAGIC_LINE }; + std::string shell_name{ MAGIC_LINE }; std::string shell_version{ UNKNOWN }; std::string wm_name{ MAGIC_LINE }; std::string wm_version{ UNKNOWN }; diff --git a/src/display.cpp b/src/display.cpp index 4ff9b98..24962e3 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -328,6 +328,8 @@ std::vector Display::render(const Config& config, const colors_t& c if (!config.gui && !config.m_disable_colors) line.insert(0, NOCOLOR); } + + auto_colors.clear(); // erase each element for each instance of MAGIC_LINE layout.erase(std::remove_if(layout.begin(), layout.end(), @@ -336,7 +338,12 @@ std::vector Display::render(const Config& config, const colors_t& c if (config.logo_position == "top") { +#if ANDROID_APP + if (!asciiArt.empty()) + layout.insert(layout.begin(), asciiArt.begin(), asciiArt.end()); +#else Display::display(asciiArt); +#endif return layout; } @@ -374,7 +381,7 @@ std::vector Display::render(const Config& config, const colors_t& c line.reserve(config.logo_padding_left + asciiArt.at(i).length()); for (size_t j = 0; j < config.logo_padding_left; j++) - line += ' '; + line += space; line += asciiArt.at(i); diff --git a/src/gui.cpp b/src/gui.cpp index f425ad3..e37081b 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -160,6 +160,8 @@ Window::Window(const Config& config, const colors_t& colors, const std::string_v m_label.set_markup(fmt::format("{}", fmt::join(Display::render(config, colors, true, path), "\n"))); } + auto_colors.clear(); + if (config.gui_bg_image != "disable") { if (!std::filesystem::exists(config.gui_bg_image)) diff --git a/src/main.cpp b/src/main.cpp index ed841bd..219c99c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -143,7 +143,7 @@ Read the manual "customfetch.1" or the autogenerated config file for more infos )"); RETURN_OR_PRINT(help.data()); - std::exit(EXIT_SUCCESS); + std::exit(invalid_opt); } static STRING_IF_ANDROID_APP_ELSE(void) modules_list() diff --git a/src/parse.cpp b/src/parse.cpp index 9108aa8..9ba13f7 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -301,8 +301,6 @@ std::optional parse_color_tag(Parser& parser, parse_args_t& parse_a if (!evaluate) return {}; - - static std::vector auto_colors; std::string output; const Config& config = parse_args.config; @@ -314,7 +312,7 @@ std::optional parse_color_tag(Parser& parser, parse_args_t& parse_a output += endspan; endspan.clear(); - const auto& append_endspan = [&](const std::string_view tag) { + const auto& append_endspan = [&endspan](const std::string_view tag) { endspan += "";