+++ /dev/null
-From b1b5cd6bbb1e0dea35e7b86429ff3e04fd67db9f Mon Sep 17 00:00:00 2001
-From: Jan Palus <atler@pld-linux.org>
-Date: Wed, 23 Dec 2020 23:31:20 +0100
-Subject: [PATCH 1/5] feat(mpd): split noidle into noidle and recv_idle
-
----
- include/adapters/mpd.hpp | 3 ++-
- src/adapters/mpd.cpp | 15 ++++++++++++---
- src/modules/mpd.cpp | 3 ++-
- 3 files changed, 16 insertions(+), 5 deletions(-)
-
-diff --git a/include/adapters/mpd.hpp b/include/adapters/mpd.hpp
-index 2a152b01c..2e9b438e8 100644
---- a/include/adapters/mpd.hpp
-+++ b/include/adapters/mpd.hpp
-@@ -91,7 +91,8 @@ namespace mpd {
-
- int get_fd();
- void idle();
-- int noidle();
-+ bool noidle();
-+ int recv_idle();
-
- unique_ptr<mpdstatus> get_status();
- unique_ptr<mpdstatus> get_status_safe();
-diff --git a/src/adapters/mpd.cpp b/src/adapters/mpd.cpp
-index 4a5438ad5..083427a9c 100644
---- a/src/adapters/mpd.cpp
-+++ b/src/adapters/mpd.cpp
-@@ -201,12 +201,21 @@ namespace mpd {
- }
- }
-
-- int mpdconnection::noidle() {
-+ bool mpdconnection::noidle() {
-+ check_connection(m_connection.get());
-+ bool success = true;
-+ if (m_idle) {
-+ success = mpd_send_noidle(m_connection.get());
-+ }
-+ return success;
-+ }
-+
-+ int mpdconnection::recv_idle() {
- check_connection(m_connection.get());
- int flags = 0;
-- if (m_idle && mpd_send_noidle(m_connection.get())) {
-- m_idle = false;
-+ if (m_idle) {
- flags = mpd_recv_idle(m_connection.get(), true);
-+ m_idle = false;
- mpd_response_finish(m_connection.get());
- check_errors(m_connection.get());
- }
-diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp
-index ea867f281..1ba33c81c 100644
---- a/src/modules/mpd.cpp
-+++ b/src/modules/mpd.cpp
-@@ -182,7 +182,8 @@ namespace modules {
- m_mpd->idle();
-
- int idle_flags = 0;
-- if ((idle_flags = m_mpd->noidle()) != 0) {
-+ m_mpd->noidle();
-+ if ((idle_flags = m_mpd->recv_idle()) != 0) {
- // Update status on every event
- m_status->update(idle_flags, m_mpd.get());
- return true;
-
-From 1e2d86354cf3553df202e3fddc848ee54b2ff872 Mon Sep 17 00:00:00 2001
-From: Jan Palus <atler@pld-linux.org>
-Date: Fri, 25 Dec 2020 01:15:30 +0100
-Subject: [PATCH 2/5] feat(mpd): reduce wakeups/network traffic when not
- tracking time
-
----
- include/adapters/mpd.hpp | 1 +
- src/adapters/mpd.cpp | 15 +++++++++++++++
- src/modules/mpd.cpp | 16 ++++++++++++----
- 3 files changed, 28 insertions(+), 4 deletions(-)
-
-diff --git a/include/adapters/mpd.hpp b/include/adapters/mpd.hpp
-index 2e9b438e8..7f5a43e1b 100644
---- a/include/adapters/mpd.hpp
-+++ b/include/adapters/mpd.hpp
-@@ -93,6 +93,7 @@ namespace mpd {
- void idle();
- bool noidle();
- int recv_idle();
-+ int try_recv_idle(int timeout);
-
- unique_ptr<mpdstatus> get_status();
- unique_ptr<mpdstatus> get_status_safe();
-diff --git a/src/adapters/mpd.cpp b/src/adapters/mpd.cpp
-index 083427a9c..76f824115 100644
---- a/src/adapters/mpd.cpp
-+++ b/src/adapters/mpd.cpp
-@@ -1,5 +1,6 @@
- #include <cassert>
- #include <csignal>
-+#include <poll.h>
- #include <thread>
- #include <utility>
-
-@@ -222,6 +223,20 @@ namespace mpd {
- return flags;
- }
-
-+ int mpdconnection::try_recv_idle(int timeout) {
-+ struct pollfd pfd = { m_fd, POLLIN, 0 };
-+
-+ int poll_ret = poll(&pfd, 1, timeout);
-+
-+ if (poll_ret > 0) {
-+ return recv_idle();
-+ } else if (poll_ret == 0) {
-+ return 0;
-+ } else {
-+ throw mpd_exception("poll() returned error: "s + std::strerror(errno));
-+ }
-+ }
-+
- unique_ptr<mpdstatus> mpdconnection::get_status() {
- check_prerequisites();
- auto status = make_unique<mpdstatus>(this);
-diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp
-index 1ba33c81c..9c53378b8 100644
---- a/src/modules/mpd.cpp
-+++ b/src/modules/mpd.cpp
-@@ -178,12 +178,20 @@ namespace modules {
- m_status = m_mpd->get_status_safe();
- }
-
-+ bool track_time = (m_label_time || m_bar_progress) && m_status->match_state(mpdstate::PLAYING);
- try {
- m_mpd->idle();
-
-- int idle_flags = 0;
-- m_mpd->noidle();
-- if ((idle_flags = m_mpd->recv_idle()) != 0) {
-+ int idle_flags;
-+
-+ if (track_time) {
-+ m_mpd->noidle();
-+ idle_flags = m_mpd->recv_idle();
-+ } else {
-+ idle_flags = m_mpd->try_recv_idle(2000);
-+ }
-+
-+ if (idle_flags != 0) {
- // Update status on every event
- m_status->update(idle_flags, m_mpd.get());
- return true;
-@@ -194,7 +202,7 @@ namespace modules {
- return def;
- }
-
-- if ((m_label_time || m_bar_progress) && m_status->match_state(mpdstate::PLAYING)) {
-+ if (track_time) {
- auto now = chrono::system_clock::now();
- auto diff = now - m_lastsync;
-
-
-From 139dca02ae02615cd331d8061ac7c0cae661be25 Mon Sep 17 00:00:00 2001
-From: Jan Palus <atler@pld-linux.org>
-Date: Fri, 25 Dec 2020 01:23:34 +0100
-Subject: [PATCH 3/5] feat(mpd): subscribe only to relevant event types
-
----
- src/adapters/mpd.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/adapters/mpd.cpp b/src/adapters/mpd.cpp
-index 76f824115..b4567e7f2 100644
---- a/src/adapters/mpd.cpp
-+++ b/src/adapters/mpd.cpp
-@@ -196,7 +196,7 @@ namespace mpd {
- void mpdconnection::idle() {
- check_connection(m_connection.get());
- if (!m_idle) {
-- mpd_send_idle(m_connection.get());
-+ mpd_send_idle_mask(m_connection.get(), (mpd_idle) (MPD_IDLE_PLAYER | MPD_IDLE_OPTIONS));
- check_errors(m_connection.get());
- m_idle = true;
- }
-
-From 00eeb73637ff1928c9621fe6008628f04a1cf655 Mon Sep 17 00:00:00 2001
-From: Jan Palus <atler@pld-linux.org>
-Date: Fri, 25 Dec 2020 01:31:04 +0100
-Subject: [PATCH 4/5] feat(mpd): minor optimization of happy code path
-
----
- src/modules/mpd.cpp | 8 +-------
- 1 file changed, 1 insertion(+), 7 deletions(-)
-
-diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp
-index 9c53378b8..702fbebf6 100644
---- a/src/modules/mpd.cpp
-+++ b/src/modules/mpd.cpp
-@@ -149,13 +149,7 @@ namespace modules {
- }
-
- bool mpd_module::has_event() {
-- bool def = false;
--
-- if (!connected() && m_statebroadcasted == mpd::connection_state::CONNECTED) {
-- def = true;
-- } else if (connected() && m_statebroadcasted == mpd::connection_state::DISCONNECTED) {
-- def = true;
-- }
-+ bool def = (m_statebroadcasted == (connected() ? mpd::connection_state::DISCONNECTED : mpd::connection_state::CONNECTED));
-
- try {
- if (!m_mpd) {
-
-From b073db3569d887a1567a387c3ea71989ffede0cc Mon Sep 17 00:00:00 2001
-From: Jan Palus <atler@pld-linux.org>
-Date: Fri, 25 Dec 2020 12:30:10 +0100
-Subject: [PATCH 5/5] feat(mpd): slightly modify delay calculation between
- connection attempts
-
-wait 0.5s more on each attempt and cap it at 5s
----
- include/modules/mpd.hpp | 2 +-
- src/modules/mpd.cpp | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/include/modules/mpd.hpp b/include/modules/mpd.hpp
-index 04afc97e7..ed591fe42 100644
---- a/include/modules/mpd.hpp
-+++ b/include/modules/mpd.hpp
-@@ -90,7 +90,7 @@ namespace modules {
- chrono::system_clock::time_point m_lastsync{};
- float m_synctime{1.0f};
-
-- int m_quick_attempts{0};
-+ int m_connect_attempts{0};
-
- // This flag is used to let thru a broadcast once every time
- // the connection state changes
-diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp
-index 702fbebf6..3394f42a9 100644
---- a/src/modules/mpd.cpp
-+++ b/src/modules/mpd.cpp
-@@ -141,10 +141,10 @@ namespace modules {
-
- void mpd_module::idle() {
- if (connected()) {
-- m_quick_attempts = 0;
-+ m_connect_attempts = 0;
- sleep(80ms);
- } else {
-- sleep(m_quick_attempts++ < 5 ? 0.5s : 2s);
-+ sleep(++m_connect_attempts < 10 ? m_connect_attempts * 0.5s : 5s);
- }
- }
-
Summary: Fast and easy-to-use status bar
Name: polybar
-Version: 3.5.7
+Version: 3.6.3
Release: 1
License: MIT, BSD
Group: X11/Window Managers
Source0: https://github.com/polybar/polybar/releases/download/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 3a9b19709d49ac9e86d875ed2570ff91
-Patch0: %{name}-mpd-overhead.patch
-Patch1: %{name}-net-speedrate-precison.patch
+# Source0-md5: 6d51c4632b20c524f919c0a3b3a704f0
URL: https://polybar.github.io/
BuildRequires: alsa-lib-devel
BuildRequires: cairo-devel
-BuildRequires: cmake >= 3.1
+BuildRequires: cmake >= 3.5.0
BuildRequires: curl-devel
BuildRequires: i3
BuildRequires: i3-devel
BuildRequires: libmpdclient-devel
BuildRequires: libnl-devel
BuildRequires: libstdc++-devel >= 6:5.1
+BuildRequires: libuv-devel >= 1.3.0
BuildRequires: libxcb-devel >= 1.12
BuildRequires: pkgconfig
BuildRequires: pulseaudio
BuildRequires: xcb-util-wm-devel
BuildRequires: xcb-util-xrm-devel
Requires: jsoncpp >= 1.7.7
+Requires: libuv >= 1.3.0
Requires: libxcb >= 1.12
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q
-%patch0 -p1
-%patch1 -p1
%build
install -d build
%files
%defattr(644,root,root,755)
-%doc README.md SUPPORT.md config
+%doc README.md SUPPORT.md
+%dir %{_sysconfdir}/polybar
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/polybar/config.ini
%attr(755,root,root) %{_bindir}/polybar
%attr(755,root,root) %{_bindir}/polybar-msg
%{_mandir}/man1/polybar.1*
+%{_mandir}/man1/polybar-msg.1*
%{_mandir}/man5/polybar.5*
%files -n bash-completion-polybar