[PATCH somebar] patch to show status only on selected monitor
Export this patch
---
contrib/show-status-on-selected-monitor.patch | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 contrib/show-status-on-selected-monitor.patch
diff --git a/contrib/show-status-on-selected-monitor.patch b/contrib/show-status-on-selected-monitor.patch
new file mode 100644
index 0000000..ab26835
--- /dev/null
+++ b/contrib/show-status-on-selected-monitor.patch
@@ -0,0 +1,43 @@
+ From 1ca4603b79e888980fb46d5dc6aa0d6f8afa2b3c Mon Sep 17 00:00:00 2001
+ From: Ben Collerson <benc@benc.cc>
+ Date: Mon, 28 Nov 2022 13:22:16 +1000
+ Subject: [PATCH] show status on selected monitor
+
+ ---
+ src/bar.cpp | 7 ++++++-
+ src/main.cpp | 1 +
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+ diff --git a/src/bar.cpp b/src/bar.cpp
+ index 507ce62..f962927 100644
+ --- a/src/bar.cpp
+ +++ b/src/bar.cpp
+ @@ -156,7 +156,12 @@ void Bar::setTitle(const std::string& title)
+ }
+ void Bar::setStatus(const std::string& status)
+ {
+ - _statusCmp.setText(status);
+ + if (_selected) {
+ + _statusCmp.setText(status);
+ + }
+ + else {
+ + _statusCmp.setText("");
+ + }
+ }
+
+ void Bar::invalidate()
+ diff --git a/src/main.cpp b/src/main.cpp
+ index 6274959..c6fd401 100644
+ --- a/src/main.cpp
+ +++ b/src/main.cpp
+ @@ -307,6 +307,7 @@ static void handleStdin(const std::string& line)
+ uint32_t selected;
+ stream >> selected;
+ mon->bar.setSelected(selected);
+ + mon->bar.setStatus(lastStatus);
+ if (selected) {
+ selmon = &*mon;
+ } else if (selmon == &*mon) {
+ --
+ 2.38.1
+
--
2.38.1
somebar/patches: SUCCESS in 1m4s
[patch to show status only on selected monitor][0] from [Ben Collerson][1]
[0]: https://lists.sr.ht/~raphi/public-inbox/patches/37256
[1]: mailto:benc@benc.cc
✓ #895289 SUCCESS somebar/patches/archlinux.yml https://builds.sr.ht/~raphi/job/895289
✓ #895290 SUCCESS somebar/patches/freebsd.yml https://builds.sr.ht/~raphi/job/895290
Thanks
To git.sr.ht:~raphi/somebar
83f5994..c36d1f2 master -> master