From 11f99df174aaf899daf31d74a36d10bc9dc644b7 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 17 Aug 2025 17:10:27 +0200 Subject: [PATCH] fix: patch waybar to not crash on tray icons without icon file --- .../ruther/home/dwl/waybar-fix-icons.patch | 25 ++++ .../home/dwl/waybar-fix-tray-icons.patch | 119 ------------------ home/modules/ruther/home/dwl/wm.scm | 1 + 3 files changed, 26 insertions(+), 119 deletions(-) create mode 100644 home/modules/ruther/home/dwl/waybar-fix-icons.patch delete mode 100644 home/modules/ruther/home/dwl/waybar-fix-tray-icons.patch diff --git a/home/modules/ruther/home/dwl/waybar-fix-icons.patch b/home/modules/ruther/home/dwl/waybar-fix-icons.patch new file mode 100644 index 0000000000000000000000000000000000000000..6a31eacf259da2faf553b812f70374d2f04beff9 --- /dev/null +++ b/home/modules/ruther/home/dwl/waybar-fix-icons.patch @@ -0,0 +1,25 @@ +From 460b19ba1b83b873795e2e65ce60efadc7a3a906 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martynas=20Maciulevi=C4=8Dius?= + +Date: Thu, 26 Jun 2025 20:34:18 +0300 +Subject: [PATCH] Fix default icon in tray module + +--- + src/util/gtk_icon.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/util/gtk_icon.cpp b/src/util/gtk_icon.cpp +index 4b4d3d69d..73f77284e 100644 +--- a/src/util/gtk_icon.cpp ++++ b/src/util/gtk_icon.cpp +@@ -25,6 +25,10 @@ Glib::RefPtr DefaultGtkIconThemeWrapper::load_icon( + + auto icon_info = default_theme->lookup_icon(name, tmp_size, flags); + ++ if (icon_info == nullptr) { ++ return default_theme->load_icon(name, tmp_size, flags); ++ } ++ + if (style.get() == nullptr) { + return icon_info.load_icon(); + } diff --git a/home/modules/ruther/home/dwl/waybar-fix-tray-icons.patch b/home/modules/ruther/home/dwl/waybar-fix-tray-icons.patch deleted file mode 100644 index 978fb9b8bd11c6ffb06f1a6a99571456e67fea87..0000000000000000000000000000000000000000 --- a/home/modules/ruther/home/dwl/waybar-fix-tray-icons.patch +++ /dev/null @@ -1,119 +0,0 @@ -From f60c291b82181b6e871b4807625fbcc7818d3c36 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Sat, 14 Sep 2024 07:36:23 -0700 -Subject: [PATCH 1/2] chore: update fmt wrap to 11.0.2 - ---- - subprojects/fmt.wrap | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap -index 42b615963..fd508477f 100644 ---- a/subprojects/fmt.wrap -+++ b/subprojects/fmt.wrap -@@ -1,13 +1,13 @@ - [wrap-file] --directory = fmt-11.0.1 --source_url = https://github.com/fmtlib/fmt/archive/11.0.1.tar.gz --source_filename = fmt-11.0.1.tar.gz --source_hash = 7d009f7f89ac84c0a83f79ed602463d092fbf66763766a907c97fd02b100f5e9 --patch_filename = fmt_11.0.1-1_patch.zip --patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.1-1/get_patch --patch_hash = 0a8b93d1ee6d84a82d3872a9bfb4c3977d8a53f7f484d42d1f7ed63ed496d549 --source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.1-1/fmt-11.0.1.tar.gz --wrapdb_version = 11.0.1-1 -+directory = fmt-11.0.2 -+source_url = https://github.com/fmtlib/fmt/archive/11.0.2.tar.gz -+source_filename = fmt-11.0.2.tar.gz -+source_hash = 6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f -+patch_filename = fmt_11.0.2-1_patch.zip -+patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.2-1/get_patch -+patch_hash = 90c9e3b8e8f29713d40ca949f6f93ad115d78d7fb921064112bc6179e6427c5e -+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.2-1/fmt-11.0.2.tar.gz -+wrapdb_version = 11.0.2-1 - - [provide] - fmt = fmt_dep - -From 0006e4713ae19776528038b3242ded05db884ba5 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Sat, 14 Sep 2024 07:37:37 -0700 -Subject: [PATCH 2/2] fix(tray): revert ustring formatting changes - -This reverts commit a4d31ab10d1630cb9104c695d7b777ca12468904. ---- - src/modules/sni/item.cpp | 23 +++++++++-------------- - 1 file changed, 9 insertions(+), 14 deletions(-) - -diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp -index 8afb39fb3..6c4ec8c06 100644 ---- a/src/modules/sni/item.cpp -+++ b/src/modules/sni/item.cpp -@@ -104,11 +104,9 @@ void Item::proxyReady(Glib::RefPtr& result) { - this->updateImage(); - - } catch (const Glib::Error& err) { -- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, -- std::string(err.what())); -+ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what()); - } catch (const std::exception& err) { -- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, -- std::string(err.what())); -+ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what()); - } - } - -@@ -126,15 +124,14 @@ ToolTip get_variant(const Glib::VariantBase& value) { - result.text = get_variant(container.get_child(2)); - auto description = get_variant(container.get_child(3)); - if (!description.empty()) { -- result.text = fmt::format("{}\n{}", std::string(result.text), std::string(description)); -+ result.text = fmt::format("{}\n{}", result.text, description); - } - return result; - } - - void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { - try { -- spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id, -- std::string(name), get_variant(value)); -+ spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id, name, value); - - if (name == "Category") { - category = get_variant(value); -@@ -179,12 +176,10 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { - } - } catch (const Glib::Error& err) { - spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}", -- id.empty() ? bus_name : id, std::string(name), get_variant(value), -- std::string(err.what())); -+ id.empty() ? bus_name : id, name, value, err.what()); - } catch (const std::exception& err) { - spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}", -- id.empty() ? bus_name : id, std::string(name), get_variant(value), -- std::string(err.what())); -+ id.empty() ? bus_name : id, name, value, err.what()); - } - } - -@@ -226,9 +221,9 @@ void Item::processUpdatedProperties(Glib::RefPtr& _result) { - - this->updateImage(); - } catch (const Glib::Error& err) { -- spdlog::warn("Failed to update properties: {}", std::string(err.what())); -+ spdlog::warn("Failed to update properties: {}", err.what()); - } catch (const std::exception& err) { -- spdlog::warn("Failed to update properties: {}", std::string(err.what())); -+ spdlog::warn("Failed to update properties: {}", err.what()); - } - update_pending_.clear(); - } -@@ -250,7 +245,7 @@ static const std::map> signal2props - - void Item::onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name, - const Glib::VariantContainerBase& arguments) { -- spdlog::trace("Tray item '{}' got signal {}", id, std::string(signal_name)); -+ spdlog::trace("Tray item '{}' got signal {}", id, signal_name); - auto changed = signal2props.find(signal_name.raw()); - if (changed != signal2props.end()) { - if (update_pending_.empty()) { diff --git a/home/modules/ruther/home/dwl/wm.scm b/home/modules/ruther/home/dwl/wm.scm index 457e10de758eccf64d11ae5993d2f2a71fdaa3e7..bef6c4c991f2c34d2453d899fbd09229e80ee703 100644 --- a/home/modules/ruther/home/dwl/wm.scm +++ b/home/modules/ruther/home/dwl/wm.scm @@ -47,6 +47,7 @@ (inherit (package-source waybar)) (patches (cons* (local-file "dwl-ipc-waybar.patch") + (local-file "waybar-fix-icons.patch") (origin-patches (package-source waybar)))))))) (define-public (make-dwl-xwayland dwl)