Skip to content

Commit b9ef918

Browse files
adamthiedencopa
authored andcommitted
community/waybar: add patch to fix tray icon support
Patch pulled from Alexays/Waybar#3604
1 parent e3c6298 commit b9ef918

File tree

2 files changed

+122
-1
lines changed

2 files changed

+122
-1
lines changed

community/waybar/APKBUILD

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Maintainer: Clayton Craft <clayton@craftyguy.net>
33
pkgname=waybar
44
pkgver=0.11.0
5-
pkgrel=0
5+
pkgrel=1
66
pkgdesc="Highly customizable Wayland bar for Sway and Wlroots based compositors"
77
url="https://github.com/Alexays/Waybar/"
88
# s390x: no wireplumber (but who uses it there anyway)
@@ -32,6 +32,7 @@ makedepends="
3232
subpackages="$pkgname-doc"
3333
source="https://github.com/Alexays/Waybar/archive/$pkgver/Waybar-$pkgver.tar.gz
3434
config-fix-clock.patch
35+
fix-tray.patch
3536
"
3637
options="!check" # No test suite
3738
builddir="$srcdir/Waybar-$pkgver"
@@ -64,4 +65,5 @@ package() {
6465
sha512sums="
6566
6bd23a469205662e524e53dd8798c4dce6ed371e5106f34644540e2f89804181753814f74b45645185b933c43dc4a0eabb99633936433fdadc25a9cce58b06b0 Waybar-0.11.0.tar.gz
6667
cd6fea7e9981e13ecb911da66b4f22e949542d4085d696e01d8d4eac0986e0ab15d5c1430040b76be730437a586dbe1f5c49ac8435269e6310fb2c213b6c74a2 config-fix-clock.patch
68+
77f528438555267c6651fbd9a30243d642ed75e67b37b21b2d6b8be0548c2d35138c09ef7af388a53da9fd5a0c88e1f842f41817f0220643e15d6c9bc7dc729e fix-tray.patch
6769
"

community/waybar/fix-tray.patch

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
From f60c291b82181b6e871b4807625fbcc7818d3c36 Mon Sep 17 00:00:00 2001
2+
From: Aleksei Bavshin <alebastr89@gmail.com>
3+
Date: Sat, 14 Sep 2024 07:36:23 -0700
4+
Subject: [PATCH 1/2] chore: update fmt wrap to 11.0.2
5+
6+
---
7+
subprojects/fmt.wrap | 18 +++++++++---------
8+
1 file changed, 9 insertions(+), 9 deletions(-)
9+
10+
diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap
11+
index 42b615963..fd508477f 100644
12+
--- a/subprojects/fmt.wrap
13+
+++ b/subprojects/fmt.wrap
14+
@@ -1,13 +1,13 @@
15+
[wrap-file]
16+
-directory = fmt-11.0.1
17+
-source_url = https://github.com/fmtlib/fmt/archive/11.0.1.tar.gz
18+
-source_filename = fmt-11.0.1.tar.gz
19+
-source_hash = 7d009f7f89ac84c0a83f79ed602463d092fbf66763766a907c97fd02b100f5e9
20+
-patch_filename = fmt_11.0.1-1_patch.zip
21+
-patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.1-1/get_patch
22+
-patch_hash = 0a8b93d1ee6d84a82d3872a9bfb4c3977d8a53f7f484d42d1f7ed63ed496d549
23+
-source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.1-1/fmt-11.0.1.tar.gz
24+
-wrapdb_version = 11.0.1-1
25+
+directory = fmt-11.0.2
26+
+source_url = https://github.com/fmtlib/fmt/archive/11.0.2.tar.gz
27+
+source_filename = fmt-11.0.2.tar.gz
28+
+source_hash = 6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f
29+
+patch_filename = fmt_11.0.2-1_patch.zip
30+
+patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.2-1/get_patch
31+
+patch_hash = 90c9e3b8e8f29713d40ca949f6f93ad115d78d7fb921064112bc6179e6427c5e
32+
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.2-1/fmt-11.0.2.tar.gz
33+
+wrapdb_version = 11.0.2-1
34+
35+
[provide]
36+
fmt = fmt_dep
37+
38+
From 0006e4713ae19776528038b3242ded05db884ba5 Mon Sep 17 00:00:00 2001
39+
From: Aleksei Bavshin <alebastr89@gmail.com>
40+
Date: Sat, 14 Sep 2024 07:37:37 -0700
41+
Subject: [PATCH 2/2] fix(tray): revert ustring formatting changes
42+
43+
This reverts commit a4d31ab10d1630cb9104c695d7b777ca12468904.
44+
---
45+
src/modules/sni/item.cpp | 23 +++++++++--------------
46+
1 file changed, 9 insertions(+), 14 deletions(-)
47+
48+
diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp
49+
index 8afb39fb3..6c4ec8c06 100644
50+
--- a/src/modules/sni/item.cpp
51+
+++ b/src/modules/sni/item.cpp
52+
@@ -104,11 +104,9 @@ void Item::proxyReady(Glib::RefPtr<Gio::AsyncResult>& result) {
53+
this->updateImage();
54+
55+
} catch (const Glib::Error& err) {
56+
- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path,
57+
- std::string(err.what()));
58+
+ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what());
59+
} catch (const std::exception& err) {
60+
- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path,
61+
- std::string(err.what()));
62+
+ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what());
63+
}
64+
}
65+
66+
@@ -126,15 +124,14 @@ ToolTip get_variant<ToolTip>(const Glib::VariantBase& value) {
67+
result.text = get_variant<Glib::ustring>(container.get_child(2));
68+
auto description = get_variant<Glib::ustring>(container.get_child(3));
69+
if (!description.empty()) {
70+
- result.text = fmt::format("<b>{}</b>\n{}", std::string(result.text), std::string(description));
71+
+ result.text = fmt::format("<b>{}</b>\n{}", result.text, description);
72+
}
73+
return result;
74+
}
75+
76+
void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) {
77+
try {
78+
- spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id,
79+
- std::string(name), get_variant<std::string>(value));
80+
+ spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id, name, value);
81+
82+
if (name == "Category") {
83+
category = get_variant<std::string>(value);
84+
@@ -179,12 +176,10 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) {
85+
}
86+
} catch (const Glib::Error& err) {
87+
spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}",
88+
- id.empty() ? bus_name : id, std::string(name), get_variant<std::string>(value),
89+
- std::string(err.what()));
90+
+ id.empty() ? bus_name : id, name, value, err.what());
91+
} catch (const std::exception& err) {
92+
spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}",
93+
- id.empty() ? bus_name : id, std::string(name), get_variant<std::string>(value),
94+
- std::string(err.what()));
95+
+ id.empty() ? bus_name : id, name, value, err.what());
96+
}
97+
}
98+
99+
@@ -226,9 +221,9 @@ void Item::processUpdatedProperties(Glib::RefPtr<Gio::AsyncResult>& _result) {
100+
101+
this->updateImage();
102+
} catch (const Glib::Error& err) {
103+
- spdlog::warn("Failed to update properties: {}", std::string(err.what()));
104+
+ spdlog::warn("Failed to update properties: {}", err.what());
105+
} catch (const std::exception& err) {
106+
- spdlog::warn("Failed to update properties: {}", std::string(err.what()));
107+
+ spdlog::warn("Failed to update properties: {}", err.what());
108+
}
109+
update_pending_.clear();
110+
}
111+
@@ -250,7 +245,7 @@ static const std::map<std::string_view, std::set<std::string_view>> signal2props
112+
113+
void Item::onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
114+
const Glib::VariantContainerBase& arguments) {
115+
- spdlog::trace("Tray item '{}' got signal {}", id, std::string(signal_name));
116+
+ spdlog::trace("Tray item '{}' got signal {}", id, signal_name);
117+
auto changed = signal2props.find(signal_name.raw());
118+
if (changed != signal2props.end()) {
119+
if (update_pending_.empty()) {

0 commit comments

Comments
 (0)