Compare commits
9 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
ab5016c9bc |
|||
|
|
9d96345347 | ||
|
|
0ddcc56e20 | ||
|
|
ed30418b47 | ||
|
|
028d43f0ba |
||
|
|
c5fe285571 | ||
|
|
63cf240c0e | ||
|
|
4346efe1b4 | ||
|
|
14a6c5fd9a |
5 changed files with 222 additions and 4 deletions
142
fix-treat-missing-interval-as-once.patch
Normal file
142
fix-treat-missing-interval-as-once.patch
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
From c9a7cbbdb385521f992d60539daa6a94d403d253 Mon Sep 17 00:00:00 2001
|
||||
From: Austin Horstman <khaneliman12@gmail.com>
|
||||
Date: Mon, 9 Feb 2026 15:26:23 -0600
|
||||
Subject: [PATCH 1/2] fix(image): treat missing interval as once
|
||||
|
||||
PR #4390 enabled millisecond intervals but changed image interval parsing so a missing interval could resolve to 1ms. That creates a hot update loop and can spike CPU and destabilize rendering in drawer/group setups (issue #4835).
|
||||
|
||||
Use explicit semantics: missing, null, non-numeric, or <=0 interval is treated as "once" (max sleep), while positive numeric values still support ms precision with a 1ms floor. This keeps the intended feature (sub-second polling when requested) without defaulting to busy looping.
|
||||
|
||||
Also align waybar-image(5) docs with runtime behavior.
|
||||
|
||||
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
|
||||
---
|
||||
man/waybar-image.5.scd | 3 ++-
|
||||
src/modules/image.cpp | 27 ++++++++++++++++-----------
|
||||
2 files changed, 18 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/man/waybar-image.5.scd b/man/waybar-image.5.scd
|
||||
index 8c991265e..8be182a6f 100644
|
||||
--- a/man/waybar-image.5.scd
|
||||
+++ b/man/waybar-image.5.scd
|
||||
@@ -26,7 +26,8 @@ The *image* module displays an image from a path.
|
||||
*interval*: ++
|
||||
typeof: integer or float ++
|
||||
The interval (in seconds) to re-render the image. ++
|
||||
- Minimum value is 0.001 (1ms). Values smaller than 1ms will be set to 1ms. ++
|
||||
+ If set to a positive value, the minimum is 0.001 (1ms). Values smaller than 1ms will be set to 1ms. ++
|
||||
+ Zero or negative values are treated as "once". ++
|
||||
This is useful if the contents of *path* changes. ++
|
||||
If no *interval* is defined, the image will only be rendered once.
|
||||
|
||||
diff --git a/src/modules/image.cpp b/src/modules/image.cpp
|
||||
index 189deee6a..98bf3c46f 100644
|
||||
--- a/src/modules/image.cpp
|
||||
+++ b/src/modules/image.cpp
|
||||
@@ -14,22 +14,27 @@ waybar::modules::Image::Image(const std::string& id, const Json::Value& config)
|
||||
|
||||
size_ = config["size"].asInt();
|
||||
|
||||
- interval_ = config_["interval"] == "once"
|
||||
- ? std::chrono::milliseconds::max()
|
||||
- : std::chrono::milliseconds(std::max(
|
||||
- 1L, // Minimum 1ms due to millisecond precision
|
||||
- static_cast<long>(
|
||||
- (config_["interval"].isNumeric() ? config_["interval"].asDouble() : 0) *
|
||||
- 1000)));
|
||||
+ const auto once = std::chrono::milliseconds::max();
|
||||
+ if (!config_.isMember("interval") || config_["interval"].isNull() ||
|
||||
+ config_["interval"] == "once") {
|
||||
+ interval_ = once;
|
||||
+ } else if (config_["interval"].isNumeric()) {
|
||||
+ const auto interval_seconds = config_["interval"].asDouble();
|
||||
+ if (interval_seconds <= 0) {
|
||||
+ interval_ = once;
|
||||
+ } else {
|
||||
+ interval_ =
|
||||
+ std::chrono::milliseconds(std::max(1L, // Minimum 1ms due to millisecond precision
|
||||
+ static_cast<long>(interval_seconds * 1000)));
|
||||
+ }
|
||||
+ } else {
|
||||
+ interval_ = once;
|
||||
+ }
|
||||
|
||||
if (size_ == 0) {
|
||||
size_ = 16;
|
||||
}
|
||||
|
||||
- if (interval_.count() == 0) {
|
||||
- interval_ = std::chrono::milliseconds::max();
|
||||
- }
|
||||
-
|
||||
delayWorker();
|
||||
}
|
||||
|
||||
|
||||
From 3b478ee6a53f153f35f35729c26bf11b15f692a2 Mon Sep 17 00:00:00 2001
|
||||
From: Austin Horstman <khaneliman12@gmail.com>
|
||||
Date: Mon, 9 Feb 2026 15:53:44 -0600
|
||||
Subject: [PATCH 2/2] chore: format
|
||||
|
||||
Some unrelated files failed formatting.
|
||||
|
||||
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
|
||||
---
|
||||
include/util/command.hpp | 4 +---
|
||||
src/modules/hyprland/window.cpp | 4 +---
|
||||
src/modules/hyprland/windowcount.cpp | 6 ++----
|
||||
3 files changed, 4 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/include/util/command.hpp b/include/util/command.hpp
|
||||
index 58c59a965..89d4372a1 100644
|
||||
--- a/include/util/command.hpp
|
||||
+++ b/include/util/command.hpp
|
||||
@@ -172,8 +172,6 @@ inline int32_t forkExec(const std::string& cmd, const std::string& output_name)
|
||||
return pid;
|
||||
}
|
||||
|
||||
-inline int32_t forkExec(const std::string& cmd) {
|
||||
- return forkExec(cmd, "");
|
||||
-}
|
||||
+inline int32_t forkExec(const std::string& cmd) { return forkExec(cmd, ""); }
|
||||
|
||||
} // namespace waybar::util::command
|
||||
diff --git a/src/modules/hyprland/window.cpp b/src/modules/hyprland/window.cpp
|
||||
index e02a76917..197ed0920 100644
|
||||
--- a/src/modules/hyprland/window.cpp
|
||||
+++ b/src/modules/hyprland/window.cpp
|
||||
@@ -237,9 +237,7 @@ void Window::queryActiveWorkspace() {
|
||||
}
|
||||
}
|
||||
|
||||
-void Window::onEvent(const std::string& ev) {
|
||||
- dp.emit();
|
||||
-}
|
||||
+void Window::onEvent(const std::string& ev) { dp.emit(); }
|
||||
|
||||
void Window::setClass(const std::string& classname, bool enable) {
|
||||
if (enable) {
|
||||
diff --git a/src/modules/hyprland/windowcount.cpp b/src/modules/hyprland/windowcount.cpp
|
||||
index 487b00834..d881a3616 100644
|
||||
--- a/src/modules/hyprland/windowcount.cpp
|
||||
+++ b/src/modules/hyprland/windowcount.cpp
|
||||
@@ -38,7 +38,7 @@ WindowCount::~WindowCount() {
|
||||
|
||||
auto WindowCount::update() -> void {
|
||||
std::lock_guard<std::mutex> lg(mutex_);
|
||||
-
|
||||
+
|
||||
queryActiveWorkspace();
|
||||
|
||||
std::string format = config_["format"].asString();
|
||||
@@ -125,9 +125,7 @@ void WindowCount::queryActiveWorkspace() {
|
||||
}
|
||||
}
|
||||
|
||||
-void WindowCount::onEvent(const std::string& ev) {
|
||||
- dp.emit();
|
||||
-}
|
||||
+void WindowCount::onEvent(const std::string& ev) { dp.emit(); }
|
||||
|
||||
void WindowCount::setClass(const std::string& classname, bool enable) {
|
||||
if (enable) {
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (waybar-0.14.0.tar.gz) = dc3d18f7117be8cce5979029110770699b0d9d737337c3cf27361d6ceda6fcde33dac9781e406a70eb24c9e0e95e3801d47e81d44bfb61c311510fb30dd975a7
|
||||
SHA512 (waybar-0.15.0.tar.gz) = f267c1ad2af1e4e74c3d8c966009a013c0b5c2849bfaf312b3b91e9d6f6856dc5466118f308208948118ea1de0cf70986cc3b592cc830f84d634b8518c5b8c9e
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ index 7e830285..e0310372 100644
|
|||
* {
|
||||
- /* `otf-font-awesome` is required to be installed for icons */
|
||||
- font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
|
||||
+ font-family: 'Noto Sans Mono', 'Font Awesome 6 Free', 'Font Awesome 6 Brands', monospace;
|
||||
+ font-family: 'Noto Sans Mono', 'Font Awesome 7 Free', 'Font Awesome 7 Brands', monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
|
|
|
|||
39
waybar-fedora-systemd-target-conflicts.patch
Normal file
39
waybar-fedora-systemd-target-conflicts.patch
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
From f67dcce02d02ef1dc8e78efc565647b6fe8656d4 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksei Bavshin <alebastr89@gmail.com>
|
||||
Date: Sat, 4 Jul 2026 22:51:31 -0700
|
||||
Subject: [PATCH] systemd: declare known incompatible desktop environments
|
||||
|
||||
Waybar can be used with many different Wayland compositors. Some of
|
||||
those provide distinct user session targets, some aren't. The usual
|
||||
recommendation for the latter ones is to allow manual startup of the
|
||||
graphical-session.target and run "systemd --user start ..." command on
|
||||
init.
|
||||
|
||||
To ensure that all of the above is supported, we have to keep the
|
||||
service bound to the graphical-session.target. However, this may impact
|
||||
unrelated sessions on machines with multiple DEs installed.
|
||||
|
||||
Instead of listing dozens of supported Wayland compositors and breaking
|
||||
any configs that explicitly use graphical-session.target, keep a list
|
||||
of known sessions where Waybar is not wanted.
|
||||
---
|
||||
resources/waybar.service.in | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/resources/waybar.service.in b/resources/waybar.service.in
|
||||
index 18bac54c..9a54e5ba 100644
|
||||
--- a/resources/waybar.service.in
|
||||
+++ b/resources/waybar.service.in
|
||||
@@ -6,6 +6,9 @@ After=graphical-session.target
|
||||
Requisite=graphical-session.target
|
||||
|
||||
[Service]
|
||||
+ExecCondition=sh -c '[ -n "$WAYLAND_DISPLAY" ]'
|
||||
+# Known incompatible Wayland sessions
|
||||
+ExecCondition=/usr/lib/systemd/systemd-xdg-autostart-condition "" "GNOME:KDE:COSMIC:X-Cinnamon"
|
||||
ExecStart=@prefix@/bin/waybar
|
||||
ExecReload=kill -SIGUSR2 $MAINPID
|
||||
Restart=on-failure
|
||||
--
|
||||
2.55.0
|
||||
|
||||
41
waybar.spec
41
waybar.spec
|
|
@ -1,6 +1,6 @@
|
|||
Name: waybar
|
||||
Version: 0.14.0
|
||||
Release: 1%{?dist}
|
||||
Version: 0.15.0
|
||||
Release: 6%{?dist}
|
||||
Summary: Highly customizable Wayland bar for Sway and Wlroots based compositors
|
||||
# Source files/overall project licensed as MIT, but
|
||||
# - BSL-1.0
|
||||
|
|
@ -21,6 +21,14 @@ Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
|||
# - Remove several modules from the config
|
||||
# - Switch font to monospace
|
||||
Patch: waybar-fedora-config-changes.patch
|
||||
# Downstream changes to the systemd service:
|
||||
# - Check that the environment is Wayland and is not listed as unsupported
|
||||
Patch: waybar-fedora-systemd-target-conflicts.patch
|
||||
|
||||
# Fix for hot update loop that can spike CPU and
|
||||
# destabilize rendering in drawer/group setups
|
||||
# https://github.com/Alexays/Waybar/pull/4838
|
||||
Patch: fix-treat-missing-interval-as-once.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
|
|
@ -58,8 +66,13 @@ BuildRequires: pkgconfig(wireplumber-0.5)
|
|||
BuildRequires: pkgconfig(xkbregistry)
|
||||
|
||||
Enhances: sway
|
||||
%if 0%{?fedora} < 45
|
||||
Recommends: font(fontawesome6free)
|
||||
Recommends: font(fontawesome6brands)
|
||||
%else
|
||||
Recommends: font(fontawesome7free)
|
||||
Recommends: font(fontawesome7brands)
|
||||
%endif
|
||||
|
||||
%description
|
||||
%{summary}.
|
||||
|
|
@ -97,6 +110,30 @@ Recommends: font(fontawesome6brands)
|
|||
%{_userunitdir}/%{name}.service
|
||||
|
||||
%changelog
|
||||
* Sun Aug 02 2026 Aleksei Bavshin <alebastr@fedoraproject.org> - 0.15.0-6
|
||||
- systemd: declare known incompatible desktop environments
|
||||
|
||||
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Thu Jun 25 2026 František Zatloukal <fzatlouk@redhat.com> - 0.15.0-4
|
||||
- Rebuilt for fmt/spdlog
|
||||
|
||||
* Wed May 27 2026 Jerry James <loganjerry@gmail.com> - 0.15.0-3
|
||||
- Migrate from FontAwesome 6.x to 7.x
|
||||
|
||||
* Sun Mar 22 2026 Björn Esser <besser82@fedoraproject.org> - 0.15.0-2
|
||||
- Rebuild (jsoncpp)
|
||||
|
||||
* Sat Feb 07 2026 Tomasz Hołubowicz <mail@alternateved.com> - 0.15.0-1
|
||||
- Update to 0.15.0
|
||||
|
||||
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Wed Jan 14 2026 Jitka Plesnikova <jplesnik@redhat.com> - 0.14.0-2
|
||||
- Rebuild for new gpsd
|
||||
|
||||
* Sun Aug 10 2025 Aleksei Bavshin <alebastr@fedoraproject.org> - 0.14.0-1
|
||||
- Update to 0.14.0 (#2387223)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue