From 246f7bf555e17dcdb0f765aca3b852382b4075df Mon Sep 17 00:00:00 2001 From: excellentname Date: Tue, 21 Jul 2020 12:36:48 +1000 Subject: [PATCH 001/303] Handle SIGCHLD for exec/forkExec When forkExec is called it begins to ignore all SIGCHLD signals for the rest of the progam's execution so that they are automatically reaped. However, this means that subsequent waitpid calls in the exec function will always fail. So instead handle SIGCHLD by reaping any processes created by forkExec and ignoring all others so that they can be handled directly by the exec function. --- include/util/command.hpp | 12 ++++++++++-- src/main.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/include/util/command.hpp b/include/util/command.hpp index a72a829..9db8d83 100644 --- a/include/util/command.hpp +++ b/include/util/command.hpp @@ -7,6 +7,9 @@ #include +extern sig_atomic_t is_inserting_pid; +extern std::list reap; + namespace waybar::util::command { struct res { @@ -32,10 +35,11 @@ inline std::string read(FILE* fp) { inline int close(FILE* fp, pid_t pid) { int stat = -1; + pid_t ret; fclose(fp); do { - waitpid(pid, &stat, WCONTINUED | WUNTRACED); + ret = waitpid(pid, &stat, WCONTINUED | WUNTRACED); if (WIFEXITED(stat)) { spdlog::debug("Cmd exited with code {}", WEXITSTATUS(stat)); @@ -45,6 +49,8 @@ inline int close(FILE* fp, pid_t pid) { spdlog::debug("Cmd stopped by {}", WSTOPSIG(stat)); } else if (WIFCONTINUED(stat)) { spdlog::debug("Cmd continued"); + } else if (ret == -1) { + spdlog::debug("waitpid failed: {}", strerror(errno)); } else { break; } @@ -111,7 +117,9 @@ inline int32_t forkExec(const std::string& cmd) { execl("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0); exit(0); } else { - signal(SIGCHLD, SIG_IGN); + is_inserting_pid = true; + reap.push_back(pid); + is_inserting_pid = false; } return pid; diff --git a/src/main.cpp b/src/main.cpp index f066cf8..5350ec0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,32 @@ #include +#include +#include +#include #include #include "client.hpp" +sig_atomic_t is_inserting_pid = false; +std::list reap; + +static void handler(int sig) { + int saved_errno = errno; + if (!is_inserting_pid) { + for (auto it = reap.begin(); it != reap.end(); ++it) { + if (waitpid(*it, nullptr, WNOHANG) == *it) { + it = reap.erase(it); + } + } + } + errno = saved_errno; +} + +inline void installSigChldHandler(void) { + struct sigaction sa; + sigemptyset(&sa.sa_mask); + sa.sa_handler = handler; + sigaction(SIGCHLD, &sa, nullptr); +} + int main(int argc, char* argv[]) { try { auto client = waybar::Client::inst(); @@ -18,6 +43,7 @@ int main(int argc, char* argv[]) { } }); } + installSigChldHandler(); auto ret = client->main(argc, argv); delete client; From c3359dec1b3a711f2912aab6c11009a8c46d2fe2 Mon Sep 17 00:00:00 2001 From: excellentname Date: Sat, 25 Jul 2020 21:02:59 +1000 Subject: [PATCH 002/303] Replace signal handler with signal handling thread --- include/util/command.hpp | 22 ++++++++++--- src/main.cpp | 70 +++++++++++++++++++++++++++++++--------- 2 files changed, 72 insertions(+), 20 deletions(-) diff --git a/include/util/command.hpp b/include/util/command.hpp index 9db8d83..5265558 100644 --- a/include/util/command.hpp +++ b/include/util/command.hpp @@ -7,7 +7,7 @@ #include -extern sig_atomic_t is_inserting_pid; +extern std::mutex reap_mtx; extern std::list reap; namespace waybar::util::command { @@ -71,6 +71,12 @@ inline FILE* open(const std::string& cmd, int& pid) { } if (!child_pid) { + int err; + sigset_t mask; + sigfillset(&mask); + // Reset sigmask + err = pthread_sigmask(SIG_UNBLOCK, &mask, nullptr); + if (err != 0) spdlog::error("pthread_sigmask in open failed: {}", strerror(err)); ::close(fd[0]); dup2(fd[1], 1); setpgid(child_pid, child_pid); @@ -103,7 +109,7 @@ inline struct res execNoRead(const std::string& cmd) { inline int32_t forkExec(const std::string& cmd) { if (cmd == "") return -1; - int32_t pid = fork(); + pid_t pid = fork(); if (pid < 0) { spdlog::error("Unable to exec cmd {}, error {}", cmd.c_str(), strerror(errno)); @@ -112,14 +118,20 @@ inline int32_t forkExec(const std::string& cmd) { // Child executes the command if (!pid) { + int err; + sigset_t mask; + sigfillset(&mask); + // Reset sigmask + err = pthread_sigmask(SIG_UNBLOCK, &mask, nullptr); + if (err != 0) spdlog::error("pthread_sigmask in forkExec failed: {}", strerror(err)); setpgid(pid, pid); - signal(SIGCHLD, SIG_DFL); execl("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0); exit(0); } else { - is_inserting_pid = true; + reap_mtx.lock(); reap.push_back(pid); - is_inserting_pid = false; + reap_mtx.unlock(); + spdlog::debug("Added child to reap list: {}", pid); } return pid; diff --git a/src/main.cpp b/src/main.cpp index 5350ec0..19a8de1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,30 +1,70 @@ #include #include +#include #include #include #include #include "client.hpp" -sig_atomic_t is_inserting_pid = false; +std::mutex reap_mtx; std::list reap; -static void handler(int sig) { - int saved_errno = errno; - if (!is_inserting_pid) { - for (auto it = reap.begin(); it != reap.end(); ++it) { - if (waitpid(*it, nullptr, WNOHANG) == *it) { - it = reap.erase(it); - } +void* signalThread(void* args) { + int err, signum; + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGCHLD); + + while (true) { + err = sigwait(&mask, &signum); + if (err != 0) { + spdlog::error("sigwait failed: {}", strerror(errno)); + continue; + } + + switch (signum) { + case SIGCHLD: + spdlog::debug("Received SIGCHLD in signalThread"); + if (!reap.empty()) { + reap_mtx.lock(); + for (auto it = reap.begin(); it != reap.end(); ++it) { + if (waitpid(*it, nullptr, WNOHANG) == *it) { + spdlog::debug("Reaped child with PID: {}", *it); + it = reap.erase(it); + } + } + reap_mtx.unlock(); + } + break; + default: + spdlog::debug("Received signal with number {}, but not handling", + signum); + break; } } - errno = saved_errno; } -inline void installSigChldHandler(void) { - struct sigaction sa; - sigemptyset(&sa.sa_mask); - sa.sa_handler = handler; - sigaction(SIGCHLD, &sa, nullptr); +void startSignalThread(void) { + int err; + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGCHLD); + + // Block SIGCHLD so it can be handled by the signal thread + // Any threads created by this one (the main thread) should not + // modify their signal mask to unblock SIGCHLD + err = pthread_sigmask(SIG_BLOCK, &mask, nullptr); + if (err != 0) { + spdlog::error("pthread_sigmask failed in startSignalThread: {}", strerror(err)); + exit(1); + } + + pthread_t thread_id; + err = pthread_create(&thread_id, nullptr, signalThread, nullptr); + if (err != 0) { + spdlog::error("pthread_create failed in startSignalThread: {}", strerror(err)); + exit(1); + } } int main(int argc, char* argv[]) { @@ -43,7 +83,7 @@ int main(int argc, char* argv[]) { } }); } - installSigChldHandler(); + startSignalThread(); auto ret = client->main(argc, argv); delete client; From 74018167ffb135b9d7190e37a4c0dda8a0cbbb6a Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 4 Aug 2020 20:54:14 +0200 Subject: [PATCH 003/303] fix: add missing modules to list in waybar.5 --- man/waybar.5.scd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/waybar.5.scd b/man/waybar.5.scd index 5267110..cd64f7d 100644 --- a/man/waybar.5.scd +++ b/man/waybar.5.scd @@ -185,14 +185,18 @@ Valid options for the "rotate" property are: 0, 90, 180 and 270. - *waybar-backlight(5)* - *waybar-battery(5)* +- *waybar-bluetooth(5)* - *waybar-clock(5)* - *waybar-cpu(5)* - *waybar-custom(5)* +- *waybar-disk(5)* - *waybar-idle-inhibitor(5)* - *waybar-memory(5)* - *waybar-mpd(5)* - *waybar-network(5)* - *waybar-pulseaudio(5)* +- *waybar-river-tags(5)* +- *waybar-states(5)* - *waybar-sway-mode(5)* - *waybar-sway-window(5)* - *waybar-sway-workspaces(5)* From 40d3f1c1feee28d34390f99b36edb9da504ea4b1 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 5 Aug 2020 09:42:04 -0700 Subject: [PATCH 004/303] chore(subprojects): update date to 3.0.0 Fixes #776, fixes #780 --- subprojects/date.wrap | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subprojects/date.wrap b/subprojects/date.wrap index ea73f0f..4d4067c 100644 --- a/subprojects/date.wrap +++ b/subprojects/date.wrap @@ -1,9 +1,9 @@ [wrap-file] -source_url=https://github.com/HowardHinnant/date/archive/v2.4.1.tar.gz -source_filename=date-2.4.1.tar.gz -source_hash=98907d243397483bd7ad889bf6c66746db0d7d2a39cc9aacc041834c40b65b98 -directory=date-2.4.1 +source_url=https://github.com/HowardHinnant/date/archive/v3.0.0.tar.gz +source_filename=date-3.0.0.tar.gz +source_hash=87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3 +directory=date-3.0.0 -patch_url = https://github.com/mesonbuild/hinnant-date/releases/download/2.4.1-1/hinnant-date.zip -patch_filename = hinnant-date-2.4.1-1-wrap.zip -patch_hash = 2061673a6f8e6d63c3a40df4da58fa2b3de2835fd9b3e74649e8279599f3a8f6 +patch_url = https://github.com/mesonbuild/hinnant-date/releases/download/3.0.0-1/hinnant-date.zip +patch_filename = hinnant-date-3.0.0-1-wrap.zip +patch_hash = 6ccaf70732d8bdbd1b6d5fdf3e1b935c23bf269bda12fdfd0e561276f63432fe From 66aa3574d9c3a5696889f5b2f9718b7606472404 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 5 Aug 2020 09:44:58 -0700 Subject: [PATCH 005/303] chore(subprojects): update gtk-layer-shell to 0.2.0 Fixes: #530, fixes #750 --- subprojects/gtk-layer-shell.wrap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gtk-layer-shell.wrap b/subprojects/gtk-layer-shell.wrap index b826ab9..9db9df5 100644 --- a/subprojects/gtk-layer-shell.wrap +++ b/subprojects/gtk-layer-shell.wrap @@ -1,5 +1,5 @@ [wrap-file] -directory = gtk-layer-shell-0.1.0 -source_filename = gtk-layer-shell-0.1.0.tar.gz -source_hash = f7569e27ae30b1a94c3ad6c955cf56240d6bc272b760d9d266ce2ccdb94a5cf0 -source_url = https://github.com/wmww/gtk-layer-shell/archive/v0.1.0/gtk-layer-shell-0.1.0.tar.gz +directory = gtk-layer-shell-0.2.0 +source_filename = gtk-layer-shell-0.2.0.tar.gz +source_hash = 6934376b5296d079fca2c1ba6b222ec91db6bf3667142340ee2bdebfb4b69116 +source_url = https://github.com/wmww/gtk-layer-shell/archive/v0.2.0/gtk-layer-shell-0.2.0.tar.gz From dcc0201b45efa2e6327ac65cfd63f7006a0d0f78 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 5 Aug 2020 09:39:16 -0700 Subject: [PATCH 006/303] chore(protocol): update wlr-layer-shell-unstable-v1 protocol. Statically linked gtk-layer-shell would use layer-shell protocol object file from waybar and print runtime warning if the version does not match --- protocol/wlr-layer-shell-unstable-v1.xml | 52 ++++++++++++++++++------ 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/protocol/wlr-layer-shell-unstable-v1.xml b/protocol/wlr-layer-shell-unstable-v1.xml index fb4f6b2..f9a4fe0 100644 --- a/protocol/wlr-layer-shell-unstable-v1.xml +++ b/protocol/wlr-layer-shell-unstable-v1.xml @@ -25,7 +25,7 @@ THIS SOFTWARE. - + Clients can use this interface to assign the surface_layer role to wl_surfaces. Such surfaces are assigned to a "layer" of the output and @@ -82,17 +82,27 @@ + + + + + + This request indicates that the client will not use the layer_shell + object any more. Objects that have been created through this instance + are not affected. + + - + An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered as a layer of a stacked desktop-like environment. - Layer surface state (size, anchor, exclusive zone, margin, interactivity) - is double-buffered, and will be applied at the time wl_surface.commit of - the corresponding wl_surface is called. + Layer surface state (layer, size, anchor, exclusive zone, + margin, interactivity) is double-buffered, and will be applied at the + time wl_surface.commit of the corresponding wl_surface is called. @@ -115,7 +125,7 @@ Requests that the compositor anchor the surface to the specified edges - and corners. If two orthoginal edges are specified (e.g. 'top' and + and corners. If two orthogonal edges are specified (e.g. 'top' and 'left'), then the anchor point will be the intersection of the edges (e.g. the top left corner of the output); otherwise the anchor point will be centered on that edge, or in the center if none is specified. @@ -127,20 +137,25 @@ - Requests that the compositor avoids occluding an area of the surface - with other surfaces. The compositor's use of this information is + Requests that the compositor avoids occluding an area with other + surfaces. The compositor's use of this information is implementation-dependent - do not assume that this region will not actually be occluded. - A positive value is only meaningful if the surface is anchored to an - edge, rather than a corner. The zone is the number of surface-local - coordinates from the edge that are considered exclusive. + A positive value is only meaningful if the surface is anchored to one + edge or an edge and both perpendicular edges. If the surface is not + anchored, anchored to only two perpendicular edges (a corner), anchored + to only two parallel edges or anchored to all edges, a positive value + will be treated the same as zero. + + A positive zone is the distance from the edge in surface-local + coordinates to consider exclusive. Surfaces that do not wish to have an exclusive zone may instead specify how they should interact with surfaces that do. If set to zero, the surface indicates that it would like to be moved to avoid occluding - surfaces with a positive excluzive zone. If set to -1, the surface - indicates that it would not like to be moved to accomodate for other + surfaces with a positive exclusive zone. If set to -1, the surface + indicates that it would not like to be moved to accommodate for other surfaces, and the compositor should extend it all the way to the edges it is anchored to. @@ -281,5 +296,16 @@ + + + + + + Change the layer that the surface is rendered on. + + Layer is double-buffered, see wl_surface.commit. + + + From 99f3e37ccf6f5e37813b34732c3a1fbcc98ae249 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 5 Aug 2020 23:00:36 +0200 Subject: [PATCH 007/303] chore: update archlinux, debian dockerfiles --- Dockerfiles/archlinux | 2 +- Dockerfiles/debian | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfiles/archlinux b/Dockerfiles/archlinux index d8ae16f..0b618ff 100644 --- a/Dockerfiles/archlinux +++ b/Dockerfiles/archlinux @@ -3,4 +3,4 @@ FROM archlinux/base:latest RUN pacman -Syu --noconfirm && \ - pacman -S git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient --noconfirm + pacman -S git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection --noconfirm diff --git a/Dockerfiles/debian b/Dockerfiles/debian index 077aca8..9f65dbf 100644 --- a/Dockerfiles/debian +++ b/Dockerfiles/debian @@ -3,5 +3,5 @@ FROM debian:sid RUN apt-get update && \ - apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection && \ + apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection apt-get install libgirepository1.0-dev && \ apt-get clean From 2ca20f90505a5fb46ff882b89737eaed7dd2122a Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 5 Aug 2020 23:01:37 +0200 Subject: [PATCH 008/303] chore: remove unwanted typo --- Dockerfiles/debian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/debian b/Dockerfiles/debian index 9f65dbf..cee1744 100644 --- a/Dockerfiles/debian +++ b/Dockerfiles/debian @@ -3,5 +3,5 @@ FROM debian:sid RUN apt-get update && \ - apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection apt-get install libgirepository1.0-dev && \ + apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev && \ apt-get clean From 01c682c41ecb6a415b477745166ef430a344c370 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 5 Aug 2020 23:26:59 +0200 Subject: [PATCH 009/303] chore: v0.9.3 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index dd56c29..56b45be 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project( 'waybar', 'cpp', 'c', - version: '0.9.2', + version: '0.9.3', license: 'MIT', default_options : [ 'cpp_std=c++17', From 6a2d214b55cb1e8517afccb18c3799b22e16a57e Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Wed, 5 Aug 2020 20:31:57 -0400 Subject: [PATCH 010/303] Fix titles containing & and other HTML entities --- src/modules/wlr/taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 23a9166..025e5c1 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -306,7 +306,7 @@ std::string Task::state_string(bool shortened) const void Task::handle_title(const char *title) { - title_ = title; + title_ = Glib::Markup::escape_text(title); } void Task::handle_app_id(const char *app_id) From 4cd31cf3c36db71c04eabf3dad1f12b877991015 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Wed, 5 Aug 2020 20:35:41 -0400 Subject: [PATCH 011/303] Fix wlr/taskbar all-outputs config string --- src/modules/wlr/taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 025e5c1..f7e11df 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -709,7 +709,7 @@ bool Taskbar::show_output(struct wl_output *output) const bool Taskbar::all_outputs() const { - static bool result = config_["all_outputs"].isBool() ? config_["all_outputs"].asBool() : false; + static bool result = config_["all-outputs"].isBool() ? config_["all-outputs"].asBool() : false; return result; } From 9ebfc54eb5cb52acc6b54aeaec86be196388061f Mon Sep 17 00:00:00 2001 From: NotAFile Date: Thu, 6 Aug 2020 16:04:30 +0200 Subject: [PATCH 012/303] switch workspace on mouse-down to match swaybar fixes #686 --- src/modules/sway/workspaces.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index fc6d5eb..7774351 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -249,7 +249,7 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) { auto &&button = pair.first->second; box_.pack_start(button, false, false, 0); button.set_relief(Gtk::RELIEF_NONE); - button.signal_clicked().connect([this, node] { + button.signal_pressed().connect([this, node] { try { if (node["target_output"].isString()) { ipc_.sendCmd( From a446cd692d19acc215aa1fe42a2e24f7507ea2d5 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 6 Aug 2020 21:57:02 +0200 Subject: [PATCH 013/303] Fix MPD, add missing while loop --- src/modules/mpd.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp index 957b3c7..d2877f3 100644 --- a/src/modules/mpd.cpp +++ b/src/modules/mpd.cpp @@ -63,20 +63,22 @@ auto waybar::modules::MPD::update() -> void { std::thread waybar::modules::MPD::event_listener() { return std::thread([this] { - try { - if (connection_ == nullptr) { - // Retry periodically if no connection - dp.emit(); - std::this_thread::sleep_for(interval_); - } else { - waitForEvent(); - dp.emit(); - } - } catch (const std::exception& e) { - if (strcmp(e.what(), "Connection to MPD closed") == 0) { - spdlog::debug("{}: {}", module_name_, e.what()); - } else { - spdlog::warn("{}: {}", module_name_, e.what()); + while (true) { + try { + if (connection_ == nullptr) { + // Retry periodically if no connection + dp.emit(); + std::this_thread::sleep_for(interval_); + } else { + waitForEvent(); + dp.emit(); + } + } catch (const std::exception& e) { + if (strcmp(e.what(), "Connection to MPD closed") == 0) { + spdlog::debug("{}: {}", module_name_, e.what()); + } else { + spdlog::warn("{}: {}", module_name_, e.what()); + } } } }); From d51adfe7bc2e6e653c1075b64f7b1a27c8ca6482 Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Thu, 6 Aug 2020 23:21:53 +0200 Subject: [PATCH 014/303] systemd: use standard targets, update service type --- resources/waybar.service.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/waybar.service.in b/resources/waybar.service.in index 03262a3..2c907e9 100644 --- a/resources/waybar.service.in +++ b/resources/waybar.service.in @@ -1,13 +1,11 @@ [Unit] Description=Highly customizable Wayland bar for Sway and Wlroots based compositors. Documentation=https://github.com/Alexays/Waybar/wiki/ -PartOf=wayland-session.target -After=wayland-session.target +PartOf=graphical-session.target +After=graphical-session.target [Service] -Type=dbus -BusName=fr.arouillard.waybar ExecStart=@prefix@/bin/waybar [Install] -WantedBy=wayland-session.target +WantedBy=graphical-session.target From 50e8f7ca86f871cb4a18828a811bcbde36864473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Sat, 8 Aug 2020 13:17:56 +0200 Subject: [PATCH 015/303] add repo info to README --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f7bc4c8..74f4660 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [AUR](https://aur.archlinux.org/packages/waybar-git/), [openSUSE](https://build.opensuse.org/package/show/X11:Wayland/waybar), and [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=waybar)
> *Waybar [examples](https://github.com/Alexays/Waybar/wiki/Examples)* -**Current features** +#### Current features - Sway (Workspaces, Binding mode, Focused window name) - Tray [#21](https://github.com/Alexays/Waybar/issues/21) - Local time @@ -22,11 +22,21 @@ - Multiple output configuration - And much more customizations -**Configuration and Styling** +#### Configuration and Styling [See the wiki for more details](https://github.com/Alexays/Waybar/wiki). -**How to build** +### Installation + +Waybar is available from a number of Linux distributions: + +[![Packaging status](https://repology.org/badge/vertical-allrepos/waybar.svg)](https://repology.org/project/waybar/versions) + +An Ubuntu PPA with more recent versions is available +[here](https://launchpad.net/~nschloe/+archive/ubuntu/waybar). + + +#### Building from source ```bash $ git clone https://github.com/Alexays/Waybar From 9b41b9593418772ce578a87de5984d4e37ef7f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Mon, 10 Aug 2020 20:53:29 +0200 Subject: [PATCH 016/303] Fix crash with fmt --- include/util/format.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/util/format.hpp b/include/util/format.hpp index 0147701..288d8f0 100644 --- a/include/util/format.hpp +++ b/include/util/format.hpp @@ -23,7 +23,7 @@ namespace fmt { constexpr auto parse(ParseContext& ctx) -> decltype (ctx.begin()) { auto it = ctx.begin(), end = ctx.end(); if (it != end && *it == ':') ++it; - if (*it == '>' || *it == '<' || *it == '=') { + if (it && (*it == '>' || *it == '<' || *it == '=')) { spec = *it; ++it; } From 8f10c9056c901f9a89b03ce4fbe2f8d108cb49d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Wed, 12 Aug 2020 11:38:48 +0100 Subject: [PATCH 017/303] Add option for no workspace switch on click In sway/workspaces, just like disable-scroll turns on/off the ability to change workspaces by scrolling the mouse add disable-click that turns on/off the ability to change workspaces by clicking. --- man/waybar-sway-workspaces.5.scd | 5 +++++ src/modules/sway/workspaces.cpp | 32 +++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/man/waybar-sway-workspaces.5.scd b/man/waybar-sway-workspaces.5.scd index 56b703a..5641182 100644 --- a/man/waybar-sway-workspaces.5.scd +++ b/man/waybar-sway-workspaces.5.scd @@ -31,6 +31,11 @@ Addressed by *sway/workspaces* default: false ++ If set to false, you can scroll to cycle through workspaces. If set to true this behaviour is disabled. +*disable-click*: ++ + typeof: bool ++ + default: false ++ + If set to false, you can click to change workspace. If set to true this behaviour is disabled. + *smooth-scrolling-threshold*: ++ typeof: double ++ Threshold to be used when scrolling. diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 7774351..6775a21 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -249,22 +249,24 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) { auto &&button = pair.first->second; box_.pack_start(button, false, false, 0); button.set_relief(Gtk::RELIEF_NONE); - button.signal_pressed().connect([this, node] { - try { - if (node["target_output"].isString()) { - ipc_.sendCmd( - IPC_COMMAND, - fmt::format(workspace_switch_cmd_ + "; move workspace to output \"{}\"; " + workspace_switch_cmd_, - node["name"].asString(), - node["target_output"].asString(), - node["name"].asString())); - } else { - ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, node["name"].asString())); + if (!config_["disable-click"].asBool()) { + button.signal_pressed().connect([this, node] { + try { + if (node["target_output"].isString()) { + ipc_.sendCmd( + IPC_COMMAND, + fmt::format(workspace_switch_cmd_ + "; move workspace to output \"{}\"; " + workspace_switch_cmd_, + node["name"].asString(), + node["target_output"].asString(), + node["name"].asString())); + } else { + ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, node["name"].asString())); + } + } catch (const std::exception &e) { + spdlog::error("Workspaces: {}", e.what()); } - } catch (const std::exception &e) { - spdlog::error("Workspaces: {}", e.what()); - } - }); + }); + } return button; } From 29fa74f621683720ac8a180c2fdbdd180046477b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Wed, 12 Aug 2020 11:41:00 +0100 Subject: [PATCH 018/303] Add IDs to sway workspace buttons for CSS styling In case you want to style a specific workspace add IDs to the workspace buttons. Styling is done by matching button#sway-workspace-${name}. --- man/waybar-sway-workspaces.5.scd | 1 + src/modules/sway/workspaces.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/man/waybar-sway-workspaces.5.scd b/man/waybar-sway-workspaces.5.scd index 5641182..7147d71 100644 --- a/man/waybar-sway-workspaces.5.scd +++ b/man/waybar-sway-workspaces.5.scd @@ -139,3 +139,4 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge - *#workspaces button.urgent* - *#workspaces button.persistent* - *#workspaces button.current_output* +- *#workspaces button#sway-workspace-${name} diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 6775a21..17a0be2 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -248,6 +248,7 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) { auto pair = buttons_.emplace(node["name"].asString(), node["name"].asString()); auto &&button = pair.first->second; box_.pack_start(button, false, false, 0); + button.set_name("sway-workspace-" + node["name"].asString()); button.set_relief(Gtk::RELIEF_NONE); if (!config_["disable-click"].asBool()) { button.signal_pressed().connect([this, node] { From 0aa8c03beaaed42fccb11b55ae09adcf5641229b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Thu, 13 Aug 2020 20:11:55 +0100 Subject: [PATCH 019/303] Add missing * in man page --- man/waybar-sway-workspaces.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/waybar-sway-workspaces.5.scd b/man/waybar-sway-workspaces.5.scd index 7147d71..5e51689 100644 --- a/man/waybar-sway-workspaces.5.scd +++ b/man/waybar-sway-workspaces.5.scd @@ -139,4 +139,4 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge - *#workspaces button.urgent* - *#workspaces button.persistent* - *#workspaces button.current_output* -- *#workspaces button#sway-workspace-${name} +- *#workspaces button#sway-workspace-${name}* From 8cd6e1330894c6371e49a61ca0f76f72d016dd88 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Wed, 5 Aug 2020 20:31:36 -0400 Subject: [PATCH 020/303] clock: allow custom formatting for today in calendar --- man/waybar-clock.5.scd | 5 +++++ src/modules/clock.cpp | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/man/waybar-clock.5.scd b/man/waybar-clock.5.scd index 3610f19..79555bc 100644 --- a/man/waybar-clock.5.scd +++ b/man/waybar-clock.5.scd @@ -31,6 +31,11 @@ The *clock* module displays the current date and time. default: inferred from current locale ++ A locale to be used to display the time. Intended to render times in custom timezones with the proper language and format. +*today-format*: ++ + typeof: string ++ + default: {} ++ + The format of today's date in the calendar. + *max-length*: ++ typeof: integer ++ The maximum length in character the module should display. diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index f41126b..cfdeda2 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -99,7 +99,12 @@ auto waybar::modules::Clock::calendar_text(const waybar_time& wtime) -> std::str os << '\n'; } if (d == curr_day) { - os << "" << date::format("%e", d) << ""; + if (config_["today-format"].isString()) { + auto today_format = config_["today-format"].asString(); + os << fmt::format(today_format, date::format("%e", d)); + } else { + os << "" << date::format("%e", d) << ""; + } } else { os << date::format("%e", d); } From 62082bdb0121ea738f9b8723221572899c19a872 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Wed, 12 Aug 2020 22:46:51 -0400 Subject: [PATCH 021/303] clock: scroll through multiple timezones --- include/ALabel.hpp | 2 +- include/modules/clock.hpp | 3 +++ man/waybar-clock.5.scd | 5 +++++ src/ALabel.cpp | 5 +++-- src/modules/clock.cpp | 36 +++++++++++++++++++++++++++++++++++- 5 files changed, 47 insertions(+), 4 deletions(-) diff --git a/include/ALabel.hpp b/include/ALabel.hpp index d4ad94d..6848d67 100644 --- a/include/ALabel.hpp +++ b/include/ALabel.hpp @@ -10,7 +10,7 @@ namespace waybar { class ALabel : public AModule { public: ALabel(const Json::Value &, const std::string &, const std::string &, const std::string &format, - uint16_t interval = 0, bool ellipsize = false); + uint16_t interval = 0, bool ellipsize = false, bool enable_click = false, bool enable_scroll = false); virtual ~ALabel() = default; virtual auto update() -> void; virtual std::string getIcon(uint16_t, const std::string &alt = "", uint16_t max = 0); diff --git a/include/modules/clock.hpp b/include/modules/clock.hpp index e3873a6..643b736 100644 --- a/include/modules/clock.hpp +++ b/include/modules/clock.hpp @@ -28,9 +28,12 @@ class Clock : public ALabel { std::locale locale_; const date::time_zone* time_zone_; bool fixed_time_zone_; + int time_zone_idx_; date::year_month_day cached_calendar_ymd_; std::string cached_calendar_text_; + bool handleScroll(GdkEventScroll* e); + auto calendar_text(const waybar_time& wtime) -> std::string; auto weekdays_header(const date::weekday& first_dow, std::ostream& os) -> void; auto first_day_of_week() -> date::weekday; diff --git a/man/waybar-clock.5.scd b/man/waybar-clock.5.scd index 79555bc..9f36c43 100644 --- a/man/waybar-clock.5.scd +++ b/man/waybar-clock.5.scd @@ -26,6 +26,11 @@ The *clock* module displays the current date and time. default: inferred local timezone ++ The timezone to display the time in, e.g. America/New_York. +*timezones*: ++ + typeof: list of strings ++ + A list of timezones to use for time display, changed using the scroll wheel. ++ + Use "" to represent the system's local timezone. Using %Z in the format or tooltip format is useful to track which time zone is currently displayed. + *locale*: ++ typeof: string ++ default: inferred from current locale ++ diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 68313e0..00fa2f7 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -5,8 +5,9 @@ namespace waybar { ALabel::ALabel(const Json::Value& config, const std::string& name, const std::string& id, - const std::string& format, uint16_t interval, bool ellipsize) - : AModule(config, name, id, config["format-alt"].isString()), + const std::string& format, uint16_t interval, bool ellipsize, bool enable_click, + bool enable_scroll) + : AModule(config, name, id, config["format-alt"].isString() || enable_click, enable_scroll), format_(config_["format"].isString() ? config_["format"].asString() : format), interval_(config_["interval"] == "once" ? std::chrono::seconds(100000000) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index cfdeda2..f313606 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -13,7 +13,7 @@ using waybar::modules::waybar_time; waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config) - : ALabel(config, "clock", id, "{:%H:%M}", 60), fixed_time_zone_(false) { + : ALabel(config, "clock", id, "{:%H:%M}", 60, false, false, true), fixed_time_zone_(false) { if (config_["timezone"].isString()) { spdlog::warn("As using a timezone, some format args may be missing as the date library havn't got a release since 2018."); time_zone_ = date::locate_zone(config_["timezone"].asString()); @@ -71,6 +71,40 @@ auto waybar::modules::Clock::update() -> void { ALabel::update(); } +bool waybar::modules::Clock::handleScroll(GdkEventScroll *e) { + // defer to user commands if set + if (config_["on-scroll-up"].isString() || config_["on-scroll-down"].isString()) { + return AModule::handleScroll(e); + } + + auto dir = AModule::getScrollDir(e); + if (dir != SCROLL_DIR::UP && dir != SCROLL_DIR::DOWN) { + return true; + } + if (!config_["timezones"].isArray() || config_["timezones"].empty()) { + return true; + } + auto nr_zones = config_["timezones"].size(); + int new_idx = time_zone_idx_ + ((dir == SCROLL_DIR::UP) ? 1 : -1); + if (new_idx < 0) { + time_zone_idx_ = nr_zones - 1; + } else if (new_idx >= nr_zones) { + time_zone_idx_ = 0; + } else { + time_zone_idx_ = new_idx; + } + auto zone_name = config_["timezones"][time_zone_idx_]; + if (!zone_name.isString() || zone_name.empty()) { + fixed_time_zone_ = false; + } else { + time_zone_ = date::locate_zone(zone_name.asString()); + fixed_time_zone_ = true; + } + + update(); + return true; +} + auto waybar::modules::Clock::calendar_text(const waybar_time& wtime) -> std::string { const auto daypoint = date::floor(wtime.ztime.get_local_time()); const auto ymd = date::year_month_day(daypoint); From fdfb60c633681908e81337ce793350588add2478 Mon Sep 17 00:00:00 2001 From: wjoe Date: Fri, 14 Aug 2020 20:56:45 +0200 Subject: [PATCH 022/303] meson feature: make rfkill optional --- meson.build | 12 ++++++++++-- meson_options.txt | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 56b45be..16da957 100644 --- a/meson.build +++ b/meson.build @@ -137,12 +137,10 @@ if is_linux add_project_arguments('-DHAVE_MEMORY_LINUX', language: 'cpp') src_files += files( 'src/modules/battery.cpp', - 'src/modules/bluetooth.cpp', 'src/modules/cpu/common.cpp', 'src/modules/cpu/linux.cpp', 'src/modules/memory/common.cpp', 'src/modules/memory/linux.cpp', - 'src/util/rfkill.cpp' ) elif is_dragonfly or is_freebsd or is_netbsd or is_openbsd add_project_arguments('-DHAVE_CPU_BSD', language: 'cpp') @@ -207,6 +205,16 @@ if gtk_layer_shell.found() add_project_arguments('-DHAVE_GTK_LAYER_SHELL', language: 'cpp') endif +if get_option('rfkill').enabled() + if is_linux + add_project_arguments('-DWANT_RFKILL', language: 'cpp') + src_files += files( + 'src/modules/bluetooth.cpp', + 'src/util/rfkill.cpp' + ) + endif +endif + subdir('protocol') executable( diff --git a/meson_options.txt b/meson_options.txt index a44ff64..de47da7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,3 +7,4 @@ option('dbusmenu-gtk', type: 'feature', value: 'auto', description: 'Enable supp option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('mpd', type: 'feature', value: 'auto', description: 'Enable support for the Music Player Daemon') option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk-layer-shell library for popups support') +option('rfkill', type: 'feature', value: 'auto', description: 'Enable support for RFKILL') From 4565f7f8b9ade0e43057cbd47b3f14b218fd589e Mon Sep 17 00:00:00 2001 From: wjoe Date: Fri, 14 Aug 2020 20:58:48 +0200 Subject: [PATCH 023/303] only compile rfkill into the network module if the feature is enabled. --- include/modules/network.hpp | 4 ++++ src/modules/network.cpp | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/modules/network.hpp b/include/modules/network.hpp index a0156fb..4441dc0 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -11,7 +11,9 @@ #include #include "ALabel.hpp" #include "util/sleeper_thread.hpp" +#ifdef WANT_RFKILL #include "util/rfkill.hpp" +#endif namespace waybar::modules { @@ -70,9 +72,11 @@ class Network : public ALabel { util::SleeperThread thread_; util::SleeperThread thread_timer_; +#ifdef WANT_RFKILL util::SleeperThread thread_rfkill_; util::Rfkill rfkill_; +#endif }; } // namespace waybar::modules diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 2c0562f..4e96cef 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -4,7 +4,9 @@ #include #include #include "util/format.hpp" +#ifdef WANT_RFKILL #include "util/rfkill.hpp" +#endif namespace { @@ -84,8 +86,10 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf cidr_(-1), signal_strength_dbm_(0), signal_strength_(0), - frequency_(0), - rfkill_{RFKILL_TYPE_WLAN} { +#ifdef WANT_RFKILL + rfkill_{RFKILL_TYPE_WLAN}, +#endif + frequency_(0) { auto down_octets = read_netstat(BANDWIDTH_CATEGORY, BANDWIDTH_DOWN_TOTAL_KEY); auto up_octets = read_netstat(BANDWIDTH_CATEGORY, BANDWIDTH_UP_TOTAL_KEY); if (down_octets) { @@ -174,6 +178,7 @@ void waybar::modules::Network::worker() { } thread_timer_.sleep_for(interval_); }; +#ifdef WANT_RFKILL thread_rfkill_ = [this] { rfkill_.waitForEvent(); { @@ -184,14 +189,19 @@ void waybar::modules::Network::worker() { } } }; +#else + spdlog::warn("Waybar has been built without rfkill support."); +#endif } const std::string waybar::modules::Network::getNetworkState() const { +#ifdef WANT_RFKILL if (ifid_ == -1) { if (rfkill_.getState()) return "disabled"; return "disconnected"; } +#endif if (ipaddr_.empty()) return "linked"; if (essid_.empty()) return "ethernet"; return "wifi"; From 4d775008df1cabaa6a9cfd56dfb75fa5d83d54b1 Mon Sep 17 00:00:00 2001 From: wjoe Date: Fri, 14 Aug 2020 20:59:30 +0200 Subject: [PATCH 024/303] only return a bluetooth module from factory if the rfkill feature is enabled. --- include/factory.hpp | 4 +++- src/factory.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/factory.hpp b/include/factory.hpp index fcbf3a2..ebc2359 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -43,7 +43,9 @@ #include "modules/custom.hpp" #include "modules/temperature.hpp" #if defined(__linux__) -#include "modules/bluetooth.hpp" +# ifdef WANT_RFKILL +# include "modules/bluetooth.hpp" +# endif #endif namespace waybar { diff --git a/src/factory.cpp b/src/factory.cpp index 5a01d52..af93b20 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -81,9 +81,11 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { return new waybar::modules::Temperature(id, config_[name]); } #if defined(__linux__) +# ifdef WANT_RFKILL if (ref == "bluetooth") { return new waybar::modules::Bluetooth(id, config_[name]); } +# endif #endif if (ref.compare(0, 7, "custom/") == 0 && ref.size() > 7) { return new waybar::modules::Custom(ref.substr(7), id, config_[name]); From 3663b9193dc6e3100fa02c472e5b068e988a8f81 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 9 Aug 2020 18:58:01 -0700 Subject: [PATCH 025/303] refactor(bar): separate GTK event handlers for gtk-layer-shell Cleanly separate resizing logic for gtk-layer-shell and manually managed layer surface code. --- include/bar.hpp | 7 ++- src/bar.cpp | 127 +++++++++++++++++++++++++++++++----------------- 2 files changed, 89 insertions(+), 45 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 63f0e22..fdc5a73 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -53,13 +53,18 @@ class Bar { static void layerSurfaceHandleClosed(void *, struct zwlr_layer_surface_v1 *); #ifdef HAVE_GTK_LAYER_SHELL + /* gtk-layer-shell code */ void initGtkLayerShell(); + void onConfigureGLS(GdkEventConfigure *ev); + void onMapGLS(GdkEventAny *ev); #endif + /* fallback layer-surface code */ void onConfigure(GdkEventConfigure *ev); void onRealize(); void onMap(GdkEventAny *ev); - void setExclusiveZone(uint32_t width, uint32_t height); void setSurfaceSize(uint32_t width, uint32_t height); + /* common code */ + void setExclusiveZone(uint32_t width, uint32_t height); auto setupWidgets() -> void; void getModules(const Factory &, const std::string &); void setupAltFormatKeyForModule(const std::string &module_name); diff --git a/src/bar.cpp b/src/bar.cpp index 3bbc2a3..45e3420 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -101,56 +101,25 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) use_gls_ = config["gtk-layer-shell"].isBool() ? config["gtk-layer-shell"].asBool() : true; if (use_gls_) { initGtkLayerShell(); + window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMapGLS)); + window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Bar::onConfigureGLS)); } #endif - window.signal_realize().connect_notify(sigc::mem_fun(*this, &Bar::onRealize)); - window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMap)); - window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Bar::onConfigure)); + if (!use_gls_) { + window.signal_realize().connect_notify(sigc::mem_fun(*this, &Bar::onRealize)); + window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMap)); + window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Bar::onConfigure)); + } window.set_size_request(width_, height_); setupWidgets(); - if (window.get_realized()) { + if (!use_gls_ && window.get_realized()) { onRealize(); } window.show_all(); } -void waybar::Bar::onConfigure(GdkEventConfigure* ev) { - auto tmp_height = height_; - auto tmp_width = width_; - if (ev->height > static_cast(height_)) { - // Default minimal value - if (height_ > 1) { - spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); - } - if (config["height"].isUInt()) { - spdlog::info(SIZE_DEFINED, "Height"); - } else { - tmp_height = ev->height; - } - } - if (ev->width > static_cast(width_)) { - // Default minimal value - if (width_ > 1) { - spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); - } - if (config["width"].isUInt()) { - spdlog::info(SIZE_DEFINED, "Width"); - } else { - tmp_width = ev->width; - } - } - if (use_gls_) { - width_ = tmp_width; - height_ = tmp_height; - spdlog::debug("Set surface size {}x{} for output {}", width_, height_, output->name); - setExclusiveZone(tmp_width, tmp_height); - } else if (tmp_width != width_ || tmp_height != height_) { - setSurfaceSize(tmp_width, tmp_height); - } -} - #ifdef HAVE_GTK_LAYER_SHELL void waybar::Bar::initGtkLayerShell() { auto gtk_window = window.gobj(); @@ -181,8 +150,80 @@ void waybar::Bar::initGtkLayerShell() { setExclusiveZone(width_, height_); } } + +void waybar::Bar::onConfigureGLS(GdkEventConfigure* ev) { + /* + * GTK wants new size for the window. + * Actual resizing is done within the gtk-layer-shell code; the only remaining action is to apply + * exclusive zone. + * gtk_layer_auto_exclusive_zone_enable() could handle even that, but at the cost of ignoring + * margins on unanchored edge. + * + * Note: forced resizing to a window smaller than required by GTK would not work with + * gtk-layer-shell. + */ + if (vertical) { + if (width_ > 1 && ev->width > static_cast(width_)) { + spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); + } + } else { + if (!vertical && height_ > 1 && ev->height > static_cast(height_)) { + spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); + } + } + width_ = ev->width; + height_ = ev->height; + spdlog::info(BAR_SIZE_MSG, width_, height_, output->name); + setExclusiveZone(width_, height_); +} + +void waybar::Bar::onMapGLS(GdkEventAny* ev) { + /* + * Obtain a pointer to the custom layer surface for modules that require it (idle_inhibitor). + */ + auto gdk_window = window.get_window(); + surface = gdk_wayland_window_get_wl_surface(gdk_window->gobj()); +} + #endif +void waybar::Bar::onConfigure(GdkEventConfigure* ev) { + /* + * GTK wants new size for the window. + * + * Prefer configured size if it's non-default. + * If the size is not set and the window is smaller than requested by GTK, request resize from + * layer surface. + */ + auto tmp_height = height_; + auto tmp_width = width_; + if (ev->height > static_cast(height_)) { + // Default minimal value + if (height_ > 1) { + spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); + } + if (config["height"].isUInt()) { + spdlog::info(SIZE_DEFINED, "Height"); + } else { + tmp_height = ev->height; + } + } + if (ev->width > static_cast(width_)) { + // Default minimal value + if (width_ > 1) { + spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); + } + if (config["width"].isUInt()) { + spdlog::info(SIZE_DEFINED, "Width"); + } else { + tmp_width = ev->width; + } + } + if (tmp_width != width_ || tmp_height != height_) { + setSurfaceSize(tmp_width, tmp_height); + } +} + void waybar::Bar::onRealize() { auto gdk_window = window.get_window()->gobj(); gdk_wayland_window_set_use_custom_surface(gdk_window); @@ -192,10 +233,6 @@ void waybar::Bar::onMap(GdkEventAny* ev) { auto gdk_window = window.get_window()->gobj(); surface = gdk_wayland_window_get_wl_surface(gdk_window); - if (use_gls_) { - return; - } - auto client = waybar::Client::inst(); // owned by output->monitor; no need to destroy auto wl_output = gdk_wayland_monitor_get_wl_output(output->monitor->gobj()); @@ -362,7 +399,9 @@ auto waybar::Bar::toggle() -> void { window.set_opacity(1); } setExclusiveZone(width_, height_); - wl_surface_commit(surface); + if (!use_gls_) { + wl_surface_commit(surface); + } } void waybar::Bar::getModules(const Factory& factory, const std::string& pos) { From f4e15dd93d589ed4efb10bad5035476ca623f5cb Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 14 Aug 2020 23:53:44 -0700 Subject: [PATCH 026/303] chore(subprojects): update gtk-layer-shell to 0.3.0 Fixes warning about xdg_wm_base.version mismatch. Fixes potential crash when GTK does not expect wl_surface to be committed. --- subprojects/gtk-layer-shell.wrap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gtk-layer-shell.wrap b/subprojects/gtk-layer-shell.wrap index 9db9df5..6fe68c3 100644 --- a/subprojects/gtk-layer-shell.wrap +++ b/subprojects/gtk-layer-shell.wrap @@ -1,5 +1,5 @@ [wrap-file] -directory = gtk-layer-shell-0.2.0 -source_filename = gtk-layer-shell-0.2.0.tar.gz -source_hash = 6934376b5296d079fca2c1ba6b222ec91db6bf3667142340ee2bdebfb4b69116 -source_url = https://github.com/wmww/gtk-layer-shell/archive/v0.2.0/gtk-layer-shell-0.2.0.tar.gz +directory = gtk-layer-shell-0.3.0 +source_filename = gtk-layer-shell-0.3.0.tar.gz +source_hash = edd5e31279d494df66da9e9190c219fa295da547f5538207685e98468dbc134d +source_url = https://github.com/wmww/gtk-layer-shell/archive/v0.3.0/gtk-layer-shell-0.3.0.tar.gz From 033f0b01b7d7aefd8867320e569344de5713f57f Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 15 Aug 2020 10:36:15 +0200 Subject: [PATCH 027/303] Fix rfkill condition --- src/modules/network.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 4e96cef..ab9b2e5 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -195,13 +195,13 @@ void waybar::modules::Network::worker() { } const std::string waybar::modules::Network::getNetworkState() const { -#ifdef WANT_RFKILL if (ifid_ == -1) { +#ifdef WANT_RFKILL if (rfkill_.getState()) return "disabled"; +#endif return "disconnected"; } -#endif if (ipaddr_.empty()) return "linked"; if (essid_.empty()) return "ethernet"; return "wifi"; From b54fb247456e3e4980891a8c9e6e545d5f808597 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 16 Aug 2020 15:54:21 +0300 Subject: [PATCH 028/303] Remove trim usage in format Some clang-tidy fixes --- include/modules/wlr/taskbar.hpp | 2 +- src/modules/wlr/taskbar.cpp | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/modules/wlr/taskbar.hpp b/include/modules/wlr/taskbar.hpp index 53a2f8c..7085d79 100644 --- a/include/modules/wlr/taskbar.hpp +++ b/include/modules/wlr/taskbar.hpp @@ -70,7 +70,7 @@ class Task std::string title_; std::string app_id_; - uint32_t state_; + uint32_t state_ = 0; private: std::string repr() const; diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 23a9166..5c0dcb3 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -49,8 +49,8 @@ static std::vector search_prefix() auto xdg_data_dirs = std::getenv("XDG_DATA_DIRS"); if (!xdg_data_dirs) { - prefixes.push_back("/usr/share/"); - prefixes.push_back("/usr/local/share/"); + prefixes.emplace_back("/usr/share/"); + prefixes.emplace_back("/usr/local/share/"); } else { std::string xdg_data_dirs_str(xdg_data_dirs); size_t start = 0, end = 0; @@ -102,7 +102,7 @@ static std::string get_from_desktop_app_info(const std::string &app_id) } /* Method 2 - use the app_id and check whether there is an icon with this name in the icon theme */ -static std::string get_from_icon_theme(Glib::RefPtr icon_theme, +static std::string get_from_icon_theme(const Glib::RefPtr& icon_theme, const std::string &app_id) { if (icon_theme->lookup_icon(app_id, 24)) @@ -111,7 +111,7 @@ static std::string get_from_icon_theme(Glib::RefPtr icon_theme, return ""; } -static bool image_load_icon(Gtk::Image& image, Glib::RefPtr icon_theme, +static bool image_load_icon(Gtk::Image& image, const Glib::RefPtr& icon_theme, const std::string &app_id_list, int size) { std::string app_id; @@ -231,13 +231,13 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar, auto icon_pos = format.find("{icon}"); if (icon_pos == 0) { with_icon_ = true; - format_after_ = trim(format.substr(6)); + format_after_ = format.substr(6); } else if (icon_pos == std::string::npos) { format_before_ = format; } else { with_icon_ = true; - format_before_ = trim(format.substr(0, icon_pos)); - format_after_ = trim(format.substr(icon_pos + 6)); + format_before_ = format.substr(0, icon_pos); + format_after_ = format.substr(icon_pos + 6); } } else { /* The default is to only show the icon */ @@ -360,7 +360,7 @@ void Task::handle_output_leave(struct wl_output *output) void Task::handle_state(struct wl_array *state) { state_ = 0; - for (uint32_t* entry = static_cast(state->data); + for (auto* entry = static_cast(state->data); entry < static_cast(state->data) + state->size; entry++) { if (*entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MAXIMIZED) @@ -709,9 +709,7 @@ bool Taskbar::show_output(struct wl_output *output) const bool Taskbar::all_outputs() const { - static bool result = config_["all_outputs"].isBool() ? config_["all_outputs"].asBool() : false; - - return result; + return config_["all_outputs"].isBool() && config_["all_outputs"].asBool(); } std::vector> Taskbar::icon_themes() const From d263607b27af6b5ca2c0cb59a0de319c7e2009af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20=C4=8Cernoch?= Date: Tue, 18 Aug 2020 23:09:35 +0200 Subject: [PATCH 029/303] network: fix typo - update tooltip only when it changes --- src/modules/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index ab9b2e5..3914120 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -287,7 +287,7 @@ auto waybar::modules::Network::update() -> void { fmt::arg("bandwidthUpBits", pow_format(bandwidth_up * 8ull / interval_.count(), "b/s")), fmt::arg("bandwidthDownOctets", pow_format(bandwidth_down / interval_.count(), "o/s")), fmt::arg("bandwidthUpOctets", pow_format(bandwidth_up / interval_.count(), "o/s"))); - if (label_.get_tooltip_text() != text) { + if (label_.get_tooltip_text() != tooltip_text) { label_.set_tooltip_text(tooltip_text); } } else if (label_.get_tooltip_text() != text) { From 8fb54f47ea5052448757abb35e4cf7c001b97343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20=C4=8Cernoch?= Date: Wed, 19 Aug 2020 23:11:16 +0200 Subject: [PATCH 030/303] battery: allow custom tooltip format --- src/modules/battery.cpp | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index beb0554..999e24e 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -169,22 +169,37 @@ auto waybar::modules::Battery::update() -> void { if (status == "Unknown") { status = getAdapterStatus(capacity); } - if (tooltipEnabled()) { - std::string tooltip_text; - if (time_remaining != 0) { - std::string time_to = std::string("Time to ") + ((time_remaining > 0) ? "empty" : "full"); - tooltip_text = time_to + ": " + formatTimeRemaining(time_remaining); - } else { - tooltip_text = status; - } - label_.set_tooltip_text(tooltip_text); - } + auto status_pretty = status; // Transform to lowercase and replace space with dash std::transform(status.begin(), status.end(), status.begin(), [](char ch) { return ch == ' ' ? '-' : std::tolower(ch); }); auto format = format_; auto state = getState(capacity, true); + auto time_remaining_formatted = formatTimeRemaining(time_remaining); + if (tooltipEnabled()) { + std::string tooltip_text_default; + std::string tooltip_format = "{autoTooltip}"; + if (time_remaining != 0) { + std::string time_to = std::string("Time to ") + ((time_remaining > 0) ? "empty" : "full"); + tooltip_text_default = time_to + ": " + time_remaining_formatted; + } else { + tooltip_text_default = status_pretty; + } + if (!state.empty() && config_["tooltip-format-" + status + "-" + state].isString()) { + tooltip_format = config_["tooltip-format-" + status + "-" + state].asString(); + } else if (config_["tooltip-format-" + status].isString()) { + tooltip_format = config_["tooltip-format-" + status].asString(); + } else if (!state.empty() && config_["tooltip-format-" + state].isString()) { + tooltip_format = config_["tooltip-format-" + state].asString(); + } else if (config_["tooltip-format"].isString()) { + tooltip_format = config_["tooltip-format"].asString(); + } + label_.set_tooltip_text(fmt::format(tooltip_format, + fmt::arg("autoTooltip", tooltip_text_default), + fmt::arg("capacity", capacity), + fmt::arg("time", time_remaining_formatted))); + } if (!old_status_.empty()) { label_.get_style_context()->remove_class(old_status_); } @@ -205,7 +220,7 @@ auto waybar::modules::Battery::update() -> void { label_.set_markup(fmt::format(format, fmt::arg("capacity", capacity), fmt::arg("icon", getIcon(capacity, icons)), - fmt::arg("time", formatTimeRemaining(time_remaining)))); + fmt::arg("time", time_remaining_formatted))); } // Call parent update ALabel::update(); From 6f7d7e645aeeadb2c081dc00bf9ecaaebdf2991c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Wed, 19 Aug 2020 22:11:11 +0100 Subject: [PATCH 031/303] Prevent line breaks in ellipsized labels If a label is being ellipsized it doesn't make sense to allow it to use line breaks to have multiple lines. Fixes #827 --- src/ALabel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 00fa2f7..3a4063d 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -22,8 +22,10 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st if (config_["max-length"].isUInt()) { label_.set_max_width_chars(config_["max-length"].asUInt()); label_.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END); + label_.set_single_line_mode(true); } else if (ellipsize && label_.get_max_width_chars() == -1) { label_.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END); + label_.set_single_line_mode(true); } if (config_["rotate"].isUInt()) { From ea722615c46d07f5859d2c6a78caebf1f069bc2e Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Mon, 10 Aug 2020 19:23:16 -0400 Subject: [PATCH 032/303] Allow enabing pango markup in the taskbar string The fix for taskbar tooltips in 6a2d214b55 was incomplete: it causes the label to contain escaped titles. Use set_markup so that GTK decodes markup again, but only if requested by the user (disabling markup is needed if using format strings like "{title:.15}" to avoid terminating the string in the middle of an XML entity). --- man/waybar-wlr-taskbar.5.scd | 5 ++++ src/modules/wlr/taskbar.cpp | 51 ++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/man/waybar-wlr-taskbar.5.scd b/man/waybar-wlr-taskbar.5.scd index f044412..55d2afd 100644 --- a/man/waybar-wlr-taskbar.5.scd +++ b/man/waybar-wlr-taskbar.5.scd @@ -32,6 +32,11 @@ Addressed by *wlr/taskbar* default: 16 ++ The size of the icon. +*markup*: ++ + typeof: bool ++ + default: false ++ + If set to true, pango markup will be accepted in format and tooltip-format. + *tooltip*: ++ typeof: bool ++ default: true ++ diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index f7e11df..57c88fe 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -306,7 +306,7 @@ std::string Task::state_string(bool shortened) const void Task::handle_title(const char *title) { - title_ = Glib::Markup::escape_text(title); + title_ = title; } void Task::handle_app_id(const char *app_id) @@ -460,38 +460,51 @@ bool Task::operator!=(const Task &o) const void Task::update() { + bool markup = config_["markup"].isBool() ? config_["markup"].asBool() : false; + std::string title = title_; + std::string app_id = app_id_; + if (markup) { + title = Glib::Markup::escape_text(title); + app_id = Glib::Markup::escape_text(app_id); + } if (!format_before_.empty()) { - text_before_.set_label( - fmt::format(format_before_, - fmt::arg("title", title_), - fmt::arg("app_id", app_id_), + auto txt = fmt::format(format_before_, + fmt::arg("title", title), + fmt::arg("app_id", app_id), fmt::arg("state", state_string()), fmt::arg("short_state", state_string(true)) - ) - ); + ); + if (markup) + text_before_.set_markup(txt); + else + text_before_.set_label(txt); text_before_.show(); } if (!format_after_.empty()) { - text_after_.set_label( - fmt::format(format_after_, - fmt::arg("title", title_), - fmt::arg("app_id", app_id_), + auto txt = fmt::format(format_after_, + fmt::arg("title", title), + fmt::arg("app_id", app_id), fmt::arg("state", state_string()), fmt::arg("short_state", state_string(true)) - ) - ); + ); + if (markup) + text_after_.set_markup(txt); + else + text_after_.set_label(txt); text_after_.show(); } if (!format_tooltip_.empty()) { - button_.set_tooltip_markup( - fmt::format(format_tooltip_, - fmt::arg("title", title_), - fmt::arg("app_id", app_id_), + auto txt = fmt::format(format_tooltip_, + fmt::arg("title", title), + fmt::arg("app_id", app_id), fmt::arg("state", state_string()), fmt::arg("short_state", state_string(true)) - ) - ); + ); + if (markup) + button_.set_tooltip_markup(txt); + else + button_.set_tooltip_text(txt); } } From ba78199dd1a8bc7e240ea560e70d6626500eadf1 Mon Sep 17 00:00:00 2001 From: Tamir Zahavi-Brunner Date: Fri, 28 Aug 2020 01:16:41 +0300 Subject: [PATCH 033/303] custom: Fix "restart-interval" This commit fixes the issue where the process would restart immediately and the thread would sleep after the process has restarted, and not before. Fixes #621 --- src/modules/custom.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 5643160..5ee9bb5 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -50,7 +50,6 @@ void waybar::modules::Custom::continuousWorker() { thread_ = [this, cmd] { char* buff = nullptr; size_t len = 0; - bool restart = false; if (getline(&buff, &len, fp_) == -1) { int exit_code = 1; if (fp_) { @@ -63,8 +62,8 @@ void waybar::modules::Custom::continuousWorker() { spdlog::error("{} stopped unexpectedly, is it endless?", name_); } if (config_["restart-interval"].isUInt()) { - restart = true; pid_ = -1; + thread_.sleep_for(std::chrono::seconds(config_["restart-interval"].asUInt())); fp_ = util::command::open(cmd, pid_); if (!fp_) { throw std::runtime_error("Unable to open " + cmd); @@ -83,9 +82,6 @@ void waybar::modules::Custom::continuousWorker() { output_ = {0, output}; dp.emit(); } - if (restart) { - thread_.sleep_for(std::chrono::seconds(config_["restart-interval"].asUInt())); - } }; } From 943b6bc51bbe16c8db72a7b16cabd1aa95c1b853 Mon Sep 17 00:00:00 2001 From: Renee D'Netto Date: Thu, 27 Aug 2020 22:07:19 +1000 Subject: [PATCH 034/303] Implement support for reloading of config files. Fixes #759. --- include/client.hpp | 1 + src/client.cpp | 9 ++++----- src/main.cpp | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index 39b6ae3..37281a2 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -14,6 +14,7 @@ class Client { public: static Client *inst(); int main(int argc, char *argv[]); + void reset(); Glib::RefPtr gtk_app; Glib::RefPtr gdk_display; diff --git a/src/client.cpp b/src/client.cpp index 316e7ec..042f61d 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -269,10 +269,9 @@ int waybar::Client::main(int argc, char *argv[]) { gtk_app->hold(); gtk_app->run(); bars.clear(); - zxdg_output_manager_v1_destroy(xdg_output_manager); - zwlr_layer_shell_v1_destroy(layer_shell); - zwp_idle_inhibit_manager_v1_destroy(idle_inhibit_manager); - wl_registry_destroy(registry); - wl_display_disconnect(wl_display); return 0; } + +void waybar::Client::reset() { + gtk_app->quit(); +} diff --git a/src/main.cpp b/src/main.cpp index 19a8de1..13a2567 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,7 @@ std::mutex reap_mtx; std::list reap; +volatile bool reload; void* signalThread(void* args) { int err, signum; @@ -70,12 +71,19 @@ void startSignalThread(void) { int main(int argc, char* argv[]) { try { auto client = waybar::Client::inst(); + std::signal(SIGUSR1, [](int /*signal*/) { for (auto& bar : waybar::Client::inst()->bars) { bar->toggle(); } }); + std::signal(SIGUSR2, [](int /*signal*/) { + spdlog::info("Reloading..."); + reload = true; + waybar::Client::inst()->reset(); + }); + for (int sig = SIGRTMIN + 1; sig <= SIGRTMAX; ++sig) { std::signal(sig, [](int sig) { for (auto& bar : waybar::Client::inst()->bars) { @@ -85,7 +93,12 @@ int main(int argc, char* argv[]) { } startSignalThread(); - auto ret = client->main(argc, argv); + auto ret = 0; + do { + reload = false; + ret = client->main(argc, argv); + } while (reload); + delete client; return ret; } catch (const std::exception& e) { From 1b22e2b3200de7fdb94e52e33f3e8846587c98db Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Sat, 29 Aug 2020 22:56:26 -0700 Subject: [PATCH 035/303] style(workspaces): align text with other modules Currently, the bottom border on workspace buttons eats into the box size and causes the text to sit higher than in other modules. This is ugly when there are other modules (like the window title) right next to the workspace module. To fix the issue, create the bottom border using an inset box-shadow, which doesn't affect the box's content sizing. --- resources/style.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/style.css b/resources/style.css index e21ae00..c454bff 100644 --- a/resources/style.css +++ b/resources/style.css @@ -41,19 +41,19 @@ window#waybar.chromium { padding: 0 5px; background-color: transparent; color: #ffffff; - border-bottom: 3px solid transparent; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; } /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ #workspaces button:hover { background: rgba(0, 0, 0, 0.2); - box-shadow: inherit; - border-bottom: 3px solid #ffffff; + box-shadow: inset 0 -3px #ffffff; } #workspaces button.focused { background-color: #64727D; - border-bottom: 3px solid #ffffff; + box-shadow: inset 0 -3px #ffffff; } #workspaces button.urgent { From 225a0eccddd777c474d5efb720611dd5589df914 Mon Sep 17 00:00:00 2001 From: MusiKid Date: Wed, 2 Sep 2020 14:25:57 +0200 Subject: [PATCH 036/303] Add support for memory tooltip --- src/modules/memory/common.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/memory/common.cpp b/src/modules/memory/common.cpp index 4875ec8..a332d58 100644 --- a/src/modules/memory/common.cpp +++ b/src/modules/memory/common.cpp @@ -36,7 +36,17 @@ auto waybar::modules::Memory::update() -> void { fmt::arg("used", used_ram_gigabytes), fmt::arg("avail", available_ram_gigabytes))); if (tooltipEnabled()) { - label_.set_tooltip_text(fmt::format("{:.{}f}Gb used", used_ram_gigabytes, 1)); + if (config_["tooltip-format"].isString()) { + auto tooltip_format = config_["tooltip-format"].asString(); + label_.set_tooltip_text(fmt::format(tooltip_format, + used_ram_percentage, + fmt::arg("total", total_ram_gigabytes), + fmt::arg("percentage", used_ram_percentage), + fmt::arg("used", used_ram_gigabytes), + fmt::arg("avail", available_ram_gigabytes))); + } else { + label_.set_tooltip_text(fmt::format("{:.{}f}GiB used", used_ram_gigabytes, 1)); + } } event_box_.show(); } else { From 98b6d7f283f6cefa2fb8e43f0d175041dcb1c943 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Sun, 6 Sep 2020 21:48:42 +0200 Subject: [PATCH 037/303] Fix non-standard usage of Fixes the following build warning with musl libc: In file included from ../src/util/rfkill.cpp:24: /usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include to [-Wcpp] 1 | #warning redirecting incorrect #include to | ^~~~~~~ --- src/util/rfkill.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/rfkill.cpp b/src/util/rfkill.cpp index f987f4c..82d29e9 100644 --- a/src/util/rfkill.cpp +++ b/src/util/rfkill.cpp @@ -20,8 +20,8 @@ #include #include +#include #include -#include #include #include From 9e3e4368c733b9d13d78253aacb37173b7ec83cf Mon Sep 17 00:00:00 2001 From: Tamir Zahavi-Brunner Date: Sun, 6 Sep 2020 22:47:34 +0300 Subject: [PATCH 038/303] custom: Add "exec-on-event" config This config allows disabling the default behavior of re-executing the script whenever an event that has a command set is triggered. Fixes #841 --- include/modules/custom.hpp | 1 + man/waybar-custom.5.scd | 6 ++++++ src/modules/custom.cpp | 10 ++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/modules/custom.hpp b/include/modules/custom.hpp index b8dad9d..7c77145 100644 --- a/include/modules/custom.hpp +++ b/include/modules/custom.hpp @@ -22,6 +22,7 @@ class Custom : public ALabel { void continuousWorker(); void parseOutputRaw(); void parseOutputJson(); + void handleEvent(); bool handleScroll(GdkEventScroll* e); bool handleToggle(GdkEventButton* const& e); diff --git a/man/waybar-custom.5.scd b/man/waybar-custom.5.scd index 121585a..3e820c6 100644 --- a/man/waybar-custom.5.scd +++ b/man/waybar-custom.5.scd @@ -22,6 +22,12 @@ Addressed by *custom/* The path to a script, which determines if the script in *exec* should be executed. *exec* will be executed if the exit code of *exec-if* equals 0. +*exec-on-event*: ++ + typeof: bool ++ + default: true ++ + If an event command is set (e.g. *on-click* or *on-scroll-up*) then re-execute the script after + executing the event command. + *return-type*: ++ typeof: string ++ See *return-type* diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 5ee9bb5..92eedaa 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -91,15 +91,21 @@ void waybar::modules::Custom::refresh(int sig) { } } +void waybar::modules::Custom::handleEvent() { + if (!config_["exec-on-event"].isBool() || config_["exec-on-event"].asBool()) { + thread_.wake_up(); + } +} + bool waybar::modules::Custom::handleScroll(GdkEventScroll* e) { auto ret = ALabel::handleScroll(e); - thread_.wake_up(); + handleEvent(); return ret; } bool waybar::modules::Custom::handleToggle(GdkEventButton* const& e) { auto ret = ALabel::handleToggle(e); - thread_.wake_up(); + handleEvent(); return ret; } From c65167022223abc8e86650924c7da7e1b1a4b19d Mon Sep 17 00:00:00 2001 From: koffeinfriedhof Date: Sun, 13 Sep 2020 17:32:00 +0200 Subject: [PATCH 039/303] Added song position and queue length. --- man/waybar-mpd.5.scd | 4 ++++ resources/config | 2 +- src/modules/mpd.cpp | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/man/waybar-mpd.5.scd b/man/waybar-mpd.5.scd index 1ee7a98..e8105de 100644 --- a/man/waybar-mpd.5.scd +++ b/man/waybar-mpd.5.scd @@ -148,6 +148,10 @@ Addressed by *mpd* *{totalTime}*: The length of the current song. To format as a date/time (see example configuration) +*{songPosition}*: The position of the current song. + +*{queueLength}*: The length of the current queue. + *{stateIcon}*: The icon corresponding the playing or paused status of the player (see *state-icons* option) *{consumeIcon}*: The icon corresponding the "consume" option (see *consume-icons* option) diff --git a/resources/config b/resources/config index 832f76c..36c4f96 100644 --- a/resources/config +++ b/resources/config @@ -27,7 +27,7 @@ "format": "{}" }, "mpd": { - "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ", + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ ", "format-disconnected": "Disconnected ", "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", "unknown-tag": "N/A", diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp index d2877f3..26878b1 100644 --- a/src/modules/mpd.cpp +++ b/src/modules/mpd.cpp @@ -133,6 +133,7 @@ void waybar::modules::MPD::setLabel() { auto format = format_; std::string artist, album_artist, album, title, date; + int song_pos, queue_length; std::chrono::seconds elapsedTime, totalTime; std::string stateIcon = ""; @@ -161,6 +162,8 @@ void waybar::modules::MPD::setLabel() { album = getTag(MPD_TAG_ALBUM); title = getTag(MPD_TAG_TITLE); date = getTag(MPD_TAG_DATE); + song_pos = mpd_status_get_song_pos(status_.get()); + queue_length = mpd_status_get_queue_length(status_.get()); elapsedTime = std::chrono::seconds(mpd_status_get_elapsed_time(status_.get())); totalTime = std::chrono::seconds(mpd_status_get_total_time(status_.get())); } @@ -184,6 +187,8 @@ void waybar::modules::MPD::setLabel() { fmt::arg("date", Glib::Markup::escape_text(date).raw()), fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), + fmt::arg("songPosition", song_pos), + fmt::arg("queueLength", queue_length), fmt::arg("stateIcon", stateIcon), fmt::arg("consumeIcon", consumeIcon), fmt::arg("randomIcon", randomIcon), @@ -200,6 +205,8 @@ void waybar::modules::MPD::setLabel() { fmt::arg("album", album), fmt::arg("title", title), fmt::arg("date", date), + fmt::arg("songPosition", song_pos), + fmt::arg("queueLength", queue_length), fmt::arg("stateIcon", stateIcon), fmt::arg("consumeIcon", consumeIcon), fmt::arg("randomIcon", randomIcon), From 95f505a457def2f148d6aa9795dd3f4e6264c061 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 21 Sep 2020 10:56:40 +0200 Subject: [PATCH 040/303] revert: restore eventfd --- include/modules/network.hpp | 2 ++ src/modules/network.cpp | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/include/modules/network.hpp b/include/modules/network.hpp index 4441dc0..c02d3c5 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -54,6 +54,8 @@ class Network : public ALabel { struct sockaddr_nl nladdr_ = {0}; struct nl_sock* sock_ = nullptr; struct nl_sock* ev_sock_ = nullptr; + int efd_; + int ev_fd_; int nl80211_id_; std::mutex mutex_; diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 3914120..74ae913 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -83,6 +83,8 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf : ALabel(config, "network", id, "{ifname}", 60), ifid_(-1), family_(config["family"] == "ipv6" ? AF_INET6 : AF_INET), + efd_(-1), + ev_fd_(-1), cidr_(-1), signal_strength_dbm_(0), signal_strength_(0), @@ -119,6 +121,12 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf } waybar::modules::Network::~Network() { + if (ev_fd_ > -1) { + close(ev_fd_); + } + if (efd_ > -1) { + close(efd_); + } if (ev_sock_ != nullptr) { nl_socket_drop_membership(ev_sock_, RTNLGRP_LINK); if (family_ == AF_INET) { @@ -150,6 +158,30 @@ void waybar::modules::Network::createEventSocket() { } else { nl_socket_add_membership(ev_sock_, RTNLGRP_IPV6_IFADDR); } + efd_ = epoll_create1(EPOLL_CLOEXEC); + if (efd_ < 0) { + throw std::runtime_error("Can't create epoll"); + } + { + ev_fd_ = eventfd(0, EFD_NONBLOCK); + struct epoll_event event; + memset(&event, 0, sizeof(event)); + event.events = EPOLLIN | EPOLLET; + event.data.fd = ev_fd_; + if (epoll_ctl(efd_, EPOLL_CTL_ADD, ev_fd_, &event) == -1) { + throw std::runtime_error("Can't add epoll event"); + } + } + { + auto fd = nl_socket_get_fd(ev_sock_); + struct epoll_event event; + memset(&event, 0, sizeof(event)); + event.events = EPOLLIN | EPOLLET | EPOLLRDHUP; + event.data.fd = fd; + if (epoll_ctl(efd_, EPOLL_CTL_ADD, fd, &event) == -1) { + throw std::runtime_error("Can't add epoll event"); + } + } } void waybar::modules::Network::createInfoSocket() { @@ -192,6 +224,19 @@ void waybar::modules::Network::worker() { #else spdlog::warn("Waybar has been built without rfkill support."); #endif + thread_ = [this] { + std::array events{}; + + int ec = epoll_wait(efd_, events.data(), EPOLL_MAX, -1); + if (ec > 0) { + for (auto i = 0; i < ec; i++) { + if (events[i].data.fd != nl_socket_get_fd(ev_sock_) || nl_recvmsgs_default(ev_sock_) < 0) { + thread_.stop(); + break; + } + } + } + }; } const std::string waybar::modules::Network::getNetworkState() const { From 6db795401a6c060a1e9c6d2a72be3caa69ad8ed0 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 21 Sep 2020 12:18:42 +0200 Subject: [PATCH 041/303] chore: v0.9.4 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 16da957..acc8a47 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project( 'waybar', 'cpp', 'c', - version: '0.9.3', + version: '0.9.4', license: 'MIT', default_options : [ 'cpp_std=c++17', From 12016d35bb09b9628a0a37272557fad4e4b4a7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Mon, 21 Sep 2020 13:17:11 +0200 Subject: [PATCH 042/303] disk module: add state for percentage_used --- man/waybar-disk.5.scd | 4 ++++ src/modules/disk.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/man/waybar-disk.5.scd b/man/waybar-disk.5.scd index 1a9320c..431d7c8 100644 --- a/man/waybar-disk.5.scd +++ b/man/waybar-disk.5.scd @@ -31,6 +31,10 @@ Addressed by *disk* typeof: integer ++ Positive value to rotate the text label. +*states*: ++ + typeof: array ++ + A number of disk utilization states which get activated on certain percentage thresholds (percentage_used). See *waybar-states(5)*. + *max-length*: ++ typeof: integer ++ The maximum length in character the module should display. diff --git a/src/modules/disk.cpp b/src/modules/disk.cpp index 59ffea6..83d612b 100644 --- a/src/modules/disk.cpp +++ b/src/modules/disk.cpp @@ -47,13 +47,14 @@ auto waybar::modules::Disk::update() -> void { auto free = pow_format(stats.f_bavail * stats.f_frsize, "B", true); auto used = pow_format((stats.f_blocks - stats.f_bavail) * stats.f_frsize, "B", true); auto total = pow_format(stats.f_blocks * stats.f_frsize, "B", true); + auto percentage_used = (stats.f_blocks - stats.f_bavail) * 100 / stats.f_blocks; label_.set_markup(fmt::format(format_ , stats.f_bavail * 100 / stats.f_blocks , fmt::arg("free", free) , fmt::arg("percentage_free", stats.f_bavail * 100 / stats.f_blocks) , fmt::arg("used", used) - , fmt::arg("percentage_used", (stats.f_blocks - stats.f_bavail) * 100 / stats.f_blocks) + , fmt::arg("percentage_used", percentage_used) , fmt::arg("total", total) , fmt::arg("path", path_) )); @@ -67,12 +68,13 @@ auto waybar::modules::Disk::update() -> void { , fmt::arg("free", free) , fmt::arg("percentage_free", stats.f_bavail * 100 / stats.f_blocks) , fmt::arg("used", used) - , fmt::arg("percentage_used", (stats.f_blocks - stats.f_bavail) * 100 / stats.f_blocks) + , fmt::arg("percentage_used", percentage_used) , fmt::arg("total", total) , fmt::arg("path", path_) )); } event_box_.show(); + getState(percentage_used); // Call parent update ALabel::update(); } From 7ba14c2097c43866fca5e20ccb736f7ca854fcfd Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Sat, 26 Sep 2020 15:55:06 -0400 Subject: [PATCH 043/303] Fix "on-click-backward" when "on-click-forward" is not present --- src/AModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AModule.cpp b/src/AModule.cpp index 10bd077..7da942e 100644 --- a/src/AModule.cpp +++ b/src/AModule.cpp @@ -44,9 +44,9 @@ bool AModule::handleToggle(GdkEventButton* const& e) { format = config_["on-click-middle"].asString(); } else if (config_["on-click-right"].isString() && e->button == 3) { format = config_["on-click-right"].asString(); - } else if (config_["on-click-forward"].isString() && e->button == 8) { + } else if (config_["on-click-backward"].isString() && e->button == 8) { format = config_["on-click-backward"].asString(); - } else if (config_["on-click-backward"].isString() && e->button == 9) { + } else if (config_["on-click-forward"].isString() && e->button == 9) { format = config_["on-click-forward"].asString(); } if (!format.empty()) { From 83d679bf72da86c9121b285e5ee6323fb3cbd1a1 Mon Sep 17 00:00:00 2001 From: lrhel Date: Sat, 26 Sep 2020 23:06:12 +0000 Subject: [PATCH 044/303] Add format-icons for workspace's name entry --- src/modules/sway/workspaces.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 17a0be2..8d78bf5 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -283,6 +283,8 @@ std::string Workspaces::getIcon(const std::string &name, const Json::Value &node return config_["format-icons"]["persistent"].asString(); } else if (config_["format-icons"][key].isString()) { return config_["format-icons"][key].asString(); + } else if (config_["format-icons"][trimWorkspaceName(key)].isString()) { + return config_["format-icons"][trimWorkspaceName(key)].asString(); } } return name; From e9b5be9adbfcc8982c8fc1117d92a250a682c8a1 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 29 Sep 2020 22:28:39 +0200 Subject: [PATCH 045/303] fix: add global /etc/xdg/waybar back. fixes #714 --- src/client.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client.cpp b/src/client.cpp index 316e7ec..70cc22c 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -162,6 +162,7 @@ std::tuple waybar::Client::getConfigs( "$XDG_CONFIG_HOME/waybar/config", "$HOME/.config/waybar/config", "$HOME/waybar/config", + "/etc/xdg/waybar/config", SYSCONFDIR "/xdg/waybar/config", "./resources/config", }) @@ -170,6 +171,7 @@ std::tuple waybar::Client::getConfigs( "$XDG_CONFIG_HOME/waybar/style.css", "$HOME/.config/waybar/style.css", "$HOME/waybar/style.css", + "/etc/xdg/waybar/style.css", SYSCONFDIR "/xdg/waybar/style.css", "./resources/style.css", }) From 73681a30e5ad70a3308b883deedd2b5ad694d8c6 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 29 Sep 2020 22:31:28 +0200 Subject: [PATCH 046/303] man: add the prefixed path were config is loaded --- man/{waybar.5.scd => waybar.5.scd.in} | 1 + meson.build | 27 ++++++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) rename man/{waybar.5.scd => waybar.5.scd.in} (99%) diff --git a/man/waybar.5.scd b/man/waybar.5.scd.in similarity index 99% rename from man/waybar.5.scd rename to man/waybar.5.scd.in index cd64f7d..430b9fc 100644 --- a/man/waybar.5.scd +++ b/man/waybar.5.scd.in @@ -14,6 +14,7 @@ Valid locations for this file are: - *~/.config/waybar/config* - *~/waybar/config* - */etc/xdg/waybar/config* +- *@sysconfdir@/xdg/waybar/config* A good starting point is the default configuration found at https://github.com/Alexays/Waybar/blob/master/resources/config Also a minimal example configuration can be found on the at the bottom of this man page. diff --git a/meson.build b/meson.build index acc8a47..5ac0986 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,8 @@ project( ], ) +fs = import('fs') + compiler = meson.get_compiler('cpp') cpp_args = [] @@ -256,9 +258,20 @@ scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_opti if scdoc.found() scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) sh = find_program('sh', native: true) + + main_manpage = configure_file( + input: 'man/waybar.5.scd.in', + output: 'waybar.5.scd', + configuration: { + 'sysconfdir': join_paths(prefix, sysconfdir) + } + ) + + main_manpage_path = join_paths(meson.build_root(), '@0@'.format(main_manpage)) + mandir = get_option('mandir') man_files = [ - 'waybar.5.scd', + main_manpage_path, 'waybar-backlight.5.scd', 'waybar-battery.5.scd', 'waybar-clock.5.scd', @@ -281,14 +294,18 @@ if scdoc.found() 'waybar-bluetooth.5.scd', ] - foreach filename : man_files - topic = filename.split('.')[-3].split('/')[-1] - section = filename.split('.')[-2] + foreach file : man_files + path = '@0@'.format(file) + basename = fs.name(path) + + topic = basename.split('.')[-3].split('/')[-1] + section = basename.split('.')[-2] output = '@0@.@1@'.format(topic, section) custom_target( output, - input: 'man/@0@'.format(filename), + # drops the 'man' if `path` is an absolute path + input: join_paths('man', path), output: output, command: [ sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output) From e4427cb017f235cda521c4a024bc4da55bf7c976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sun, 6 Sep 2020 14:44:13 -0300 Subject: [PATCH 047/303] sndio: Add module. - can control sndio: change volume, toggle mute - appearance is somewhat dynamic: takes muted status into account - uses polling inside sleeper thread to update values - uses sioctl_* functions, requires sndio>=1.7.0. --- README.md | 1 + include/factory.hpp | 3 + include/modules/sndio.hpp | 29 +++++++ man/waybar-sndio.5.scd | 83 +++++++++++++++++++ meson.build | 20 +++++ meson_options.txt | 1 + src/factory.cpp | 5 ++ src/modules/sndio.cpp | 167 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 309 insertions(+) create mode 100644 include/modules/sndio.hpp create mode 100644 man/waybar-sndio.5.scd create mode 100644 src/modules/sndio.cpp diff --git a/README.md b/README.md index 74f4660..b104ade 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ libnl [Network module] libappindicator-gtk3 [Tray module] libdbusmenu-gtk3 [Tray module] libmpdclient [MPD module] +libsndio [sndio module] ``` **Build dependencies** diff --git a/include/factory.hpp b/include/factory.hpp index ebc2359..3efe6cb 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -39,6 +39,9 @@ #ifdef HAVE_LIBMPDCLIENT #include "modules/mpd.hpp" #endif +#ifdef HAVE_LIBSNDIO +#include "modules/sndio.hpp" +#endif #include "bar.hpp" #include "modules/custom.hpp" #include "modules/temperature.hpp" diff --git a/include/modules/sndio.hpp b/include/modules/sndio.hpp new file mode 100644 index 0000000..f14d062 --- /dev/null +++ b/include/modules/sndio.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include "ALabel.hpp" +#include "util/sleeper_thread.hpp" + +namespace waybar::modules { + +class Sndio : public ALabel { + public: + Sndio(const std::string&, const Json::Value&); + ~Sndio(); + auto update() -> void; + auto set_desc(struct sioctl_desc *, unsigned int) -> void; + auto put_val(unsigned int, unsigned int) -> void; + bool handleScroll(GdkEventScroll *); + bool handleToggle(GdkEventButton* const&); + + private: + util::SleeperThread thread_; + struct sioctl_hdl *hdl_; + std::vector pfds_; + unsigned int addr_; + unsigned int volume_, old_volume_, maxval_; + bool muted_; +}; + +} // namespace waybar::modules diff --git a/man/waybar-sndio.5.scd b/man/waybar-sndio.5.scd new file mode 100644 index 0000000..a61c332 --- /dev/null +++ b/man/waybar-sndio.5.scd @@ -0,0 +1,83 @@ +waybar-sndio(5) + +# NAME + +waybar - sndio module + +# DESCRIPTION + +The *sndio* module displays the current volume reported by sndio(7). + +Additionally, you can control the volume by scrolling *up* or *down* while the +cursor is over the module, and clicking on the module toggles mute. + +# CONFIGURATION + +*format*: ++ + typeof: string ++ + default: {volume}% ++ + The format for how information should be displayed. + +*rotate*: ++ + typeof: integer ++ + Positive value to rotate the text label. + +*max-length*: ++ + typeof: integer ++ + The maximum length in character the module should display. + +*scroll-step*: ++ + typeof: int ++ + default: 5 ++ + The speed in which to change the volume when scrolling. + +*on-click*: ++ + typeof: string ++ + Command to execute when clicked on the module. + This replaces the default behaviour of toggling mute. + +*on-click-middle*: ++ + typeof: string ++ + Command to execute when middle-clicked on the module using mousewheel. + +*on-click-right*: ++ + typeof: string ++ + Command to execute when you right clicked on the module. + +*on-update*: ++ + typeof: string ++ + Command to execute when the module is updated. + +*on-scroll-up*: ++ + typeof: string ++ + Command to execute when scrolling up on the module. + This replaces the default behaviour of volume control. + +*on-scroll-down*: ++ + typeof: string ++ + Command to execute when scrolling down on the module. + This replaces the default behaviour of volume control. + +*smooth-scrolling-threshold*: ++ + typeof: double ++ + Threshold to be used when scrolling. + +# FORMAT REPLACEMENTS + +*{volume}*: Volume in percentage. + +*{raw_value}*: Volume as value reported by sndio. + +# EXAMPLES + +``` +"sndio": { + "format": "{raw_value} 🎜", + "scroll-step": 3 +} +``` + +# STYLE + +- *#sndio* +- *#sndio.muted* diff --git a/meson.build b/meson.build index 5ac0986..023894c 100644 --- a/meson.build +++ b/meson.build @@ -96,6 +96,19 @@ libnlgen = dependency('libnl-genl-3.0', required: get_option('libnl')) libpulse = dependency('libpulse', required: get_option('pulseaudio')) libudev = dependency('libudev', required: get_option('libudev')) libmpdclient = dependency('libmpdclient', required: get_option('mpd')) + +libsndio = compiler.find_library('sndio', required: get_option('sndio')) +if libsndio.found() + if not compiler.has_function('sioctl_open', prefix: '#include ', dependencies: libsndio) + if get_option('sndio').enabled() + error('libsndio is too old, required >=1.7.0') + else + warning('libsndio is too old, required >=1.7.0') + libsndio = dependency('', required: false) + endif + endif +endif + gtk_layer_shell = dependency('gtk-layer-shell-0', required: get_option('gtk-layer-shell'), fallback : ['gtk-layer-shell', 'gtk_layer_shell_dep']) @@ -207,6 +220,11 @@ if gtk_layer_shell.found() add_project_arguments('-DHAVE_GTK_LAYER_SHELL', language: 'cpp') endif +if libsndio.found() + add_project_arguments('-DHAVE_LIBSNDIO', language: 'cpp') + src_files += 'src/modules/sndio.cpp' +endif + if get_option('rfkill').enabled() if is_linux add_project_arguments('-DWANT_RFKILL', language: 'cpp') @@ -241,6 +259,7 @@ executable( libepoll, libmpdclient, gtk_layer_shell, + libsndio, tz_dep ], include_directories: [include_directories('include')], @@ -292,6 +311,7 @@ if scdoc.found() 'waybar-states.5.scd', 'waybar-wlr-taskbar.5.scd', 'waybar-bluetooth.5.scd', + 'waybar-sndio.5.scd', ] foreach file : man_files diff --git a/meson_options.txt b/meson_options.txt index de47da7..cb5581b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,3 +8,4 @@ option('man-pages', type: 'feature', value: 'auto', description: 'Generate and i option('mpd', type: 'feature', value: 'auto', description: 'Enable support for the Music Player Daemon') option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk-layer-shell library for popups support') option('rfkill', type: 'feature', value: 'auto', description: 'Enable support for RFKILL') +option('sndio', type: 'feature', value: 'auto', description: 'Enable support for sndio') diff --git a/src/factory.cpp b/src/factory.cpp index af93b20..8a5e825 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -76,6 +76,11 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { if (ref == "mpd") { return new waybar::modules::MPD(id, config_[name]); } +#endif +#ifdef HAVE_LIBSNDIO + if (ref == "sndio") { + return new waybar::modules::Sndio(id, config_[name]); + } #endif if (ref == "temperature") { return new waybar::modules::Temperature(id, config_[name]); diff --git a/src/modules/sndio.cpp b/src/modules/sndio.cpp new file mode 100644 index 0000000..e72c56f --- /dev/null +++ b/src/modules/sndio.cpp @@ -0,0 +1,167 @@ +#include "modules/sndio.hpp" +#include +#include +#include +#include + +namespace waybar::modules { + +void ondesc(void *arg, struct sioctl_desc *d, int curval) { + auto self = static_cast(arg); + if (d == NULL) { + // d is NULL when the list is done + return; + } + self->set_desc(d, curval); +} + +void onval(void *arg, unsigned int addr, unsigned int val) { + auto self = static_cast(arg); + self->put_val(addr, val); +} + +Sndio::Sndio(const std::string &id, const Json::Value &config) + : ALabel(config, "sndio", id, "{volume}%"), + hdl_(nullptr), + pfds_(0), + addr_(0), + volume_(0), + old_volume_(0), + maxval_(0), + muted_(false) { + hdl_ = sioctl_open(SIO_DEVANY, SIOCTL_READ | SIOCTL_WRITE, 0); + if (hdl_ == nullptr) { + throw std::runtime_error("sioctl_open() failed."); + } + + if(sioctl_ondesc(hdl_, ondesc, this) == 0) { + throw std::runtime_error("sioctl_ondesc() failed."); + } + + sioctl_onval(hdl_, onval, this); + + pfds_.reserve(sioctl_nfds(hdl_)); + + event_box_.show(); + + event_box_.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK | Gdk::BUTTON_PRESS_MASK); + event_box_.signal_scroll_event().connect( + sigc::mem_fun(*this, &Sndio::handleScroll)); + event_box_.signal_button_press_event().connect( + sigc::mem_fun(*this, &Sndio::handleToggle)); + + thread_ = [this] { + dp.emit(); + + int nfds = sioctl_pollfd(hdl_, pfds_.data(), POLLIN); + if (nfds == 0) { + throw std::runtime_error("sioctl_pollfd() failed."); + } + while (poll(pfds_.data(), nfds, -1) < 0) { + if (errno != EINTR) { + throw std::runtime_error("poll() failed."); + } + } + + int revents = sioctl_revents(hdl_, pfds_.data()); + if (revents & POLLHUP) { + throw std::runtime_error("disconnected!"); + } + }; +} + +Sndio::~Sndio() { + sioctl_close(hdl_); +} + +auto Sndio::update() -> void { + auto format = format_; + unsigned int vol = 100. * static_cast(volume_) / static_cast(maxval_); + + if (volume_ == 0) { + label_.get_style_context()->add_class("muted"); + } else { + label_.get_style_context()->remove_class("muted"); + } + + label_.set_markup(fmt::format(format, + fmt::arg("volume", vol), + fmt::arg("raw_value", volume_))); + + ALabel::update(); +} + +auto Sndio::set_desc(struct sioctl_desc *d, unsigned int val) -> void { + std::string name{d->func}; + std::string node_name{d->node0.name}; + + if (name == "level" && node_name == "output" && d->type == SIOCTL_NUM) { + // store addr for output.level value, used in put_val + addr_ = d->addr; + maxval_ = d->maxval; + volume_ = val; + } +} + +auto Sndio::put_val(unsigned int addr, unsigned int val) -> void { + if (addr == addr_) { + volume_ = val; + } +} + +bool Sndio::handleScroll(GdkEventScroll *e) { + // change the volume only when no user provided + // events are configured + if (config_["on-scroll-up"].isString() || config_["on-scroll-down"].isString()) { + return AModule::handleScroll(e); + } + + auto dir = AModule::getScrollDir(e); + if (dir == SCROLL_DIR::NONE) { + return true; + } + + int step = 5; + if (config_["scroll-step"].isInt()) { + step = config_["scroll-step"].asInt(); + } + + int new_volume = volume_; + if (muted_) { + new_volume = old_volume_; + } + + if (dir == SCROLL_DIR::UP) { + new_volume += step; + } else if (dir == SCROLL_DIR::DOWN) { + new_volume -= step; + } + new_volume = std::clamp(new_volume, 0, static_cast(maxval_)); + + // quits muted mode if volume changes + muted_ = false; + + sioctl_setval(hdl_, addr_, new_volume); + + return true; +} + +bool Sndio::handleToggle(GdkEventButton* const& e) { + // toggle mute only when no user provided events are configured + if (config_["on-click"].isString()) { + return AModule::handleToggle(e); + } + + muted_ = !muted_; + if (muted_) { + // store old volume to be able to restore it later + old_volume_ = volume_; + sioctl_setval(hdl_, addr_, 0); + } else { + sioctl_setval(hdl_, addr_, old_volume_); + } + + return true; +} + +} /* namespace waybar::modules */ From 1f66b06f93ca740767acc6925ae66c50e5e9a453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Wed, 9 Sep 2020 14:48:27 -0300 Subject: [PATCH 048/303] Dockerfiles/alpine: add sndio-dev. --- Dockerfiles/alpine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/alpine b/Dockerfiles/alpine index 7b71837..21d1cbb 100644 --- a/Dockerfiles/alpine +++ b/Dockerfiles/alpine @@ -2,4 +2,4 @@ FROM alpine:latest -RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev scdoc +RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev sndio-dev scdoc From aa625f51967ad7bb6a71ed018e814892332441e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sun, 6 Sep 2020 15:15:58 -0300 Subject: [PATCH 049/303] .travis.yml: add sndio to FreeBSD run. Also add necessary environment variables and move to /latest, which has sndio-1.7.0. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62f7863..abc739c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,9 @@ jobs: compiler: clang env: before_install: - - sudo pkg install -y gtk-layer-shell gtkmm30 jsoncpp libdbusmenu + - export CPPFLAGS+=-isystem/usr/local/include LDFLAGS+=-L/usr/local/lib # sndio + - sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + - sudo pkg install -y gtk-layer-shell gtkmm30 jsoncpp libdbusmenu sndio libfmt libmpdclient libudev-devd meson pulseaudio scdoc spdlog script: - meson build -Dman-pages=enabled From 22e46ea6cc64e35f7ab1536d3b43a6a523658242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sun, 4 Oct 2020 02:53:21 -0300 Subject: [PATCH 050/303] sndio: Add reconnection support. --- include/modules/sndio.hpp | 1 + src/modules/sndio.cpp | 62 ++++++++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/include/modules/sndio.hpp b/include/modules/sndio.hpp index f14d062..32ed706 100644 --- a/include/modules/sndio.hpp +++ b/include/modules/sndio.hpp @@ -18,6 +18,7 @@ class Sndio : public ALabel { bool handleToggle(GdkEventButton* const&); private: + auto connect_to_sndio() -> void; util::SleeperThread thread_; struct sioctl_hdl *hdl_; std::vector pfds_; diff --git a/src/modules/sndio.cpp b/src/modules/sndio.cpp index e72c56f..34c46bd 100644 --- a/src/modules/sndio.cpp +++ b/src/modules/sndio.cpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace waybar::modules { @@ -20,8 +21,25 @@ void onval(void *arg, unsigned int addr, unsigned int val) { self->put_val(addr, val); } +auto Sndio::connect_to_sndio() -> void { + hdl_ = sioctl_open(SIO_DEVANY, SIOCTL_READ | SIOCTL_WRITE, 0); + if (hdl_ == nullptr) { + throw std::runtime_error("sioctl_open() failed."); + } + + if (sioctl_ondesc(hdl_, ondesc, this) == 0) { + throw std::runtime_error("sioctl_ondesc() failed."); + } + + if (sioctl_onval(hdl_, onval, this) == 0) { + throw std::runtime_error("sioctl_onval() failed."); + } + + pfds_.reserve(sioctl_nfds(hdl_)); +} + Sndio::Sndio(const std::string &id, const Json::Value &config) - : ALabel(config, "sndio", id, "{volume}%"), + : ALabel(config, "sndio", id, "{volume}%", 1), hdl_(nullptr), pfds_(0), addr_(0), @@ -29,18 +47,7 @@ Sndio::Sndio(const std::string &id, const Json::Value &config) old_volume_(0), maxval_(0), muted_(false) { - hdl_ = sioctl_open(SIO_DEVANY, SIOCTL_READ | SIOCTL_WRITE, 0); - if (hdl_ == nullptr) { - throw std::runtime_error("sioctl_open() failed."); - } - - if(sioctl_ondesc(hdl_, ondesc, this) == 0) { - throw std::runtime_error("sioctl_ondesc() failed."); - } - - sioctl_onval(hdl_, onval, this); - - pfds_.reserve(sioctl_nfds(hdl_)); + connect_to_sndio(); event_box_.show(); @@ -65,7 +72,28 @@ Sndio::Sndio(const std::string &id, const Json::Value &config) int revents = sioctl_revents(hdl_, pfds_.data()); if (revents & POLLHUP) { - throw std::runtime_error("disconnected!"); + spdlog::warn("sndio disconnected!"); + sioctl_close(hdl_); + hdl_ = nullptr; + + // reconnection loop + while (thread_.isRunning()) { + try { + connect_to_sndio(); + } catch(std::runtime_error const& e) { + // avoid leaking hdl_ + if (hdl_) { + sioctl_close(hdl_); + hdl_ = nullptr; + } + // rate limiting for the retries + thread_.sleep_for(interval_); + continue; + } + + spdlog::warn("sndio reconnected!"); + break; + } } }; } @@ -116,6 +144,9 @@ bool Sndio::handleScroll(GdkEventScroll *e) { return AModule::handleScroll(e); } + // only try to talk to sndio if connected + if (hdl_ == nullptr) return true; + auto dir = AModule::getScrollDir(e); if (dir == SCROLL_DIR::NONE) { return true; @@ -152,6 +183,9 @@ bool Sndio::handleToggle(GdkEventButton* const& e) { return AModule::handleToggle(e); } + // only try to talk to sndio if connected + if (hdl_ == nullptr) return true; + muted_ = !muted_; if (muted_) { // store old volume to be able to restore it later From 21fdcf41c3aacf381bf4756b6a4ec765e5f8c1db Mon Sep 17 00:00:00 2001 From: Joseph Benden Date: Sat, 3 Oct 2020 22:01:51 -0700 Subject: [PATCH 051/303] mpd: revamped to event-driven, single-threaded Fix MPD connection issues by converting/rewriting module into a state-machine driven system. It is fully single-threaded and uses events for transitioning between states. It supports all features and functionality of the previous MPD module. Signed-off-by: Joseph Benden --- include/factory.hpp | 2 +- include/modules/mpd.hpp | 74 ------ include/modules/mpd/mpd.hpp | 66 ++++++ include/modules/mpd/state.hpp | 217 +++++++++++++++++ include/modules/mpd/state.inl.hpp | 24 ++ meson.build | 3 +- src/modules/{ => mpd}/mpd.cpp | 156 ++++-------- src/modules/mpd/state.cpp | 382 ++++++++++++++++++++++++++++++ 8 files changed, 736 insertions(+), 188 deletions(-) delete mode 100644 include/modules/mpd.hpp create mode 100644 include/modules/mpd/mpd.hpp create mode 100644 include/modules/mpd/state.hpp create mode 100644 include/modules/mpd/state.inl.hpp rename src/modules/{ => mpd}/mpd.cpp (72%) create mode 100644 src/modules/mpd/state.cpp diff --git a/include/factory.hpp b/include/factory.hpp index 3efe6cb..f73c6e1 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -37,7 +37,7 @@ #include "modules/pulseaudio.hpp" #endif #ifdef HAVE_LIBMPDCLIENT -#include "modules/mpd.hpp" +#include "modules/mpd/mpd.hpp" #endif #ifdef HAVE_LIBSNDIO #include "modules/sndio.hpp" diff --git a/include/modules/mpd.hpp b/include/modules/mpd.hpp deleted file mode 100644 index d08b28b..0000000 --- a/include/modules/mpd.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include "ALabel.hpp" - -namespace waybar::modules { - -class MPD : public ALabel { - public: - MPD(const std::string&, const Json::Value&); - auto update() -> void; - - private: - std::thread periodic_updater(); - std::string getTag(mpd_tag_type type, unsigned idx = 0); - void setLabel(); - std::string getStateIcon(); - std::string getOptionIcon(std::string optionName, bool activated); - - std::thread event_listener(); - - // Assumes `connection_lock_` is locked - void tryConnect(); - // If checking errors on the main connection, make sure to lock it using - // `connection_lock_` before calling checkErrors - void checkErrors(mpd_connection* conn); - - // Assumes `connection_lock_` is locked - void fetchState(); - void waitForEvent(); - - bool handlePlayPause(GdkEventButton* const&); - - bool stopped(); - bool playing(); - bool paused(); - - const std::string module_name_; - - using unique_connection = std::unique_ptr; - using unique_status = std::unique_ptr; - using unique_song = std::unique_ptr; - - // Not using unique_ptr since we don't manage the pointer - // (It's either nullptr, or from the config) - const char* server_; - const unsigned port_; - - unsigned timeout_; - - // We need a mutex here because we can trigger updates from multiple thread: - // the event based updates, the periodic updates needed for the elapsed time, - // and the click play/pause feature - std::mutex connection_lock_; - unique_connection connection_; - // The alternate connection will be used to wait for events: since it will - // be blocking (idle) we can't send commands via this connection - // - // No lock since only used in the event listener thread - unique_connection alternate_connection_; - - // Protect them using the `connection_lock_` - unique_status status_; - mpd_state state_; - unique_song song_; - - // To make sure the previous periodic_updater stops before creating a new one - std::mutex periodic_lock_; -}; - -} // namespace waybar::modules diff --git a/include/modules/mpd/mpd.hpp b/include/modules/mpd/mpd.hpp new file mode 100644 index 0000000..effe633 --- /dev/null +++ b/include/modules/mpd/mpd.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include +#include +#include + +#include +#include + +#include "ALabel.hpp" +#include "modules/mpd/state.hpp" + +namespace waybar::modules { + +class MPD : public ALabel { + friend class detail::Context; + + // State machine + detail::Context context_{this}; + + const std::string module_name_; + + // Not using unique_ptr since we don't manage the pointer + // (It's either nullptr, or from the config) + const char* server_; + const unsigned port_; + + unsigned timeout_; + + detail::unique_connection connection_; + + detail::unique_status status_; + mpd_state state_; + detail::unique_song song_; + + public: + MPD(const std::string&, const Json::Value&); + virtual ~MPD() noexcept = default; + auto update() -> void; + + private: + std::string getTag(mpd_tag_type type, unsigned idx = 0) const; + void setLabel(); + std::string getStateIcon() const; + std::string getOptionIcon(std::string optionName, bool activated) const; + + // GUI-side methods + bool handlePlayPause(GdkEventButton* const&); + void emit() { dp.emit(); } + + // MPD-side, Non-GUI methods. + void tryConnect(); + void checkErrors(mpd_connection* conn); + void fetchState(); + void queryMPD(); + + inline bool stopped() const { return connection_ && state_ == MPD_STATE_STOP; } + inline bool playing() const { return connection_ && state_ == MPD_STATE_PLAY; } + inline bool paused() const { return connection_ && state_ == MPD_STATE_PAUSE; } +}; + +#if !defined(MPD_NOINLINE) +#include "modules/mpd/state.inl.hpp" +#endif + +} // namespace waybar::modules diff --git a/include/modules/mpd/state.hpp b/include/modules/mpd/state.hpp new file mode 100644 index 0000000..79e4f63 --- /dev/null +++ b/include/modules/mpd/state.hpp @@ -0,0 +1,217 @@ +#pragma once + +#include +#include +#include + +#include +#include + +#include "ALabel.hpp" + +namespace waybar::modules { +class MPD; +} // namespace waybar::modules + +namespace waybar::modules::detail { + +using unique_connection = std::unique_ptr; +using unique_status = std::unique_ptr; +using unique_song = std::unique_ptr; + +class Context; + +/// This state machine loosely follows a non-hierarchical, statechart +/// pattern, and includes ENTRY and EXIT actions. +/// +/// The State class is the base class for all other states. The +/// entry and exit methods are automatically called when entering +/// into a new state and exiting from the current state. This +/// includes initially entering (Disconnected class) and exiting +/// Waybar. +/// +/// The following nested "top-level" states are represented: +/// 1. Idle - await notification of MPD activity. +/// 2. All Non-Idle states: +/// 1. Playing - An active song is producing audio output. +/// 2. Paused - The current song is paused. +/// 3. Stopped - No song is actively playing. +/// 3. Disconnected - periodically attempt MPD (re-)connection. +/// +/// NOTE: Since this statechart is non-hierarchical, the above +/// states are flattened into a set. + +class State { + public: + virtual ~State() noexcept = default; + + virtual void entry() noexcept { spdlog::debug("mpd: ignore entry action"); } + virtual void exit() noexcept { spdlog::debug("mpd: ignore exit action"); } + + virtual void play() { spdlog::debug("mpd: ignore play state transition"); } + virtual void stop() { spdlog::debug("mpd: ignore stop state transition"); } + virtual void pause() { spdlog::debug("mpd: ignore pause state transition"); } + + /// Request state update the GUI. + virtual void update() noexcept { spdlog::debug("mpd: ignoring update method request"); } +}; + +class Idle : public State { + Context* const ctx_; + sigc::connection idle_connection_; + + public: + Idle(Context* const ctx) : ctx_{ctx} {} + virtual ~Idle() noexcept { this->exit(); }; + + void entry() noexcept override; + void exit() noexcept override; + + void play() override; + void stop() override; + void pause() override; + void update() noexcept override; + + private: + Idle(const Idle&) = delete; + Idle& operator=(const Idle&) = delete; + + bool on_io(Glib::IOCondition const&); +}; + +class Playing : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Playing(Context* const ctx) : ctx_{ctx} {} + virtual ~Playing() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void pause() override; + void stop() override; + void update() noexcept override; + + private: + Playing(Playing const&) = delete; + Playing& operator=(Playing const&) = delete; + + bool on_timer(); +}; + +class Paused : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Paused(Context* const ctx) : ctx_{ctx} {} + virtual ~Paused() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void play() override; + void stop() override; + void update() noexcept override; + + private: + Paused(Paused const&) = delete; + Paused& operator=(Paused const&) = delete; + + bool on_timer(); +}; + +class Stopped : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Stopped(Context* const ctx) : ctx_{ctx} {} + virtual ~Stopped() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void play() override; + void pause() override; + void update() noexcept override; + + private: + Stopped(Stopped const&) = delete; + Stopped& operator=(Stopped const&) = delete; + + bool on_timer(); +}; + +class Disconnected : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Disconnected(Context* const ctx) : ctx_{ctx} {} + virtual ~Disconnected() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void update() noexcept override; + + private: + Disconnected(Disconnected const&) = delete; + Disconnected& operator=(Disconnected const&) = delete; + + void arm_timer(int interval) noexcept; + void disarm_timer() noexcept; + + bool on_timer(); +}; + +class Context { + std::unique_ptr state_; + waybar::modules::MPD* mpd_module_; + + friend class State; + friend class Playing; + friend class Paused; + friend class Stopped; + friend class Disconnected; + friend class Idle; + + protected: + void setState(std::unique_ptr&& new_state) noexcept { + if (state_.get() != nullptr) { + state_->exit(); + } + state_ = std::move(new_state); + state_->entry(); + } + + bool is_connected() const; + bool is_playing() const; + bool is_paused() const; + bool is_stopped() const; + constexpr std::size_t interval() const; + void tryConnect() const; + void checkErrors(mpd_connection*) const; + void do_update(); + void queryMPD() const; + void fetchState() const; + constexpr mpd_state state() const; + void emit() const; + [[nodiscard]] unique_connection& connection(); + + public: + explicit Context(waybar::modules::MPD* const mpd_module) + : state_{std::make_unique(this)}, mpd_module_{mpd_module} { + state_->entry(); + } + + void play() { state_->play(); } + void stop() { state_->stop(); } + void pause() { state_->pause(); } + void update() noexcept { state_->update(); } +}; + +} // namespace waybar::modules::detail diff --git a/include/modules/mpd/state.inl.hpp b/include/modules/mpd/state.inl.hpp new file mode 100644 index 0000000..0d83b0b --- /dev/null +++ b/include/modules/mpd/state.inl.hpp @@ -0,0 +1,24 @@ +#pragma once + +namespace detail { + +inline bool Context::is_connected() const { return mpd_module_->connection_ != nullptr; } +inline bool Context::is_playing() const { return mpd_module_->playing(); } +inline bool Context::is_paused() const { return mpd_module_->paused(); } +inline bool Context::is_stopped() const { return mpd_module_->stopped(); } + +constexpr inline std::size_t Context::interval() const { return mpd_module_->interval_.count(); } +inline void Context::tryConnect() const { mpd_module_->tryConnect(); } +inline unique_connection& Context::connection() { return mpd_module_->connection_; } +constexpr inline mpd_state Context::state() const { return mpd_module_->state_; } + +inline void Context::do_update() { + mpd_module_->setLabel(); +} + +inline void Context::checkErrors(mpd_connection* conn) const { mpd_module_->checkErrors(conn); } +inline void Context::queryMPD() const { mpd_module_->queryMPD(); } +inline void Context::fetchState() const { mpd_module_->fetchState(); } +inline void Context::emit() const { mpd_module_->emit(); } + +} // namespace detail diff --git a/meson.build b/meson.build index 023894c..de20382 100644 --- a/meson.build +++ b/meson.build @@ -213,7 +213,8 @@ endif if libmpdclient.found() add_project_arguments('-DHAVE_LIBMPDCLIENT', language: 'cpp') - src_files += 'src/modules/mpd.cpp' + src_files += 'src/modules/mpd/mpd.cpp' + src_files += 'src/modules/mpd/state.cpp' endif if gtk_layer_shell.found() diff --git a/src/modules/mpd.cpp b/src/modules/mpd/mpd.cpp similarity index 72% rename from src/modules/mpd.cpp rename to src/modules/mpd/mpd.cpp index 26878b1..50f2817 100644 --- a/src/modules/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -1,8 +1,15 @@ -#include "modules/mpd.hpp" +#include "modules/mpd/mpd.hpp" -#include +#include #include +#include "modules/mpd/state.hpp" +#if defined(MPD_NOINLINE) +namespace waybar::modules { +#include "modules/mpd/state.inl.hpp" +} // namespace waybar::modules +#endif + waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) : ALabel(config, "mpd", id, "{album} - {artist} - {title}", 5), module_name_(id.empty() ? "mpd" : "mpd#" + id), @@ -10,7 +17,6 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) port_(config_["port"].isUInt() ? config["port"].asUInt() : 0), timeout_(config_["timeout"].isUInt() ? config_["timeout"].asUInt() * 1'000 : 30'000), connection_(nullptr, &mpd_connection_free), - alternate_connection_(nullptr, &mpd_connection_free), status_(nullptr, &mpd_status_free), song_(nullptr, &mpd_song_free) { if (!config_["port"].isNull() && !config_["port"].isUInt()) { @@ -28,73 +34,33 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) server_ = config["server"].asCString(); } - event_listener().detach(); - event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect(sigc::mem_fun(*this, &MPD::handlePlayPause)); } auto waybar::modules::MPD::update() -> void { - std::lock_guard guard(connection_lock_); - tryConnect(); - - if (connection_ != nullptr) { - try { - bool wasPlaying = playing(); - if(!wasPlaying) { - // Wait until the periodic_updater has stopped - std::lock_guard periodic_guard(periodic_lock_); - } - fetchState(); - if (!wasPlaying && playing()) { - periodic_updater().detach(); - } - } catch (const std::exception& e) { - spdlog::error("{}: {}", module_name_, e.what()); - state_ = MPD_STATE_UNKNOWN; - } - } - - setLabel(); + context_.update(); // Call parent update ALabel::update(); } -std::thread waybar::modules::MPD::event_listener() { - return std::thread([this] { - while (true) { - try { - if (connection_ == nullptr) { - // Retry periodically if no connection - dp.emit(); - std::this_thread::sleep_for(interval_); - } else { - waitForEvent(); - dp.emit(); - } - } catch (const std::exception& e) { - if (strcmp(e.what(), "Connection to MPD closed") == 0) { - spdlog::debug("{}: {}", module_name_, e.what()); - } else { - spdlog::warn("{}: {}", module_name_, e.what()); - } - } +void waybar::modules::MPD::queryMPD() { + if (connection_ != nullptr) { + spdlog::debug("{}: fetching state information", module_name_); + try { + fetchState(); + spdlog::debug("{}: fetch complete", module_name_); + } catch (std::exception const& e) { + spdlog::error("{}: {}", module_name_, e.what()); + state_ = MPD_STATE_UNKNOWN; } - }); + + dp.emit(); + } } -std::thread waybar::modules::MPD::periodic_updater() { - return std::thread([this] { - std::lock_guard guard(periodic_lock_); - while (connection_ != nullptr && playing()) { - dp.emit(); - std::this_thread::sleep_for(std::chrono::seconds(1)); - } - }); -} - -std::string waybar::modules::MPD::getTag(mpd_tag_type type, unsigned idx) { +std::string waybar::modules::MPD::getTag(mpd_tag_type type, unsigned idx) const { std::string result = config_["unknown-tag"].isString() ? config_["unknown-tag"].asString() : "N/A"; const char* tag = mpd_song_get_tag(song_.get(), type, idx); @@ -133,7 +99,7 @@ void waybar::modules::MPD::setLabel() { auto format = format_; std::string artist, album_artist, album, title, date; - int song_pos, queue_length; + int song_pos, queue_length; std::chrono::seconds elapsedTime, totalTime; std::string stateIcon = ""; @@ -149,8 +115,8 @@ void waybar::modules::MPD::setLabel() { label_.get_style_context()->add_class("playing"); label_.get_style_context()->remove_class("paused"); } else if (paused()) { - format = - config_["format-paused"].isString() ? config_["format-paused"].asString() : config_["format"].asString(); + format = config_["format-paused"].isString() ? config_["format-paused"].asString() + : config_["format"].asString(); label_.get_style_context()->add_class("paused"); label_.get_style_context()->remove_class("playing"); } @@ -216,7 +182,7 @@ void waybar::modules::MPD::setLabel() { } } -std::string waybar::modules::MPD::getStateIcon() { +std::string waybar::modules::MPD::getStateIcon() const { if (!config_["state-icons"].isObject()) { return ""; } @@ -238,7 +204,7 @@ std::string waybar::modules::MPD::getStateIcon() { } } -std::string waybar::modules::MPD::getOptionIcon(std::string optionName, bool activated) { +std::string waybar::modules::MPD::getOptionIcon(std::string optionName, bool activated) const { if (!config_[optionName + "-icons"].isObject()) { return ""; } @@ -261,15 +227,11 @@ void waybar::modules::MPD::tryConnect() { } connection_ = - unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); + detail::unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); - alternate_connection_ = - unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); - - if (connection_ == nullptr || alternate_connection_ == nullptr) { + if (connection_ == nullptr) { spdlog::error("{}: Failed to connect to MPD", module_name_); connection_.reset(); - alternate_connection_.reset(); return; } @@ -279,7 +241,6 @@ void waybar::modules::MPD::tryConnect() { } catch (std::runtime_error& e) { spdlog::error("{}: Failed to connect to MPD: {}", module_name_, e.what()); connection_.reset(); - alternate_connection_.reset(); } } @@ -292,7 +253,6 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) { case MPD_ERROR_CLOSED: mpd_connection_clear_error(conn); connection_.reset(); - alternate_connection_.reset(); state_ = MPD_STATE_UNKNOWN; throw std::runtime_error("Connection to MPD closed"); default: @@ -306,37 +266,20 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) { } void waybar::modules::MPD::fetchState() { + if (connection_ == nullptr) { + spdlog::error("{}: Not connected to MPD", module_name_); + return; + } + auto conn = connection_.get(); - status_ = unique_status(mpd_run_status(conn), &mpd_status_free); + + status_ = detail::unique_status(mpd_run_status(conn), &mpd_status_free); checkErrors(conn); + state_ = mpd_status_get_state(status_.get()); checkErrors(conn); - song_ = unique_song(mpd_run_current_song(conn), &mpd_song_free); - checkErrors(conn); -} - -void waybar::modules::MPD::waitForEvent() { - auto conn = alternate_connection_.get(); - // Wait for a player (play/pause), option (random, shuffle, etc.), or playlist - // change - if (!mpd_send_idle_mask( - conn, static_cast(MPD_IDLE_PLAYER | MPD_IDLE_OPTIONS | MPD_IDLE_QUEUE))) { - checkErrors(conn); - return; - } - // alternate_idle_ = true; - - // See issue #277: - // https://github.com/Alexays/Waybar/issues/277 - mpd_recv_idle(conn, /* disable_timeout = */ false); - // See issue #281: - // https://github.com/Alexays/Waybar/issues/281 - std::lock_guard guard(connection_lock_); - - checkErrors(conn); - mpd_response_finish(conn); - + song_ = detail::unique_song(mpd_run_current_song(conn), &mpd_song_free); checkErrors(conn); } @@ -346,24 +289,13 @@ bool waybar::modules::MPD::handlePlayPause(GdkEventButton* const& e) { } if (e->button == 1) { - std::lock_guard guard(connection_lock_); - if (stopped()) { - mpd_run_play(connection_.get()); - } else { - mpd_run_toggle_pause(connection_.get()); - } + if (state_ == MPD_STATE_PLAY) + context_.pause(); + else + context_.play(); } else if (e->button == 3) { - std::lock_guard guard(connection_lock_); - mpd_run_stop(connection_.get()); + context_.stop(); } return true; } - -bool waybar::modules::MPD::stopped() { - return connection_ == nullptr || state_ == MPD_STATE_UNKNOWN || state_ == MPD_STATE_STOP || status_ == nullptr; -} - -bool waybar::modules::MPD::playing() { return connection_ != nullptr && state_ == MPD_STATE_PLAY; } - -bool waybar::modules::MPD::paused() { return connection_ != nullptr && state_ == MPD_STATE_PAUSE; } diff --git a/src/modules/mpd/state.cpp b/src/modules/mpd/state.cpp new file mode 100644 index 0000000..21b67ae --- /dev/null +++ b/src/modules/mpd/state.cpp @@ -0,0 +1,382 @@ +#include "modules/mpd/state.hpp" + +#include +#include + +#include "modules/mpd/mpd.hpp" +#if defined(MPD_NOINLINE) +namespace waybar::modules { +#include "modules/mpd/state.inl.hpp" +} // namespace waybar::modules +#endif + +namespace waybar::modules::detail { + +#define IDLE_RUN_NOIDLE_AND_CMD(...) \ + if (idle_connection_.connected()) { \ + idle_connection_.disconnect(); \ + auto conn = ctx_->connection().get(); \ + if (!mpd_run_noidle(conn)) { \ + if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS) { \ + spdlog::error("mpd: Idle: failed to unregister for IDLE events"); \ + ctx_->checkErrors(conn); \ + } \ + } \ + __VA_ARGS__; \ + } + +void Idle::play() { + IDLE_RUN_NOIDLE_AND_CMD(mpd_run_play(conn)); + + ctx_->setState(std::make_unique(ctx_)); +} + +void Idle::pause() { + IDLE_RUN_NOIDLE_AND_CMD(mpd_run_pause(conn, true)); + + ctx_->setState(std::make_unique(ctx_)); +} + +void Idle::stop() { + IDLE_RUN_NOIDLE_AND_CMD(mpd_run_stop(conn)); + + ctx_->setState(std::make_unique(ctx_)); +} + +#undef IDLE_RUN_NOIDLE_AND_CMD + +void Idle::update() noexcept { + // This is intentionally blank. +} + +void Idle::entry() noexcept { + auto conn = ctx_->connection().get(); + assert(conn != nullptr); + + if (!mpd_send_idle_mask( + conn, static_cast(MPD_IDLE_PLAYER | MPD_IDLE_OPTIONS | MPD_IDLE_QUEUE))) { + ctx_->checkErrors(conn); + spdlog::error("mpd: Idle: failed to register for IDLE events"); + } else { + spdlog::debug("mpd: Idle: watching FD"); + sigc::slot idle_slot = sigc::mem_fun(*this, &Idle::on_io); + idle_connection_ = + Glib::signal_io().connect(idle_slot, + mpd_connection_get_fd(conn), + Glib::IO_IN | Glib::IO_PRI | Glib::IO_ERR | Glib::IO_HUP); + } +} + +void Idle::exit() noexcept { + if (idle_connection_.connected()) { + idle_connection_.disconnect(); + spdlog::debug("mpd: Idle: unwatching FD"); + } +} + +bool Idle::on_io(Glib::IOCondition const&) { + auto conn = ctx_->connection().get(); + + // callback should do this: + enum mpd_idle events = mpd_recv_idle(conn, /* ignore_timeout?= */ false); + spdlog::debug("mpd: Idle: recv_idle events -> {}", events); + + mpd_response_finish(conn); + try { + ctx_->checkErrors(conn); + } catch (std::exception const& e) { + spdlog::warn("mpd: Idle: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + mpd_state state = ctx_->state(); + + if (state == MPD_STATE_STOP) { + ctx_->emit(); + ctx_->setState(std::make_unique(ctx_)); + } else if (state == MPD_STATE_PLAY) { + ctx_->emit(); + ctx_->setState(std::make_unique(ctx_)); + } else if (state == MPD_STATE_PAUSE) { + ctx_->emit(); + ctx_->setState(std::make_unique(ctx_)); + } else { + ctx_->emit(); + // self transition + ctx_->setState(std::make_unique(ctx_)); + } + + return false; +} + +void Playing::entry() noexcept { + sigc::slot timer_slot = sigc::mem_fun(*this, &Playing::on_timer); + timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 1'000); + spdlog::debug("mpd: Playing: enabled 1 second periodic timer."); +} + +void Playing::exit() noexcept { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Playing: disabled 1 second periodic timer."); + } +} + +bool Playing::on_timer() { + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (!ctx_->is_connected()) { + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + + if (!ctx_->is_playing()) { + if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + } else { + ctx_->setState(std::make_unique(ctx_)); + } + return false; + } + + ctx_->queryMPD(); + ctx_->emit(); + } catch (std::exception const& e) { + spdlog::warn("mpd: Playing: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + return true; +} + +void Playing::stop() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_stop(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Playing::pause() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_pause(ctx_->connection().get(), true); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Playing::update() noexcept { ctx_->do_update(); } + +void Paused::entry() noexcept { + sigc::slot timer_slot = sigc::mem_fun(*this, &Paused::on_timer); + timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 200); + spdlog::debug("mpd: Paused: enabled 200 ms periodic timer."); +} + +void Paused::exit() noexcept { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Paused: disabled 200 ms periodic timer."); + } +} + +bool Paused::on_timer() { + bool rc = true; + + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (!ctx_->is_connected()) { + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + + ctx_->emit(); + + if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_playing()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_stopped()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + } catch (std::exception const& e) { + spdlog::warn("mpd: Paused: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + + return rc; +} + +void Paused::play() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_play(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Paused::stop() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_stop(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Paused::update() noexcept { ctx_->do_update(); } + +void Stopped::entry() noexcept { + sigc::slot timer_slot = sigc::mem_fun(*this, &Stopped::on_timer); + timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 200); + spdlog::debug("mpd: Stopped: enabled 200 ms periodic timer."); +} + +void Stopped::exit() noexcept { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Stopped: disabled 200 ms periodic timer."); + } +} + +bool Stopped::on_timer() { + bool rc = true; + + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (!ctx_->is_connected()) { + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + + ctx_->emit(); + + if (ctx_->is_stopped()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_playing()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + } catch (std::exception const& e) { + spdlog::warn("mpd: Stopped: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + + return rc; +} + +void Stopped::play() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_play(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Stopped::pause() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_pause(ctx_->connection().get(), true); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Stopped::update() noexcept { ctx_->do_update(); } + +void Disconnected::arm_timer(int interval) noexcept { + // unregister timer, if present + disarm_timer(); + + // register timer + sigc::slot timer_slot = sigc::mem_fun(*this, &Disconnected::on_timer); + timer_connection_ = + Glib::signal_timeout().connect(timer_slot, interval); + spdlog::debug("mpd: Disconnected: enabled interval timer."); +} + +void Disconnected::disarm_timer() noexcept { + // unregister timer, if present + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Disconnected: disabled interval timer."); + } +} + +void Disconnected::entry() noexcept { + arm_timer(1'000); +} + +void Disconnected::exit() noexcept { + disarm_timer(); +} + +bool Disconnected::on_timer() { + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (ctx_->is_connected()) { + ctx_->fetchState(); + ctx_->emit(); + + if (ctx_->is_playing()) { + ctx_->setState(std::make_unique(ctx_)); + } else if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + } else { + ctx_->setState(std::make_unique(ctx_)); + } + + return false; // do not rearm timer + } + } catch (std::exception const& e) { + spdlog::warn("mpd: Disconnected: error: {}", e.what()); + } + + arm_timer(ctx_->interval() * 1'000); + + return false; +} + +void Disconnected::update() noexcept { ctx_->do_update(); } + +} // namespace waybar::modules::detail From cc3acf8102c71d470b00fd55126aef4fb335f728 Mon Sep 17 00:00:00 2001 From: nikto_b Date: Sat, 10 Oct 2020 19:09:18 +0300 Subject: [PATCH 052/303] feature: created sway language submodule; added styles & config part for a sway language submodule --- include/factory.hpp | 1 + include/modules/sway/language.hpp | 28 +++++++++++++ meson.build | 1 + resources/config | 2 +- resources/style.css | 8 ++++ src/factory.cpp | 3 ++ src/modules/sway/language.cpp | 70 +++++++++++++++++++++++++++++++ 7 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 include/modules/sway/language.hpp create mode 100644 src/modules/sway/language.cpp diff --git a/include/factory.hpp b/include/factory.hpp index 3efe6cb..7eed15a 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -6,6 +6,7 @@ #include "modules/sway/mode.hpp" #include "modules/sway/window.hpp" #include "modules/sway/workspaces.hpp" +#include "modules/sway/language.hpp" #endif #ifdef HAVE_WLR #include "modules/wlr/taskbar.hpp" diff --git a/include/modules/sway/language.hpp b/include/modules/sway/language.hpp new file mode 100644 index 0000000..7cd6bf6 --- /dev/null +++ b/include/modules/sway/language.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include +#include "ALabel.hpp" +#include "bar.hpp" +#include "client.hpp" +#include "modules/sway/ipc/client.hpp" +#include "util/json.hpp" + +namespace waybar::modules::sway { + +class Language : public ALabel, public sigc::trackable { + public: + Language(const std::string& id, const Json::Value& config); + ~Language() = default; + auto update() -> void; + + private: + void onEvent(const struct Ipc::ipc_response&); + void onCmd(const struct Ipc::ipc_response&); + + std::string lang_; + util::JsonParser parser_; + std::mutex mutex_; + Ipc ipc_; +}; + +} // namespace waybar::modules::sway diff --git a/meson.build b/meson.build index 023894c..e563de0 100644 --- a/meson.build +++ b/meson.build @@ -172,6 +172,7 @@ add_project_arguments('-DHAVE_SWAY', language: 'cpp') src_files += [ 'src/modules/sway/ipc/client.cpp', 'src/modules/sway/mode.cpp', + 'src/modules/sway/language.cpp', 'src/modules/sway/window.cpp', 'src/modules/sway/workspaces.cpp' ] diff --git a/resources/config b/resources/config index 36c4f96..f3c0a77 100644 --- a/resources/config +++ b/resources/config @@ -6,7 +6,7 @@ // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-center": ["sway/window"], - "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "clock", "tray"], + "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "sway/language", "battery", "battery#bat2", "clock", "tray"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, diff --git a/resources/style.css b/resources/style.css index e21ae00..a16afd0 100644 --- a/resources/style.css +++ b/resources/style.css @@ -200,3 +200,11 @@ label:focus { #mpd.paused { background-color: #51a37a; } + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} diff --git a/src/factory.cpp b/src/factory.cpp index 8a5e825..1f90789 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -22,6 +22,9 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { if (ref == "sway/window") { return new waybar::modules::sway::Window(id, bar_, config_[name]); } + if (ref == "sway/language") { + return new waybar::modules::sway::Language(id, config_[name]); + } #endif #ifdef HAVE_WLR if (ref == "wlr/taskbar") { diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp new file mode 100644 index 0000000..a318647 --- /dev/null +++ b/src/modules/sway/language.cpp @@ -0,0 +1,70 @@ +#include "modules/sway/language.hpp" +#include + +namespace waybar::modules::sway { + +Language::Language(const std::string& id, const Json::Value& config) + : ALabel(config, "language", id, "{}", 0, true) { + ipc_.subscribe(R"(["input"])"); + ipc_.signal_event.connect(sigc::mem_fun(*this, &Language::onEvent)); + ipc_.signal_cmd.connect(sigc::mem_fun(*this, &Language::onCmd)); + ipc_.sendCmd(IPC_GET_INPUTS); + // Launch worker + ipc_.setWorker([this] { + try { + ipc_.handleEvent(); + } catch (const std::exception& e) { + spdlog::error("Language: {}", e.what()); + } + }); + dp.emit(); +} + +void Language::onCmd(const struct Ipc::ipc_response& res) { + try { + auto payload = parser_.parse(res.payload); + //Display current layout of a device with a maximum count of layouts, expecting that all will be OK + Json::Value::ArrayIndex maxId = 0, max = 0; + for(Json::Value::ArrayIndex i = 0; i < payload.size(); i++) { + if(payload[i]["xkb_layout_names"].size() > max) { + max = payload[i]["xkb_layout_names"].size(); + maxId = i; + } + } + auto layout_name = payload[maxId]["xkb_active_layout_name"].asString().substr(0,2); + lang_ = Glib::Markup::escape_text(layout_name); + dp.emit(); + } catch (const std::exception& e) { + spdlog::error("Language: {}", e.what()); + } +} + +void Language::onEvent(const struct Ipc::ipc_response& res) { + try { + std::lock_guard lock(mutex_); + auto payload = parser_.parse(res.payload)["input"]; + if (payload["type"].asString() == "keyboard") { + auto layout_name = payload["xkb_active_layout_name"].asString().substr(0,2); + lang_ = Glib::Markup::escape_text(layout_name); + } + dp.emit(); + } catch (const std::exception& e) { + spdlog::error("Language: {}", e.what()); + } +} + +auto Language::update() -> void { + if (lang_.empty()) { + event_box_.hide(); + } else { + label_.set_markup(fmt::format(format_, lang_)); + if (tooltipEnabled()) { + label_.set_tooltip_text(lang_); + } + event_box_.show(); + } + // Call parent update + ALabel::update(); +} + +} // namespace waybar::modules::sway From e9b2d275c836a08d8d5eae4cf2766f362c3cb572 Mon Sep 17 00:00:00 2001 From: Christoffer Noerbjerg Date: Sun, 11 Oct 2020 22:36:30 +0200 Subject: [PATCH 053/303] added module group selectors for styling --- src/bar.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bar.cpp b/src/bar.cpp index 45e3420..8af6b97 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -24,6 +24,9 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) window.get_style_context()->add_class(output->name); window.get_style_context()->add_class(config["name"].asString()); window.get_style_context()->add_class(config["position"].asString()); + left_.get_style_context()->add_class("modules-left"); + center_.get_style_context()->add_class("modules-center"); + right_.get_style_context()->add_class("modules-right"); if (config["position"] == "right" || config["position"] == "left") { height_ = 0; From 4229e9b2ca8aaa31bbf624e019b4cf82aed06e68 Mon Sep 17 00:00:00 2001 From: Ole Martin Handeland Date: Mon, 12 Oct 2020 02:05:26 +0200 Subject: [PATCH 054/303] Implemented format-{state} for cpu/disk/memory --- src/modules/cpu/common.cpp | 15 +++++++++++++-- src/modules/disk.cpp | 32 +++++++++++++++++++++----------- src/modules/memory/common.cpp | 26 ++++++++++++++++++-------- 3 files changed, 52 insertions(+), 21 deletions(-) diff --git a/src/modules/cpu/common.cpp b/src/modules/cpu/common.cpp index f2204cd..e86d10a 100644 --- a/src/modules/cpu/common.cpp +++ b/src/modules/cpu/common.cpp @@ -15,8 +15,19 @@ auto waybar::modules::Cpu::update() -> void { if (tooltipEnabled()) { label_.set_tooltip_text(tooltip); } - label_.set_markup(fmt::format(format_, fmt::arg("load", cpu_load), fmt::arg("usage", cpu_usage))); - getState(cpu_usage); + auto format = format_; + auto state = getState(cpu_usage); + if (!state.empty() && config_["format-" + state].isString()) { + format = config_["format-" + state].asString(); + } + + if (format.empty()) { + event_box_.hide(); + } else { + event_box_.show(); + label_.set_markup(fmt::format(format, fmt::arg("load", cpu_load), fmt::arg("usage", cpu_usage))); + } + // Call parent update ALabel::update(); } diff --git a/src/modules/disk.cpp b/src/modules/disk.cpp index 83d612b..e63db47 100644 --- a/src/modules/disk.cpp +++ b/src/modules/disk.cpp @@ -49,15 +49,27 @@ auto waybar::modules::Disk::update() -> void { auto total = pow_format(stats.f_blocks * stats.f_frsize, "B", true); auto percentage_used = (stats.f_blocks - stats.f_bavail) * 100 / stats.f_blocks; - label_.set_markup(fmt::format(format_ - , stats.f_bavail * 100 / stats.f_blocks - , fmt::arg("free", free) - , fmt::arg("percentage_free", stats.f_bavail * 100 / stats.f_blocks) - , fmt::arg("used", used) - , fmt::arg("percentage_used", percentage_used) - , fmt::arg("total", total) - , fmt::arg("path", path_) - )); + auto format = format_; + auto state = getState(percentage_used); + if (!state.empty() && config_["format-" + state].isString()) { + format = config_["format-" + state].asString(); + } + + if (format.empty()) { + event_box_.hide(); + } else { + event_box_.show(); + label_.set_markup(fmt::format(format + , stats.f_bavail * 100 / stats.f_blocks + , fmt::arg("free", free) + , fmt::arg("percentage_free", stats.f_bavail * 100 / stats.f_blocks) + , fmt::arg("used", used) + , fmt::arg("percentage_used", percentage_used) + , fmt::arg("total", total) + , fmt::arg("path", path_) + )); + } + if (tooltipEnabled()) { std::string tooltip_format = "{used} used out of {total} on {path} ({percentage_used}%)"; if (config_["tooltip-format"].isString()) { @@ -73,8 +85,6 @@ auto waybar::modules::Disk::update() -> void { , fmt::arg("path", path_) )); } - event_box_.show(); - getState(percentage_used); // Call parent update ALabel::update(); } diff --git a/src/modules/memory/common.cpp b/src/modules/memory/common.cpp index a332d58..09ce8e8 100644 --- a/src/modules/memory/common.cpp +++ b/src/modules/memory/common.cpp @@ -28,13 +28,24 @@ auto waybar::modules::Memory::update() -> void { auto used_ram_gigabytes = (memtotal - memfree) / std::pow(1024, 2); auto available_ram_gigabytes = memfree / std::pow(1024, 2); - getState(used_ram_percentage); - label_.set_markup(fmt::format(format_, - used_ram_percentage, - fmt::arg("total", total_ram_gigabytes), - fmt::arg("percentage", used_ram_percentage), - fmt::arg("used", used_ram_gigabytes), - fmt::arg("avail", available_ram_gigabytes))); + auto format = format_; + auto state = getState(used_ram_percentage); + if (!state.empty() && config_["format-" + state].isString()) { + format = config_["format-" + state].asString(); + } + + if (format.empty()) { + event_box_.hide(); + } else { + event_box_.show(); + label_.set_markup(fmt::format(format, + used_ram_percentage, + fmt::arg("total", total_ram_gigabytes), + fmt::arg("percentage", used_ram_percentage), + fmt::arg("used", used_ram_gigabytes), + fmt::arg("avail", available_ram_gigabytes))); + } + if (tooltipEnabled()) { if (config_["tooltip-format"].isString()) { auto tooltip_format = config_["tooltip-format"].asString(); @@ -48,7 +59,6 @@ auto waybar::modules::Memory::update() -> void { label_.set_tooltip_text(fmt::format("{:.{}f}GiB used", used_ram_gigabytes, 1)); } } - event_box_.show(); } else { event_box_.hide(); } From 54beabb9dc7ce3bc3a80488c948ca6bfd437336d Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 18 Oct 2020 10:45:31 +0200 Subject: [PATCH 055/303] Revert "mpd: revamped to event-driven, single-threaded" --- include/factory.hpp | 2 +- include/modules/mpd.hpp | 74 ++++++ include/modules/mpd/mpd.hpp | 66 ------ include/modules/mpd/state.hpp | 217 ----------------- include/modules/mpd/state.inl.hpp | 24 -- meson.build | 3 +- src/modules/{mpd => }/mpd.cpp | 156 ++++++++---- src/modules/mpd/state.cpp | 382 ------------------------------ 8 files changed, 188 insertions(+), 736 deletions(-) create mode 100644 include/modules/mpd.hpp delete mode 100644 include/modules/mpd/mpd.hpp delete mode 100644 include/modules/mpd/state.hpp delete mode 100644 include/modules/mpd/state.inl.hpp rename src/modules/{mpd => }/mpd.cpp (72%) delete mode 100644 src/modules/mpd/state.cpp diff --git a/include/factory.hpp b/include/factory.hpp index f73c6e1..3efe6cb 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -37,7 +37,7 @@ #include "modules/pulseaudio.hpp" #endif #ifdef HAVE_LIBMPDCLIENT -#include "modules/mpd/mpd.hpp" +#include "modules/mpd.hpp" #endif #ifdef HAVE_LIBSNDIO #include "modules/sndio.hpp" diff --git a/include/modules/mpd.hpp b/include/modules/mpd.hpp new file mode 100644 index 0000000..d08b28b --- /dev/null +++ b/include/modules/mpd.hpp @@ -0,0 +1,74 @@ +#pragma once + +#include +#include +#include +#include +#include "ALabel.hpp" + +namespace waybar::modules { + +class MPD : public ALabel { + public: + MPD(const std::string&, const Json::Value&); + auto update() -> void; + + private: + std::thread periodic_updater(); + std::string getTag(mpd_tag_type type, unsigned idx = 0); + void setLabel(); + std::string getStateIcon(); + std::string getOptionIcon(std::string optionName, bool activated); + + std::thread event_listener(); + + // Assumes `connection_lock_` is locked + void tryConnect(); + // If checking errors on the main connection, make sure to lock it using + // `connection_lock_` before calling checkErrors + void checkErrors(mpd_connection* conn); + + // Assumes `connection_lock_` is locked + void fetchState(); + void waitForEvent(); + + bool handlePlayPause(GdkEventButton* const&); + + bool stopped(); + bool playing(); + bool paused(); + + const std::string module_name_; + + using unique_connection = std::unique_ptr; + using unique_status = std::unique_ptr; + using unique_song = std::unique_ptr; + + // Not using unique_ptr since we don't manage the pointer + // (It's either nullptr, or from the config) + const char* server_; + const unsigned port_; + + unsigned timeout_; + + // We need a mutex here because we can trigger updates from multiple thread: + // the event based updates, the periodic updates needed for the elapsed time, + // and the click play/pause feature + std::mutex connection_lock_; + unique_connection connection_; + // The alternate connection will be used to wait for events: since it will + // be blocking (idle) we can't send commands via this connection + // + // No lock since only used in the event listener thread + unique_connection alternate_connection_; + + // Protect them using the `connection_lock_` + unique_status status_; + mpd_state state_; + unique_song song_; + + // To make sure the previous periodic_updater stops before creating a new one + std::mutex periodic_lock_; +}; + +} // namespace waybar::modules diff --git a/include/modules/mpd/mpd.hpp b/include/modules/mpd/mpd.hpp deleted file mode 100644 index effe633..0000000 --- a/include/modules/mpd/mpd.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once - -#include -#include -#include - -#include -#include - -#include "ALabel.hpp" -#include "modules/mpd/state.hpp" - -namespace waybar::modules { - -class MPD : public ALabel { - friend class detail::Context; - - // State machine - detail::Context context_{this}; - - const std::string module_name_; - - // Not using unique_ptr since we don't manage the pointer - // (It's either nullptr, or from the config) - const char* server_; - const unsigned port_; - - unsigned timeout_; - - detail::unique_connection connection_; - - detail::unique_status status_; - mpd_state state_; - detail::unique_song song_; - - public: - MPD(const std::string&, const Json::Value&); - virtual ~MPD() noexcept = default; - auto update() -> void; - - private: - std::string getTag(mpd_tag_type type, unsigned idx = 0) const; - void setLabel(); - std::string getStateIcon() const; - std::string getOptionIcon(std::string optionName, bool activated) const; - - // GUI-side methods - bool handlePlayPause(GdkEventButton* const&); - void emit() { dp.emit(); } - - // MPD-side, Non-GUI methods. - void tryConnect(); - void checkErrors(mpd_connection* conn); - void fetchState(); - void queryMPD(); - - inline bool stopped() const { return connection_ && state_ == MPD_STATE_STOP; } - inline bool playing() const { return connection_ && state_ == MPD_STATE_PLAY; } - inline bool paused() const { return connection_ && state_ == MPD_STATE_PAUSE; } -}; - -#if !defined(MPD_NOINLINE) -#include "modules/mpd/state.inl.hpp" -#endif - -} // namespace waybar::modules diff --git a/include/modules/mpd/state.hpp b/include/modules/mpd/state.hpp deleted file mode 100644 index 79e4f63..0000000 --- a/include/modules/mpd/state.hpp +++ /dev/null @@ -1,217 +0,0 @@ -#pragma once - -#include -#include -#include - -#include -#include - -#include "ALabel.hpp" - -namespace waybar::modules { -class MPD; -} // namespace waybar::modules - -namespace waybar::modules::detail { - -using unique_connection = std::unique_ptr; -using unique_status = std::unique_ptr; -using unique_song = std::unique_ptr; - -class Context; - -/// This state machine loosely follows a non-hierarchical, statechart -/// pattern, and includes ENTRY and EXIT actions. -/// -/// The State class is the base class for all other states. The -/// entry and exit methods are automatically called when entering -/// into a new state and exiting from the current state. This -/// includes initially entering (Disconnected class) and exiting -/// Waybar. -/// -/// The following nested "top-level" states are represented: -/// 1. Idle - await notification of MPD activity. -/// 2. All Non-Idle states: -/// 1. Playing - An active song is producing audio output. -/// 2. Paused - The current song is paused. -/// 3. Stopped - No song is actively playing. -/// 3. Disconnected - periodically attempt MPD (re-)connection. -/// -/// NOTE: Since this statechart is non-hierarchical, the above -/// states are flattened into a set. - -class State { - public: - virtual ~State() noexcept = default; - - virtual void entry() noexcept { spdlog::debug("mpd: ignore entry action"); } - virtual void exit() noexcept { spdlog::debug("mpd: ignore exit action"); } - - virtual void play() { spdlog::debug("mpd: ignore play state transition"); } - virtual void stop() { spdlog::debug("mpd: ignore stop state transition"); } - virtual void pause() { spdlog::debug("mpd: ignore pause state transition"); } - - /// Request state update the GUI. - virtual void update() noexcept { spdlog::debug("mpd: ignoring update method request"); } -}; - -class Idle : public State { - Context* const ctx_; - sigc::connection idle_connection_; - - public: - Idle(Context* const ctx) : ctx_{ctx} {} - virtual ~Idle() noexcept { this->exit(); }; - - void entry() noexcept override; - void exit() noexcept override; - - void play() override; - void stop() override; - void pause() override; - void update() noexcept override; - - private: - Idle(const Idle&) = delete; - Idle& operator=(const Idle&) = delete; - - bool on_io(Glib::IOCondition const&); -}; - -class Playing : public State { - Context* const ctx_; - sigc::connection timer_connection_; - - public: - Playing(Context* const ctx) : ctx_{ctx} {} - virtual ~Playing() noexcept { this->exit(); } - - void entry() noexcept override; - void exit() noexcept override; - - void pause() override; - void stop() override; - void update() noexcept override; - - private: - Playing(Playing const&) = delete; - Playing& operator=(Playing const&) = delete; - - bool on_timer(); -}; - -class Paused : public State { - Context* const ctx_; - sigc::connection timer_connection_; - - public: - Paused(Context* const ctx) : ctx_{ctx} {} - virtual ~Paused() noexcept { this->exit(); } - - void entry() noexcept override; - void exit() noexcept override; - - void play() override; - void stop() override; - void update() noexcept override; - - private: - Paused(Paused const&) = delete; - Paused& operator=(Paused const&) = delete; - - bool on_timer(); -}; - -class Stopped : public State { - Context* const ctx_; - sigc::connection timer_connection_; - - public: - Stopped(Context* const ctx) : ctx_{ctx} {} - virtual ~Stopped() noexcept { this->exit(); } - - void entry() noexcept override; - void exit() noexcept override; - - void play() override; - void pause() override; - void update() noexcept override; - - private: - Stopped(Stopped const&) = delete; - Stopped& operator=(Stopped const&) = delete; - - bool on_timer(); -}; - -class Disconnected : public State { - Context* const ctx_; - sigc::connection timer_connection_; - - public: - Disconnected(Context* const ctx) : ctx_{ctx} {} - virtual ~Disconnected() noexcept { this->exit(); } - - void entry() noexcept override; - void exit() noexcept override; - - void update() noexcept override; - - private: - Disconnected(Disconnected const&) = delete; - Disconnected& operator=(Disconnected const&) = delete; - - void arm_timer(int interval) noexcept; - void disarm_timer() noexcept; - - bool on_timer(); -}; - -class Context { - std::unique_ptr state_; - waybar::modules::MPD* mpd_module_; - - friend class State; - friend class Playing; - friend class Paused; - friend class Stopped; - friend class Disconnected; - friend class Idle; - - protected: - void setState(std::unique_ptr&& new_state) noexcept { - if (state_.get() != nullptr) { - state_->exit(); - } - state_ = std::move(new_state); - state_->entry(); - } - - bool is_connected() const; - bool is_playing() const; - bool is_paused() const; - bool is_stopped() const; - constexpr std::size_t interval() const; - void tryConnect() const; - void checkErrors(mpd_connection*) const; - void do_update(); - void queryMPD() const; - void fetchState() const; - constexpr mpd_state state() const; - void emit() const; - [[nodiscard]] unique_connection& connection(); - - public: - explicit Context(waybar::modules::MPD* const mpd_module) - : state_{std::make_unique(this)}, mpd_module_{mpd_module} { - state_->entry(); - } - - void play() { state_->play(); } - void stop() { state_->stop(); } - void pause() { state_->pause(); } - void update() noexcept { state_->update(); } -}; - -} // namespace waybar::modules::detail diff --git a/include/modules/mpd/state.inl.hpp b/include/modules/mpd/state.inl.hpp deleted file mode 100644 index 0d83b0b..0000000 --- a/include/modules/mpd/state.inl.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -namespace detail { - -inline bool Context::is_connected() const { return mpd_module_->connection_ != nullptr; } -inline bool Context::is_playing() const { return mpd_module_->playing(); } -inline bool Context::is_paused() const { return mpd_module_->paused(); } -inline bool Context::is_stopped() const { return mpd_module_->stopped(); } - -constexpr inline std::size_t Context::interval() const { return mpd_module_->interval_.count(); } -inline void Context::tryConnect() const { mpd_module_->tryConnect(); } -inline unique_connection& Context::connection() { return mpd_module_->connection_; } -constexpr inline mpd_state Context::state() const { return mpd_module_->state_; } - -inline void Context::do_update() { - mpd_module_->setLabel(); -} - -inline void Context::checkErrors(mpd_connection* conn) const { mpd_module_->checkErrors(conn); } -inline void Context::queryMPD() const { mpd_module_->queryMPD(); } -inline void Context::fetchState() const { mpd_module_->fetchState(); } -inline void Context::emit() const { mpd_module_->emit(); } - -} // namespace detail diff --git a/meson.build b/meson.build index de20382..023894c 100644 --- a/meson.build +++ b/meson.build @@ -213,8 +213,7 @@ endif if libmpdclient.found() add_project_arguments('-DHAVE_LIBMPDCLIENT', language: 'cpp') - src_files += 'src/modules/mpd/mpd.cpp' - src_files += 'src/modules/mpd/state.cpp' + src_files += 'src/modules/mpd.cpp' endif if gtk_layer_shell.found() diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd.cpp similarity index 72% rename from src/modules/mpd/mpd.cpp rename to src/modules/mpd.cpp index 50f2817..26878b1 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd.cpp @@ -1,15 +1,8 @@ -#include "modules/mpd/mpd.hpp" +#include "modules/mpd.hpp" -#include +#include #include -#include "modules/mpd/state.hpp" -#if defined(MPD_NOINLINE) -namespace waybar::modules { -#include "modules/mpd/state.inl.hpp" -} // namespace waybar::modules -#endif - waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) : ALabel(config, "mpd", id, "{album} - {artist} - {title}", 5), module_name_(id.empty() ? "mpd" : "mpd#" + id), @@ -17,6 +10,7 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) port_(config_["port"].isUInt() ? config["port"].asUInt() : 0), timeout_(config_["timeout"].isUInt() ? config_["timeout"].asUInt() * 1'000 : 30'000), connection_(nullptr, &mpd_connection_free), + alternate_connection_(nullptr, &mpd_connection_free), status_(nullptr, &mpd_status_free), song_(nullptr, &mpd_song_free) { if (!config_["port"].isNull() && !config_["port"].isUInt()) { @@ -34,33 +28,73 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) server_ = config["server"].asCString(); } + event_listener().detach(); + event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect(sigc::mem_fun(*this, &MPD::handlePlayPause)); } auto waybar::modules::MPD::update() -> void { - context_.update(); + std::lock_guard guard(connection_lock_); + tryConnect(); + + if (connection_ != nullptr) { + try { + bool wasPlaying = playing(); + if(!wasPlaying) { + // Wait until the periodic_updater has stopped + std::lock_guard periodic_guard(periodic_lock_); + } + fetchState(); + if (!wasPlaying && playing()) { + periodic_updater().detach(); + } + } catch (const std::exception& e) { + spdlog::error("{}: {}", module_name_, e.what()); + state_ = MPD_STATE_UNKNOWN; + } + } + + setLabel(); // Call parent update ALabel::update(); } -void waybar::modules::MPD::queryMPD() { - if (connection_ != nullptr) { - spdlog::debug("{}: fetching state information", module_name_); - try { - fetchState(); - spdlog::debug("{}: fetch complete", module_name_); - } catch (std::exception const& e) { - spdlog::error("{}: {}", module_name_, e.what()); - state_ = MPD_STATE_UNKNOWN; +std::thread waybar::modules::MPD::event_listener() { + return std::thread([this] { + while (true) { + try { + if (connection_ == nullptr) { + // Retry periodically if no connection + dp.emit(); + std::this_thread::sleep_for(interval_); + } else { + waitForEvent(); + dp.emit(); + } + } catch (const std::exception& e) { + if (strcmp(e.what(), "Connection to MPD closed") == 0) { + spdlog::debug("{}: {}", module_name_, e.what()); + } else { + spdlog::warn("{}: {}", module_name_, e.what()); + } + } } - - dp.emit(); - } + }); } -std::string waybar::modules::MPD::getTag(mpd_tag_type type, unsigned idx) const { +std::thread waybar::modules::MPD::periodic_updater() { + return std::thread([this] { + std::lock_guard guard(periodic_lock_); + while (connection_ != nullptr && playing()) { + dp.emit(); + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + }); +} + +std::string waybar::modules::MPD::getTag(mpd_tag_type type, unsigned idx) { std::string result = config_["unknown-tag"].isString() ? config_["unknown-tag"].asString() : "N/A"; const char* tag = mpd_song_get_tag(song_.get(), type, idx); @@ -99,7 +133,7 @@ void waybar::modules::MPD::setLabel() { auto format = format_; std::string artist, album_artist, album, title, date; - int song_pos, queue_length; + int song_pos, queue_length; std::chrono::seconds elapsedTime, totalTime; std::string stateIcon = ""; @@ -115,8 +149,8 @@ void waybar::modules::MPD::setLabel() { label_.get_style_context()->add_class("playing"); label_.get_style_context()->remove_class("paused"); } else if (paused()) { - format = config_["format-paused"].isString() ? config_["format-paused"].asString() - : config_["format"].asString(); + format = + config_["format-paused"].isString() ? config_["format-paused"].asString() : config_["format"].asString(); label_.get_style_context()->add_class("paused"); label_.get_style_context()->remove_class("playing"); } @@ -182,7 +216,7 @@ void waybar::modules::MPD::setLabel() { } } -std::string waybar::modules::MPD::getStateIcon() const { +std::string waybar::modules::MPD::getStateIcon() { if (!config_["state-icons"].isObject()) { return ""; } @@ -204,7 +238,7 @@ std::string waybar::modules::MPD::getStateIcon() const { } } -std::string waybar::modules::MPD::getOptionIcon(std::string optionName, bool activated) const { +std::string waybar::modules::MPD::getOptionIcon(std::string optionName, bool activated) { if (!config_[optionName + "-icons"].isObject()) { return ""; } @@ -227,11 +261,15 @@ void waybar::modules::MPD::tryConnect() { } connection_ = - detail::unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); + unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); - if (connection_ == nullptr) { + alternate_connection_ = + unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); + + if (connection_ == nullptr || alternate_connection_ == nullptr) { spdlog::error("{}: Failed to connect to MPD", module_name_); connection_.reset(); + alternate_connection_.reset(); return; } @@ -241,6 +279,7 @@ void waybar::modules::MPD::tryConnect() { } catch (std::runtime_error& e) { spdlog::error("{}: Failed to connect to MPD: {}", module_name_, e.what()); connection_.reset(); + alternate_connection_.reset(); } } @@ -253,6 +292,7 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) { case MPD_ERROR_CLOSED: mpd_connection_clear_error(conn); connection_.reset(); + alternate_connection_.reset(); state_ = MPD_STATE_UNKNOWN; throw std::runtime_error("Connection to MPD closed"); default: @@ -266,20 +306,37 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) { } void waybar::modules::MPD::fetchState() { - if (connection_ == nullptr) { - spdlog::error("{}: Not connected to MPD", module_name_); - return; - } - auto conn = connection_.get(); - - status_ = detail::unique_status(mpd_run_status(conn), &mpd_status_free); + status_ = unique_status(mpd_run_status(conn), &mpd_status_free); checkErrors(conn); - state_ = mpd_status_get_state(status_.get()); checkErrors(conn); - song_ = detail::unique_song(mpd_run_current_song(conn), &mpd_song_free); + song_ = unique_song(mpd_run_current_song(conn), &mpd_song_free); + checkErrors(conn); +} + +void waybar::modules::MPD::waitForEvent() { + auto conn = alternate_connection_.get(); + // Wait for a player (play/pause), option (random, shuffle, etc.), or playlist + // change + if (!mpd_send_idle_mask( + conn, static_cast(MPD_IDLE_PLAYER | MPD_IDLE_OPTIONS | MPD_IDLE_QUEUE))) { + checkErrors(conn); + return; + } + // alternate_idle_ = true; + + // See issue #277: + // https://github.com/Alexays/Waybar/issues/277 + mpd_recv_idle(conn, /* disable_timeout = */ false); + // See issue #281: + // https://github.com/Alexays/Waybar/issues/281 + std::lock_guard guard(connection_lock_); + + checkErrors(conn); + mpd_response_finish(conn); + checkErrors(conn); } @@ -289,13 +346,24 @@ bool waybar::modules::MPD::handlePlayPause(GdkEventButton* const& e) { } if (e->button == 1) { - if (state_ == MPD_STATE_PLAY) - context_.pause(); - else - context_.play(); + std::lock_guard guard(connection_lock_); + if (stopped()) { + mpd_run_play(connection_.get()); + } else { + mpd_run_toggle_pause(connection_.get()); + } } else if (e->button == 3) { - context_.stop(); + std::lock_guard guard(connection_lock_); + mpd_run_stop(connection_.get()); } return true; } + +bool waybar::modules::MPD::stopped() { + return connection_ == nullptr || state_ == MPD_STATE_UNKNOWN || state_ == MPD_STATE_STOP || status_ == nullptr; +} + +bool waybar::modules::MPD::playing() { return connection_ != nullptr && state_ == MPD_STATE_PLAY; } + +bool waybar::modules::MPD::paused() { return connection_ != nullptr && state_ == MPD_STATE_PAUSE; } diff --git a/src/modules/mpd/state.cpp b/src/modules/mpd/state.cpp deleted file mode 100644 index 21b67ae..0000000 --- a/src/modules/mpd/state.cpp +++ /dev/null @@ -1,382 +0,0 @@ -#include "modules/mpd/state.hpp" - -#include -#include - -#include "modules/mpd/mpd.hpp" -#if defined(MPD_NOINLINE) -namespace waybar::modules { -#include "modules/mpd/state.inl.hpp" -} // namespace waybar::modules -#endif - -namespace waybar::modules::detail { - -#define IDLE_RUN_NOIDLE_AND_CMD(...) \ - if (idle_connection_.connected()) { \ - idle_connection_.disconnect(); \ - auto conn = ctx_->connection().get(); \ - if (!mpd_run_noidle(conn)) { \ - if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS) { \ - spdlog::error("mpd: Idle: failed to unregister for IDLE events"); \ - ctx_->checkErrors(conn); \ - } \ - } \ - __VA_ARGS__; \ - } - -void Idle::play() { - IDLE_RUN_NOIDLE_AND_CMD(mpd_run_play(conn)); - - ctx_->setState(std::make_unique(ctx_)); -} - -void Idle::pause() { - IDLE_RUN_NOIDLE_AND_CMD(mpd_run_pause(conn, true)); - - ctx_->setState(std::make_unique(ctx_)); -} - -void Idle::stop() { - IDLE_RUN_NOIDLE_AND_CMD(mpd_run_stop(conn)); - - ctx_->setState(std::make_unique(ctx_)); -} - -#undef IDLE_RUN_NOIDLE_AND_CMD - -void Idle::update() noexcept { - // This is intentionally blank. -} - -void Idle::entry() noexcept { - auto conn = ctx_->connection().get(); - assert(conn != nullptr); - - if (!mpd_send_idle_mask( - conn, static_cast(MPD_IDLE_PLAYER | MPD_IDLE_OPTIONS | MPD_IDLE_QUEUE))) { - ctx_->checkErrors(conn); - spdlog::error("mpd: Idle: failed to register for IDLE events"); - } else { - spdlog::debug("mpd: Idle: watching FD"); - sigc::slot idle_slot = sigc::mem_fun(*this, &Idle::on_io); - idle_connection_ = - Glib::signal_io().connect(idle_slot, - mpd_connection_get_fd(conn), - Glib::IO_IN | Glib::IO_PRI | Glib::IO_ERR | Glib::IO_HUP); - } -} - -void Idle::exit() noexcept { - if (idle_connection_.connected()) { - idle_connection_.disconnect(); - spdlog::debug("mpd: Idle: unwatching FD"); - } -} - -bool Idle::on_io(Glib::IOCondition const&) { - auto conn = ctx_->connection().get(); - - // callback should do this: - enum mpd_idle events = mpd_recv_idle(conn, /* ignore_timeout?= */ false); - spdlog::debug("mpd: Idle: recv_idle events -> {}", events); - - mpd_response_finish(conn); - try { - ctx_->checkErrors(conn); - } catch (std::exception const& e) { - spdlog::warn("mpd: Idle: error: {}", e.what()); - ctx_->setState(std::make_unique(ctx_)); - return false; - } - - ctx_->fetchState(); - mpd_state state = ctx_->state(); - - if (state == MPD_STATE_STOP) { - ctx_->emit(); - ctx_->setState(std::make_unique(ctx_)); - } else if (state == MPD_STATE_PLAY) { - ctx_->emit(); - ctx_->setState(std::make_unique(ctx_)); - } else if (state == MPD_STATE_PAUSE) { - ctx_->emit(); - ctx_->setState(std::make_unique(ctx_)); - } else { - ctx_->emit(); - // self transition - ctx_->setState(std::make_unique(ctx_)); - } - - return false; -} - -void Playing::entry() noexcept { - sigc::slot timer_slot = sigc::mem_fun(*this, &Playing::on_timer); - timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 1'000); - spdlog::debug("mpd: Playing: enabled 1 second periodic timer."); -} - -void Playing::exit() noexcept { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - spdlog::debug("mpd: Playing: disabled 1 second periodic timer."); - } -} - -bool Playing::on_timer() { - // Attempt to connect with MPD. - try { - ctx_->tryConnect(); - - // Success? - if (!ctx_->is_connected()) { - ctx_->setState(std::make_unique(ctx_)); - return false; - } - - ctx_->fetchState(); - - if (!ctx_->is_playing()) { - if (ctx_->is_paused()) { - ctx_->setState(std::make_unique(ctx_)); - } else { - ctx_->setState(std::make_unique(ctx_)); - } - return false; - } - - ctx_->queryMPD(); - ctx_->emit(); - } catch (std::exception const& e) { - spdlog::warn("mpd: Playing: error: {}", e.what()); - ctx_->setState(std::make_unique(ctx_)); - return false; - } - - return true; -} - -void Playing::stop() { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - - mpd_run_stop(ctx_->connection().get()); - } - - ctx_->setState(std::make_unique(ctx_)); -} - -void Playing::pause() { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - - mpd_run_pause(ctx_->connection().get(), true); - } - - ctx_->setState(std::make_unique(ctx_)); -} - -void Playing::update() noexcept { ctx_->do_update(); } - -void Paused::entry() noexcept { - sigc::slot timer_slot = sigc::mem_fun(*this, &Paused::on_timer); - timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 200); - spdlog::debug("mpd: Paused: enabled 200 ms periodic timer."); -} - -void Paused::exit() noexcept { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - spdlog::debug("mpd: Paused: disabled 200 ms periodic timer."); - } -} - -bool Paused::on_timer() { - bool rc = true; - - // Attempt to connect with MPD. - try { - ctx_->tryConnect(); - - // Success? - if (!ctx_->is_connected()) { - ctx_->setState(std::make_unique(ctx_)); - return false; - } - - ctx_->fetchState(); - - ctx_->emit(); - - if (ctx_->is_paused()) { - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } else if (ctx_->is_playing()) { - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } else if (ctx_->is_stopped()) { - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } - } catch (std::exception const& e) { - spdlog::warn("mpd: Paused: error: {}", e.what()); - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } - - return rc; -} - -void Paused::play() { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - - mpd_run_play(ctx_->connection().get()); - } - - ctx_->setState(std::make_unique(ctx_)); -} - -void Paused::stop() { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - - mpd_run_stop(ctx_->connection().get()); - } - - ctx_->setState(std::make_unique(ctx_)); -} - -void Paused::update() noexcept { ctx_->do_update(); } - -void Stopped::entry() noexcept { - sigc::slot timer_slot = sigc::mem_fun(*this, &Stopped::on_timer); - timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 200); - spdlog::debug("mpd: Stopped: enabled 200 ms periodic timer."); -} - -void Stopped::exit() noexcept { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - spdlog::debug("mpd: Stopped: disabled 200 ms periodic timer."); - } -} - -bool Stopped::on_timer() { - bool rc = true; - - // Attempt to connect with MPD. - try { - ctx_->tryConnect(); - - // Success? - if (!ctx_->is_connected()) { - ctx_->setState(std::make_unique(ctx_)); - return false; - } - - ctx_->fetchState(); - - ctx_->emit(); - - if (ctx_->is_stopped()) { - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } else if (ctx_->is_playing()) { - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } else if (ctx_->is_paused()) { - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } - } catch (std::exception const& e) { - spdlog::warn("mpd: Stopped: error: {}", e.what()); - ctx_->setState(std::make_unique(ctx_)); - rc = false; - } - - return rc; -} - -void Stopped::play() { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - - mpd_run_play(ctx_->connection().get()); - } - - ctx_->setState(std::make_unique(ctx_)); -} - -void Stopped::pause() { - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - - mpd_run_pause(ctx_->connection().get(), true); - } - - ctx_->setState(std::make_unique(ctx_)); -} - -void Stopped::update() noexcept { ctx_->do_update(); } - -void Disconnected::arm_timer(int interval) noexcept { - // unregister timer, if present - disarm_timer(); - - // register timer - sigc::slot timer_slot = sigc::mem_fun(*this, &Disconnected::on_timer); - timer_connection_ = - Glib::signal_timeout().connect(timer_slot, interval); - spdlog::debug("mpd: Disconnected: enabled interval timer."); -} - -void Disconnected::disarm_timer() noexcept { - // unregister timer, if present - if (timer_connection_.connected()) { - timer_connection_.disconnect(); - spdlog::debug("mpd: Disconnected: disabled interval timer."); - } -} - -void Disconnected::entry() noexcept { - arm_timer(1'000); -} - -void Disconnected::exit() noexcept { - disarm_timer(); -} - -bool Disconnected::on_timer() { - // Attempt to connect with MPD. - try { - ctx_->tryConnect(); - - // Success? - if (ctx_->is_connected()) { - ctx_->fetchState(); - ctx_->emit(); - - if (ctx_->is_playing()) { - ctx_->setState(std::make_unique(ctx_)); - } else if (ctx_->is_paused()) { - ctx_->setState(std::make_unique(ctx_)); - } else { - ctx_->setState(std::make_unique(ctx_)); - } - - return false; // do not rearm timer - } - } catch (std::exception const& e) { - spdlog::warn("mpd: Disconnected: error: {}", e.what()); - } - - arm_timer(ctx_->interval() * 1'000); - - return false; -} - -void Disconnected::update() noexcept { ctx_->do_update(); } - -} // namespace waybar::modules::detail From 8f961ac3976048d7a389d77737d9694f26fe863d Mon Sep 17 00:00:00 2001 From: Joseph Benden Date: Sat, 3 Oct 2020 22:01:51 -0700 Subject: [PATCH 056/303] mpd: revamped to event-driven, single-threaded Fix MPD connection issues by converting/rewriting module into a state-machine driven system. It is fully single-threaded and uses events for transitioning between states. It supports all features and functionality of the previous MPD module. Signed-off-by: Joseph Benden --- include/factory.hpp | 2 +- include/modules/mpd.hpp | 74 ------ include/modules/mpd/mpd.hpp | 66 ++++++ include/modules/mpd/state.hpp | 217 +++++++++++++++++ include/modules/mpd/state.inl.hpp | 24 ++ meson.build | 3 +- src/modules/{ => mpd}/mpd.cpp | 154 ++++-------- src/modules/mpd/state.cpp | 382 ++++++++++++++++++++++++++++++ 8 files changed, 735 insertions(+), 187 deletions(-) delete mode 100644 include/modules/mpd.hpp create mode 100644 include/modules/mpd/mpd.hpp create mode 100644 include/modules/mpd/state.hpp create mode 100644 include/modules/mpd/state.inl.hpp rename src/modules/{ => mpd}/mpd.cpp (73%) create mode 100644 src/modules/mpd/state.cpp diff --git a/include/factory.hpp b/include/factory.hpp index 3efe6cb..f73c6e1 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -37,7 +37,7 @@ #include "modules/pulseaudio.hpp" #endif #ifdef HAVE_LIBMPDCLIENT -#include "modules/mpd.hpp" +#include "modules/mpd/mpd.hpp" #endif #ifdef HAVE_LIBSNDIO #include "modules/sndio.hpp" diff --git a/include/modules/mpd.hpp b/include/modules/mpd.hpp deleted file mode 100644 index d08b28b..0000000 --- a/include/modules/mpd.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include "ALabel.hpp" - -namespace waybar::modules { - -class MPD : public ALabel { - public: - MPD(const std::string&, const Json::Value&); - auto update() -> void; - - private: - std::thread periodic_updater(); - std::string getTag(mpd_tag_type type, unsigned idx = 0); - void setLabel(); - std::string getStateIcon(); - std::string getOptionIcon(std::string optionName, bool activated); - - std::thread event_listener(); - - // Assumes `connection_lock_` is locked - void tryConnect(); - // If checking errors on the main connection, make sure to lock it using - // `connection_lock_` before calling checkErrors - void checkErrors(mpd_connection* conn); - - // Assumes `connection_lock_` is locked - void fetchState(); - void waitForEvent(); - - bool handlePlayPause(GdkEventButton* const&); - - bool stopped(); - bool playing(); - bool paused(); - - const std::string module_name_; - - using unique_connection = std::unique_ptr; - using unique_status = std::unique_ptr; - using unique_song = std::unique_ptr; - - // Not using unique_ptr since we don't manage the pointer - // (It's either nullptr, or from the config) - const char* server_; - const unsigned port_; - - unsigned timeout_; - - // We need a mutex here because we can trigger updates from multiple thread: - // the event based updates, the periodic updates needed for the elapsed time, - // and the click play/pause feature - std::mutex connection_lock_; - unique_connection connection_; - // The alternate connection will be used to wait for events: since it will - // be blocking (idle) we can't send commands via this connection - // - // No lock since only used in the event listener thread - unique_connection alternate_connection_; - - // Protect them using the `connection_lock_` - unique_status status_; - mpd_state state_; - unique_song song_; - - // To make sure the previous periodic_updater stops before creating a new one - std::mutex periodic_lock_; -}; - -} // namespace waybar::modules diff --git a/include/modules/mpd/mpd.hpp b/include/modules/mpd/mpd.hpp new file mode 100644 index 0000000..f92df93 --- /dev/null +++ b/include/modules/mpd/mpd.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include +#include +#include + +#include +#include + +#include "ALabel.hpp" +#include "modules/mpd/state.hpp" + +namespace waybar::modules { + +class MPD : public ALabel { + friend class detail::Context; + + // State machine + detail::Context context_{this}; + + const std::string module_name_; + + // Not using unique_ptr since we don't manage the pointer + // (It's either nullptr, or from the config) + const char* server_; + const unsigned port_; + + unsigned timeout_; + + detail::unique_connection connection_; + + detail::unique_status status_; + mpd_state state_; + detail::unique_song song_; + + public: + MPD(const std::string&, const Json::Value&); + virtual ~MPD() noexcept = default; + auto update() -> void; + + private: + std::string getTag(mpd_tag_type type, unsigned idx = 0) const; + void setLabel(); + std::string getStateIcon() const; + std::string getOptionIcon(std::string optionName, bool activated) const; + + // GUI-side methods + bool handlePlayPause(GdkEventButton* const&); + void emit() { dp.emit(); } + + // MPD-side, Non-GUI methods. + void tryConnect(); + void checkErrors(mpd_connection* conn); + void fetchState(); + void queryMPD(); + + inline bool stopped() const { return connection_ && state_ == MPD_STATE_STOP; } + inline bool playing() const { return connection_ && state_ == MPD_STATE_PLAY; } + inline bool paused() const { return connection_ && state_ == MPD_STATE_PAUSE; } +}; + +#if !defined(MPD_NOINLINE) +#include "modules/mpd/state.inl.hpp" +#endif + +} // namespace waybar::modules diff --git a/include/modules/mpd/state.hpp b/include/modules/mpd/state.hpp new file mode 100644 index 0000000..3b18159 --- /dev/null +++ b/include/modules/mpd/state.hpp @@ -0,0 +1,217 @@ +#pragma once + +#include +#include +#include + +#include +#include + +#include "ALabel.hpp" + +namespace waybar::modules { +class MPD; +} // namespace waybar::modules + +namespace waybar::modules::detail { + +using unique_connection = std::unique_ptr; +using unique_status = std::unique_ptr; +using unique_song = std::unique_ptr; + +class Context; + +/// This state machine loosely follows a non-hierarchical, statechart +/// pattern, and includes ENTRY and EXIT actions. +/// +/// The State class is the base class for all other states. The +/// entry and exit methods are automatically called when entering +/// into a new state and exiting from the current state. This +/// includes initially entering (Disconnected class) and exiting +/// Waybar. +/// +/// The following nested "top-level" states are represented: +/// 1. Idle - await notification of MPD activity. +/// 2. All Non-Idle states: +/// 1. Playing - An active song is producing audio output. +/// 2. Paused - The current song is paused. +/// 3. Stopped - No song is actively playing. +/// 3. Disconnected - periodically attempt MPD (re-)connection. +/// +/// NOTE: Since this statechart is non-hierarchical, the above +/// states are flattened into a set. + +class State { + public: + virtual ~State() noexcept = default; + + virtual void entry() noexcept { spdlog::debug("mpd: ignore entry action"); } + virtual void exit() noexcept { spdlog::debug("mpd: ignore exit action"); } + + virtual void play() { spdlog::debug("mpd: ignore play state transition"); } + virtual void stop() { spdlog::debug("mpd: ignore stop state transition"); } + virtual void pause() { spdlog::debug("mpd: ignore pause state transition"); } + + /// Request state update the GUI. + virtual void update() noexcept { spdlog::debug("mpd: ignoring update method request"); } +}; + +class Idle : public State { + Context* const ctx_; + sigc::connection idle_connection_; + + public: + Idle(Context* const ctx) : ctx_{ctx} {} + virtual ~Idle() noexcept { this->exit(); }; + + void entry() noexcept override; + void exit() noexcept override; + + void play() override; + void stop() override; + void pause() override; + void update() noexcept override; + + private: + Idle(const Idle&) = delete; + Idle& operator=(const Idle&) = delete; + + bool on_io(Glib::IOCondition const&); +}; + +class Playing : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Playing(Context* const ctx) : ctx_{ctx} {} + virtual ~Playing() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void pause() override; + void stop() override; + void update() noexcept override; + + private: + Playing(Playing const&) = delete; + Playing& operator=(Playing const&) = delete; + + bool on_timer(); +}; + +class Paused : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Paused(Context* const ctx) : ctx_{ctx} {} + virtual ~Paused() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void play() override; + void stop() override; + void update() noexcept override; + + private: + Paused(Paused const&) = delete; + Paused& operator=(Paused const&) = delete; + + bool on_timer(); +}; + +class Stopped : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Stopped(Context* const ctx) : ctx_{ctx} {} + virtual ~Stopped() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void play() override; + void pause() override; + void update() noexcept override; + + private: + Stopped(Stopped const&) = delete; + Stopped& operator=(Stopped const&) = delete; + + bool on_timer(); +}; + +class Disconnected : public State { + Context* const ctx_; + sigc::connection timer_connection_; + + public: + Disconnected(Context* const ctx) : ctx_{ctx} {} + virtual ~Disconnected() noexcept { this->exit(); } + + void entry() noexcept override; + void exit() noexcept override; + + void update() noexcept override; + + private: + Disconnected(Disconnected const&) = delete; + Disconnected& operator=(Disconnected const&) = delete; + + void arm_timer(int interval) noexcept; + void disarm_timer() noexcept; + + bool on_timer(); +}; + +class Context { + std::unique_ptr state_; + waybar::modules::MPD* mpd_module_; + + friend class State; + friend class Playing; + friend class Paused; + friend class Stopped; + friend class Disconnected; + friend class Idle; + + protected: + void setState(std::unique_ptr&& new_state) noexcept { + if (state_.get() != nullptr) { + state_->exit(); + } + state_ = std::move(new_state); + state_->entry(); + } + + bool is_connected() const; + bool is_playing() const; + bool is_paused() const; + bool is_stopped() const; + constexpr std::size_t interval() const; + void tryConnect() const; + void checkErrors(mpd_connection*) const; + void do_update(); + void queryMPD() const; + void fetchState() const; + constexpr mpd_state state() const; + void emit() const; + [[nodiscard]] unique_connection& connection(); + + public: + explicit Context(waybar::modules::MPD* const mpd_module) + : state_{std::make_unique(this)}, mpd_module_{mpd_module} { + state_->entry(); + } + + void play() { state_->play(); } + void stop() { state_->stop(); } + void pause() { state_->pause(); } + void update() noexcept { state_->update(); } +}; + +} // namespace waybar::modules::detail diff --git a/include/modules/mpd/state.inl.hpp b/include/modules/mpd/state.inl.hpp new file mode 100644 index 0000000..0d83b0b --- /dev/null +++ b/include/modules/mpd/state.inl.hpp @@ -0,0 +1,24 @@ +#pragma once + +namespace detail { + +inline bool Context::is_connected() const { return mpd_module_->connection_ != nullptr; } +inline bool Context::is_playing() const { return mpd_module_->playing(); } +inline bool Context::is_paused() const { return mpd_module_->paused(); } +inline bool Context::is_stopped() const { return mpd_module_->stopped(); } + +constexpr inline std::size_t Context::interval() const { return mpd_module_->interval_.count(); } +inline void Context::tryConnect() const { mpd_module_->tryConnect(); } +inline unique_connection& Context::connection() { return mpd_module_->connection_; } +constexpr inline mpd_state Context::state() const { return mpd_module_->state_; } + +inline void Context::do_update() { + mpd_module_->setLabel(); +} + +inline void Context::checkErrors(mpd_connection* conn) const { mpd_module_->checkErrors(conn); } +inline void Context::queryMPD() const { mpd_module_->queryMPD(); } +inline void Context::fetchState() const { mpd_module_->fetchState(); } +inline void Context::emit() const { mpd_module_->emit(); } + +} // namespace detail diff --git a/meson.build b/meson.build index 023894c..de20382 100644 --- a/meson.build +++ b/meson.build @@ -213,7 +213,8 @@ endif if libmpdclient.found() add_project_arguments('-DHAVE_LIBMPDCLIENT', language: 'cpp') - src_files += 'src/modules/mpd.cpp' + src_files += 'src/modules/mpd/mpd.cpp' + src_files += 'src/modules/mpd/state.cpp' endif if gtk_layer_shell.found() diff --git a/src/modules/mpd.cpp b/src/modules/mpd/mpd.cpp similarity index 73% rename from src/modules/mpd.cpp rename to src/modules/mpd/mpd.cpp index 26878b1..edce941 100644 --- a/src/modules/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -1,8 +1,15 @@ -#include "modules/mpd.hpp" +#include "modules/mpd/mpd.hpp" #include #include +#include "modules/mpd/state.hpp" +#if defined(MPD_NOINLINE) +namespace waybar::modules { +#include "modules/mpd/state.inl.hpp" +} // namespace waybar::modules +#endif + waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) : ALabel(config, "mpd", id, "{album} - {artist} - {title}", 5), module_name_(id.empty() ? "mpd" : "mpd#" + id), @@ -10,7 +17,6 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) port_(config_["port"].isUInt() ? config["port"].asUInt() : 0), timeout_(config_["timeout"].isUInt() ? config_["timeout"].asUInt() * 1'000 : 30'000), connection_(nullptr, &mpd_connection_free), - alternate_connection_(nullptr, &mpd_connection_free), status_(nullptr, &mpd_status_free), song_(nullptr, &mpd_song_free) { if (!config_["port"].isNull() && !config_["port"].isUInt()) { @@ -28,73 +34,33 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) server_ = config["server"].asCString(); } - event_listener().detach(); - event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect(sigc::mem_fun(*this, &MPD::handlePlayPause)); } auto waybar::modules::MPD::update() -> void { - std::lock_guard guard(connection_lock_); - tryConnect(); - - if (connection_ != nullptr) { - try { - bool wasPlaying = playing(); - if(!wasPlaying) { - // Wait until the periodic_updater has stopped - std::lock_guard periodic_guard(periodic_lock_); - } - fetchState(); - if (!wasPlaying && playing()) { - periodic_updater().detach(); - } - } catch (const std::exception& e) { - spdlog::error("{}: {}", module_name_, e.what()); - state_ = MPD_STATE_UNKNOWN; - } - } - - setLabel(); + context_.update(); // Call parent update ALabel::update(); } -std::thread waybar::modules::MPD::event_listener() { - return std::thread([this] { - while (true) { - try { - if (connection_ == nullptr) { - // Retry periodically if no connection - dp.emit(); - std::this_thread::sleep_for(interval_); - } else { - waitForEvent(); - dp.emit(); - } - } catch (const std::exception& e) { - if (strcmp(e.what(), "Connection to MPD closed") == 0) { - spdlog::debug("{}: {}", module_name_, e.what()); - } else { - spdlog::warn("{}: {}", module_name_, e.what()); - } - } +void waybar::modules::MPD::queryMPD() { + if (connection_ != nullptr) { + spdlog::debug("{}: fetching state information", module_name_); + try { + fetchState(); + spdlog::debug("{}: fetch complete", module_name_); + } catch (std::exception const& e) { + spdlog::error("{}: {}", module_name_, e.what()); + state_ = MPD_STATE_UNKNOWN; } - }); + + dp.emit(); + } } -std::thread waybar::modules::MPD::periodic_updater() { - return std::thread([this] { - std::lock_guard guard(periodic_lock_); - while (connection_ != nullptr && playing()) { - dp.emit(); - std::this_thread::sleep_for(std::chrono::seconds(1)); - } - }); -} - -std::string waybar::modules::MPD::getTag(mpd_tag_type type, unsigned idx) { +std::string waybar::modules::MPD::getTag(mpd_tag_type type, unsigned idx) const { std::string result = config_["unknown-tag"].isString() ? config_["unknown-tag"].asString() : "N/A"; const char* tag = mpd_song_get_tag(song_.get(), type, idx); @@ -133,7 +99,7 @@ void waybar::modules::MPD::setLabel() { auto format = format_; std::string artist, album_artist, album, title, date; - int song_pos, queue_length; + int song_pos, queue_length; std::chrono::seconds elapsedTime, totalTime; std::string stateIcon = ""; @@ -149,8 +115,8 @@ void waybar::modules::MPD::setLabel() { label_.get_style_context()->add_class("playing"); label_.get_style_context()->remove_class("paused"); } else if (paused()) { - format = - config_["format-paused"].isString() ? config_["format-paused"].asString() : config_["format"].asString(); + format = config_["format-paused"].isString() ? config_["format-paused"].asString() + : config_["format"].asString(); label_.get_style_context()->add_class("paused"); label_.get_style_context()->remove_class("playing"); } @@ -216,7 +182,7 @@ void waybar::modules::MPD::setLabel() { } } -std::string waybar::modules::MPD::getStateIcon() { +std::string waybar::modules::MPD::getStateIcon() const { if (!config_["state-icons"].isObject()) { return ""; } @@ -238,7 +204,7 @@ std::string waybar::modules::MPD::getStateIcon() { } } -std::string waybar::modules::MPD::getOptionIcon(std::string optionName, bool activated) { +std::string waybar::modules::MPD::getOptionIcon(std::string optionName, bool activated) const { if (!config_[optionName + "-icons"].isObject()) { return ""; } @@ -261,15 +227,11 @@ void waybar::modules::MPD::tryConnect() { } connection_ = - unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); + detail::unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); - alternate_connection_ = - unique_connection(mpd_connection_new(server_, port_, timeout_), &mpd_connection_free); - - if (connection_ == nullptr || alternate_connection_ == nullptr) { + if (connection_ == nullptr) { spdlog::error("{}: Failed to connect to MPD", module_name_); connection_.reset(); - alternate_connection_.reset(); return; } @@ -279,7 +241,6 @@ void waybar::modules::MPD::tryConnect() { } catch (std::runtime_error& e) { spdlog::error("{}: Failed to connect to MPD: {}", module_name_, e.what()); connection_.reset(); - alternate_connection_.reset(); } } @@ -292,7 +253,6 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) { case MPD_ERROR_CLOSED: mpd_connection_clear_error(conn); connection_.reset(); - alternate_connection_.reset(); state_ = MPD_STATE_UNKNOWN; throw std::runtime_error("Connection to MPD closed"); default: @@ -306,37 +266,20 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) { } void waybar::modules::MPD::fetchState() { + if (connection_ == nullptr) { + spdlog::error("{}: Not connected to MPD", module_name_); + return; + } + auto conn = connection_.get(); - status_ = unique_status(mpd_run_status(conn), &mpd_status_free); + + status_ = detail::unique_status(mpd_run_status(conn), &mpd_status_free); checkErrors(conn); + state_ = mpd_status_get_state(status_.get()); checkErrors(conn); - song_ = unique_song(mpd_run_current_song(conn), &mpd_song_free); - checkErrors(conn); -} - -void waybar::modules::MPD::waitForEvent() { - auto conn = alternate_connection_.get(); - // Wait for a player (play/pause), option (random, shuffle, etc.), or playlist - // change - if (!mpd_send_idle_mask( - conn, static_cast(MPD_IDLE_PLAYER | MPD_IDLE_OPTIONS | MPD_IDLE_QUEUE))) { - checkErrors(conn); - return; - } - // alternate_idle_ = true; - - // See issue #277: - // https://github.com/Alexays/Waybar/issues/277 - mpd_recv_idle(conn, /* disable_timeout = */ false); - // See issue #281: - // https://github.com/Alexays/Waybar/issues/281 - std::lock_guard guard(connection_lock_); - - checkErrors(conn); - mpd_response_finish(conn); - + song_ = detail::unique_song(mpd_run_current_song(conn), &mpd_song_free); checkErrors(conn); } @@ -346,24 +289,13 @@ bool waybar::modules::MPD::handlePlayPause(GdkEventButton* const& e) { } if (e->button == 1) { - std::lock_guard guard(connection_lock_); - if (stopped()) { - mpd_run_play(connection_.get()); - } else { - mpd_run_toggle_pause(connection_.get()); - } + if (state_ == MPD_STATE_PLAY) + context_.pause(); + else + context_.play(); } else if (e->button == 3) { - std::lock_guard guard(connection_lock_); - mpd_run_stop(connection_.get()); + context_.stop(); } return true; } - -bool waybar::modules::MPD::stopped() { - return connection_ == nullptr || state_ == MPD_STATE_UNKNOWN || state_ == MPD_STATE_STOP || status_ == nullptr; -} - -bool waybar::modules::MPD::playing() { return connection_ != nullptr && state_ == MPD_STATE_PLAY; } - -bool waybar::modules::MPD::paused() { return connection_ != nullptr && state_ == MPD_STATE_PAUSE; } diff --git a/src/modules/mpd/state.cpp b/src/modules/mpd/state.cpp new file mode 100644 index 0000000..570c167 --- /dev/null +++ b/src/modules/mpd/state.cpp @@ -0,0 +1,382 @@ +#include "modules/mpd/state.hpp" + +#include +#include + +#include "modules/mpd/mpd.hpp" +#if defined(MPD_NOINLINE) +namespace waybar::modules { +#include "modules/mpd/state.inl.hpp" +} // namespace waybar::modules +#endif + +namespace waybar::modules::detail { + +#define IDLE_RUN_NOIDLE_AND_CMD(...) \ + if (idle_connection_.connected()) { \ + idle_connection_.disconnect(); \ + auto conn = ctx_->connection().get(); \ + if (!mpd_run_noidle(conn)) { \ + if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS) { \ + spdlog::error("mpd: Idle: failed to unregister for IDLE events"); \ + ctx_->checkErrors(conn); \ + } \ + } \ + __VA_ARGS__; \ + } + +void Idle::play() { + IDLE_RUN_NOIDLE_AND_CMD(mpd_run_play(conn)); + + ctx_->setState(std::make_unique(ctx_)); +} + +void Idle::pause() { + IDLE_RUN_NOIDLE_AND_CMD(mpd_run_pause(conn, true)); + + ctx_->setState(std::make_unique(ctx_)); +} + +void Idle::stop() { + IDLE_RUN_NOIDLE_AND_CMD(mpd_run_stop(conn)); + + ctx_->setState(std::make_unique(ctx_)); +} + +#undef IDLE_RUN_NOIDLE_AND_CMD + +void Idle::update() noexcept { + // This is intentionally blank. +} + +void Idle::entry() noexcept { + auto conn = ctx_->connection().get(); + assert(conn != nullptr); + + if (!mpd_send_idle_mask( + conn, static_cast(MPD_IDLE_PLAYER | MPD_IDLE_OPTIONS | MPD_IDLE_QUEUE))) { + ctx_->checkErrors(conn); + spdlog::error("mpd: Idle: failed to register for IDLE events"); + } else { + spdlog::debug("mpd: Idle: watching FD"); + sigc::slot idle_slot = sigc::mem_fun(*this, &Idle::on_io); + idle_connection_ = + Glib::signal_io().connect(idle_slot, + mpd_connection_get_fd(conn), + Glib::IO_IN | Glib::IO_PRI | Glib::IO_ERR | Glib::IO_HUP); + } +} + +void Idle::exit() noexcept { + if (idle_connection_.connected()) { + idle_connection_.disconnect(); + spdlog::debug("mpd: Idle: unwatching FD"); + } +} + +bool Idle::on_io(Glib::IOCondition const&) { + auto conn = ctx_->connection().get(); + + // callback should do this: + enum mpd_idle events = mpd_recv_idle(conn, /* ignore_timeout?= */ false); + spdlog::debug("mpd: Idle: recv_idle events -> {}", events); + + mpd_response_finish(conn); + try { + ctx_->checkErrors(conn); + } catch (std::exception const& e) { + spdlog::warn("mpd: Idle: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + mpd_state state = ctx_->state(); + + if (state == MPD_STATE_STOP) { + ctx_->emit(); + ctx_->setState(std::make_unique(ctx_)); + } else if (state == MPD_STATE_PLAY) { + ctx_->emit(); + ctx_->setState(std::make_unique(ctx_)); + } else if (state == MPD_STATE_PAUSE) { + ctx_->emit(); + ctx_->setState(std::make_unique(ctx_)); + } else { + ctx_->emit(); + // self transition + ctx_->setState(std::make_unique(ctx_)); + } + + return false; +} + +void Playing::entry() noexcept { + sigc::slot timer_slot = sigc::mem_fun(*this, &Playing::on_timer); + timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 1'000); + spdlog::debug("mpd: Playing: enabled 1 second periodic timer."); +} + +void Playing::exit() noexcept { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Playing: disabled 1 second periodic timer."); + } +} + +bool Playing::on_timer() { + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (!ctx_->is_connected()) { + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + + if (!ctx_->is_playing()) { + if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + } else { + ctx_->setState(std::make_unique(ctx_)); + } + return false; + } + + ctx_->queryMPD(); + ctx_->emit(); + } catch (std::exception const& e) { + spdlog::warn("mpd: Playing: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + return true; +} + +void Playing::stop() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_stop(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Playing::pause() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_pause(ctx_->connection().get(), true); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Playing::update() noexcept { ctx_->do_update(); } + +void Paused::entry() noexcept { + sigc::slot timer_slot = sigc::mem_fun(*this, &Paused::on_timer); + timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 200); + spdlog::debug("mpd: Paused: enabled 200 ms periodic timer."); +} + +void Paused::exit() noexcept { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Paused: disabled 200 ms periodic timer."); + } +} + +bool Paused::on_timer() { + bool rc = true; + + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (!ctx_->is_connected()) { + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + + ctx_->emit(); + + if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_playing()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_stopped()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + } catch (std::exception const& e) { + spdlog::warn("mpd: Paused: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + + return rc; +} + +void Paused::play() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_play(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Paused::stop() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_stop(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Paused::update() noexcept { ctx_->do_update(); } + +void Stopped::entry() noexcept { + sigc::slot timer_slot = sigc::mem_fun(*this, &Stopped::on_timer); + timer_connection_ = Glib::signal_timeout().connect(timer_slot, /* milliseconds */ 200); + spdlog::debug("mpd: Stopped: enabled 200 ms periodic timer."); +} + +void Stopped::exit() noexcept { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Stopped: disabled 200 ms periodic timer."); + } +} + +bool Stopped::on_timer() { + bool rc = true; + + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (!ctx_->is_connected()) { + ctx_->setState(std::make_unique(ctx_)); + return false; + } + + ctx_->fetchState(); + + ctx_->emit(); + + if (ctx_->is_stopped()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_playing()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } else if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + } catch (std::exception const& e) { + spdlog::warn("mpd: Stopped: error: {}", e.what()); + ctx_->setState(std::make_unique(ctx_)); + rc = false; + } + + return rc; +} + +void Stopped::play() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_play(ctx_->connection().get()); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Stopped::pause() { + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + + mpd_run_pause(ctx_->connection().get(), true); + } + + ctx_->setState(std::make_unique(ctx_)); +} + +void Stopped::update() noexcept { ctx_->do_update(); } + +void Disconnected::arm_timer(int interval) noexcept { + // unregister timer, if present + disarm_timer(); + + // register timer + sigc::slot timer_slot = sigc::mem_fun(*this, &Disconnected::on_timer); + timer_connection_ = + Glib::signal_timeout().connect(timer_slot, interval); + spdlog::debug("mpd: Disconnected: enabled interval timer."); +} + +void Disconnected::disarm_timer() noexcept { + // unregister timer, if present + if (timer_connection_.connected()) { + timer_connection_.disconnect(); + spdlog::debug("mpd: Disconnected: disabled interval timer."); + } +} + +void Disconnected::entry() noexcept { + arm_timer(1'000); +} + +void Disconnected::exit() noexcept { + disarm_timer(); +} + +bool Disconnected::on_timer() { + // Attempt to connect with MPD. + try { + ctx_->tryConnect(); + + // Success? + if (ctx_->is_connected()) { + ctx_->fetchState(); + ctx_->emit(); + + if (ctx_->is_playing()) { + ctx_->setState(std::make_unique(ctx_)); + } else if (ctx_->is_paused()) { + ctx_->setState(std::make_unique(ctx_)); + } else { + ctx_->setState(std::make_unique(ctx_)); + } + + return false; // do not rearm timer + } + } catch (std::exception const& e) { + spdlog::warn("mpd: Disconnected: error: {}", e.what()); + } + + arm_timer(ctx_->interval() * 1'000); + + return false; +} + +void Disconnected::update() noexcept { ctx_->do_update(); } + +} // namespace waybar::modules::detail From 587eb5fdb4d7de2891fa0a874f7c4ea0c9d4d882 Mon Sep 17 00:00:00 2001 From: Joseph Benden Date: Mon, 19 Oct 2020 11:54:36 -0700 Subject: [PATCH 057/303] mpd: support password protected MPD - Add MPD module option `password`, and document it. - Add logic to send the password, directly after connecting to MPD. Fixes: #576 Signed-off-by: Joseph Benden --- include/modules/mpd/mpd.hpp | 7 ++++--- man/waybar-mpd.5.scd | 4 ++++ src/modules/mpd/mpd.cpp | 11 +++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/modules/mpd/mpd.hpp b/include/modules/mpd/mpd.hpp index f92df93..0fc1ce9 100644 --- a/include/modules/mpd/mpd.hpp +++ b/include/modules/mpd/mpd.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #include #include @@ -22,8 +22,9 @@ class MPD : public ALabel { // Not using unique_ptr since we don't manage the pointer // (It's either nullptr, or from the config) - const char* server_; - const unsigned port_; + const char* server_; + const unsigned port_; + const std::string password_; unsigned timeout_; diff --git a/man/waybar-mpd.5.scd b/man/waybar-mpd.5.scd index e8105de..8c33c62 100644 --- a/man/waybar-mpd.5.scd +++ b/man/waybar-mpd.5.scd @@ -20,6 +20,10 @@ Addressed by *mpd* typeof: integer ++ The port MPD listens to. If empty, use the default port. +*password*: ++ + typeof: string ++ + The password required to connect to the MPD server. If empty, no password is sent to MPD. + *interval*: ++ typeof: integer++ default: 5 ++ diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index edce941..6dc24e7 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -15,6 +15,7 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config) module_name_(id.empty() ? "mpd" : "mpd#" + id), server_(nullptr), port_(config_["port"].isUInt() ? config["port"].asUInt() : 0), + password_(config_["password"].empty() ? "" : config_["password"].asString()), timeout_(config_["timeout"].isUInt() ? config_["timeout"].asUInt() * 1'000 : 30'000), connection_(nullptr, &mpd_connection_free), status_(nullptr, &mpd_status_free), @@ -238,6 +239,16 @@ void waybar::modules::MPD::tryConnect() { try { checkErrors(connection_.get()); spdlog::debug("{}: Connected to MPD", module_name_); + + if (!password_.empty()) { + bool res = mpd_run_password(connection_.get(), password_.c_str()); + if (!res) { + spdlog::error("{}: Wrong MPD password", module_name_); + connection_.reset(); + return; + } + checkErrors(connection_.get()); + } } catch (std::runtime_error& e) { spdlog::error("{}: Failed to connect to MPD: {}", module_name_, e.what()); connection_.reset(); From ed402d7583291eda34cac4a32b4caac58e7dc900 Mon Sep 17 00:00:00 2001 From: nikto_b Date: Tue, 20 Oct 2020 12:20:58 +0300 Subject: [PATCH 058/303] feature: language submodule - created man page --- man/waybar-sway-language.5.scd | 72 ++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 man/waybar-sway-language.5.scd diff --git a/man/waybar-sway-language.5.scd b/man/waybar-sway-language.5.scd new file mode 100644 index 0000000..a288cca --- /dev/null +++ b/man/waybar-sway-language.5.scd @@ -0,0 +1,72 @@ +waybar-sway-language(5) + +# NAME + +waybar - sway language module + +# DESCRIPTION + +The *language* module displays the current keyboard layout in Sway + +# CONFIGURATION + +Addressed by *sway/language* + +*format*: ++ + typeof: string ++ + default: {} ++ + The format, how information should be displayed. On {} data gets inserted. + +*rotate*: ++ + typeof: integer ++ + Positive value to rotate the text label. + +*max-length*: ++ + typeof: integer ++ + The maximum length in character the module should display. + +*on-click*: ++ + typeof: string ++ + Command to execute when clicked on the module. + +*on-click-middle*: ++ + typeof: string ++ + Command to execute when middle-clicked on the module using mousewheel. + +*on-click-right*: ++ + typeof: string ++ + Command to execute when you right clicked on the module. + +*on-update*: ++ + typeof: string ++ + Command to execute when the module is updated. + +*on-scroll-up*: ++ + typeof: string ++ + Command to execute when scrolling up on the module. + +*on-scroll-down*: ++ + typeof: string ++ + Command to execute when scrolling down on the module. + +*smooth-scrolling-threshold*: ++ + typeof: double ++ + Threshold to be used when scrolling. + +*tooltip*: ++ + typeof: bool ++ + default: true ++ + Option to disable tooltip on hover. + +# EXAMPLES + +``` +"sway/language": { + "format": "{}", + "max-length": 50 +} +``` + +# STYLE + +- *#language* From be3f47b37437e11a84031b076ef46802c654c7fe Mon Sep 17 00:00:00 2001 From: Flakebi Date: Fri, 23 Oct 2020 21:13:20 +0200 Subject: [PATCH 059/303] Fix various mpd bugs - Add elapsedTime and totalTime to tooltip format arguments - Catch format exceptions and print error - Copy mpd connection error message before it gets freed - Update display after connection to mpd was lost --- src/modules/mpd/mpd.cpp | 74 ++++++++++++++++++++++----------------- src/modules/mpd/state.cpp | 1 + 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index 6dc24e7..710f23f 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -144,42 +144,51 @@ void waybar::modules::MPD::setLabel() { bool singleActivated = mpd_status_get_single(status_.get()); std::string singleIcon = getOptionIcon("single", singleActivated); - // TODO: format can fail - label_.set_markup( - fmt::format(format, - fmt::arg("artist", Glib::Markup::escape_text(artist).raw()), - fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()), - fmt::arg("album", Glib::Markup::escape_text(album).raw()), - fmt::arg("title", Glib::Markup::escape_text(title).raw()), - fmt::arg("date", Glib::Markup::escape_text(date).raw()), - fmt::arg("elapsedTime", elapsedTime), - fmt::arg("totalTime", totalTime), - fmt::arg("songPosition", song_pos), - fmt::arg("queueLength", queue_length), - fmt::arg("stateIcon", stateIcon), - fmt::arg("consumeIcon", consumeIcon), - fmt::arg("randomIcon", randomIcon), - fmt::arg("repeatIcon", repeatIcon), - fmt::arg("singleIcon", singleIcon))); + try { + label_.set_markup( + fmt::format(format, + fmt::arg("artist", Glib::Markup::escape_text(artist).raw()), + fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()), + fmt::arg("album", Glib::Markup::escape_text(album).raw()), + fmt::arg("title", Glib::Markup::escape_text(title).raw()), + fmt::arg("date", Glib::Markup::escape_text(date).raw()), + fmt::arg("elapsedTime", elapsedTime), + fmt::arg("totalTime", totalTime), + fmt::arg("songPosition", song_pos), + fmt::arg("queueLength", queue_length), + fmt::arg("stateIcon", stateIcon), + fmt::arg("consumeIcon", consumeIcon), + fmt::arg("randomIcon", randomIcon), + fmt::arg("repeatIcon", repeatIcon), + fmt::arg("singleIcon", singleIcon))); + } catch (fmt::format_error const& e) { + spdlog::warn("mpd: format error: {}", e.what()); + } if (tooltipEnabled()) { std::string tooltip_format; tooltip_format = config_["tooltip-format"].isString() ? config_["tooltip-format"].asString() : "MPD (connected)"; - auto tooltip_text = fmt::format(tooltip_format, - fmt::arg("artist", artist), - fmt::arg("albumArtist", album_artist), - fmt::arg("album", album), - fmt::arg("title", title), - fmt::arg("date", date), - fmt::arg("songPosition", song_pos), - fmt::arg("queueLength", queue_length), - fmt::arg("stateIcon", stateIcon), - fmt::arg("consumeIcon", consumeIcon), - fmt::arg("randomIcon", randomIcon), - fmt::arg("repeatIcon", repeatIcon), - fmt::arg("singleIcon", singleIcon)); - label_.set_tooltip_text(tooltip_text); + try { + auto tooltip_text = fmt::format(tooltip_format, + fmt::arg("artist", artist), + fmt::arg("albumArtist", album_artist), + fmt::arg("album", album), + fmt::arg("title", title), + fmt::arg("date", date), + fmt::arg("elapsedTime", elapsedTime), + fmt::arg("totalTime", totalTime), + fmt::arg("songPosition", song_pos), + fmt::arg("queueLength", queue_length), + fmt::arg("stateIcon", stateIcon), + fmt::arg("consumeIcon", consumeIcon), + fmt::arg("randomIcon", randomIcon), + fmt::arg("repeatIcon", repeatIcon), + fmt::arg("singleIcon", singleIcon)); + label_.set_tooltip_text(tooltip_text); + } catch (fmt::format_error const& e) { + spdlog::warn("mpd: format error (tooltip): {}", e.what()); + } } } @@ -269,8 +278,9 @@ void waybar::modules::MPD::checkErrors(mpd_connection* conn) { default: if (conn) { auto error_message = mpd_connection_get_error_message(conn); + std::string error(error_message); mpd_connection_clear_error(conn); - throw std::runtime_error(std::string(error_message)); + throw std::runtime_error(error); } throw std::runtime_error("Invalid connection"); } diff --git a/src/modules/mpd/state.cpp b/src/modules/mpd/state.cpp index 570c167..ffe18e7 100644 --- a/src/modules/mpd/state.cpp +++ b/src/modules/mpd/state.cpp @@ -341,6 +341,7 @@ void Disconnected::disarm_timer() noexcept { } void Disconnected::entry() noexcept { + ctx_->emit(); arm_timer(1'000); } From 67d54ef3d53e5257e465ec556177ea569100263e Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 24 Oct 2020 22:56:24 -0700 Subject: [PATCH 060/303] fix(wlr/taskbar): do not bind to unsupported protocol versions It's not allowed to bind to a higher version of a wayland protocol than supported by the client. Binding wlr-foreign-toplevel-manager-v1 v3 to a generated code for v2 causes errors in libwayland due to a missing handler for `zwlr_foreign_toplevel_handle_v1.parent` event. --- src/client.cpp | 2 ++ src/modules/wlr/taskbar.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client.cpp b/src/client.cpp index 70cc22c..9dd93d8 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -32,6 +32,8 @@ void waybar::Client::handleGlobal(void *data, struct wl_registry *registry, uint const char *interface, uint32_t version) { auto client = static_cast(data); if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) { + // limit version to a highest supported by the client protocol file + version = std::min(version, zwlr_layer_shell_v1_interface.version); client->layer_shell = static_cast( wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, version)); } else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0 && diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 45915dc..8d6fa9b 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -653,9 +653,11 @@ void Taskbar::register_manager(struct wl_registry *registry, uint32_t name, uint spdlog::warn("Register foreign toplevel manager again although already existing!"); return; } - if (version != 2) { + if (version < ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN_SINCE_VERSION) { spdlog::warn("Using different foreign toplevel manager protocol version: {}", version); } + // limit version to a highest supported by the client protocol file + version = std::min(version, zwlr_foreign_toplevel_manager_v1_interface.version); manager_ = static_cast(wl_registry_bind(registry, name, &zwlr_foreign_toplevel_manager_v1_interface, version)); @@ -672,6 +674,7 @@ void Taskbar::register_seat(struct wl_registry *registry, uint32_t name, uint32_ spdlog::warn("Register seat again although already existing!"); return; } + version = std::min(version, wl_seat_interface.version); seat_ = static_cast(wl_registry_bind(registry, name, &wl_seat_interface, version)); } From 7a0c0ca6134dc777e179980d77fc76ca9adb4410 Mon Sep 17 00:00:00 2001 From: 1sixth <67363572+1sixth@users.noreply.github.com> Date: Wed, 28 Oct 2020 19:39:50 +0800 Subject: [PATCH 061/303] replace lowercase "k" with uppercase "K" Other units are all uppercased, so using an uppercased "K" makes it look more consistent (especially when {bandwidthUpBits} or something like that is used). --- include/util/format.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/util/format.hpp b/include/util/format.hpp index 288d8f0..d7d1609 100644 --- a/include/util/format.hpp +++ b/include/util/format.hpp @@ -42,7 +42,7 @@ namespace fmt { template auto format(const pow_format& s, FormatContext &ctx) -> decltype (ctx.out()) { - const char* units[] = { "", "k", "M", "G", "T", "P", nullptr}; + const char* units[] = { "", "K", "M", "G", "T", "P", nullptr}; auto base = s.binary_ ? 1024ull : 1000ll; auto fraction = (double) s.val_; From 2b3d7be9cb7253d852db0214f7c492d6aec8f74a Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 20 Oct 2020 23:18:58 -0700 Subject: [PATCH 062/303] feat(bar): let gtk-layer-shell manage exclusive zone Previous attempts to use auto exclusive zone from gtk-layer-shell failed because gls was expecting real booleans (`TRUE`/`FALSE`) as set_anchor arguments. With that being fixed, gtk_layer_auto_exclusive_zone_enable makes gls handle everything related to the bar resizing. The only remaining purpose of onConfigureGLS is to log warnings and bar size changes; gtk-layer-shell code path no longer needs saved width_ or height_ values. --- src/bar.cpp | 72 ++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/src/bar.cpp b/src/bar.cpp index 8af6b97..7f60b2f 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -2,10 +2,11 @@ #include #endif +#include + #include "bar.hpp" #include "client.hpp" #include "factory.hpp" -#include waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) : output(w_output), @@ -134,33 +135,32 @@ void waybar::Bar::initGtkLayerShell() { gtk_layer_set_monitor(gtk_window, output->monitor->gobj()); gtk_layer_set_namespace(gtk_window, "waybar"); - gtk_layer_set_anchor( - gtk_window, GTK_LAYER_SHELL_EDGE_LEFT, anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT); - gtk_layer_set_anchor( - gtk_window, GTK_LAYER_SHELL_EDGE_RIGHT, anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT); - gtk_layer_set_anchor( - gtk_window, GTK_LAYER_SHELL_EDGE_TOP, anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP); - gtk_layer_set_anchor( - gtk_window, GTK_LAYER_SHELL_EDGE_BOTTOM, anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM); + gtk_layer_set_anchor(gtk_window, + GTK_LAYER_SHELL_EDGE_LEFT, + (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) ? TRUE : FALSE); + gtk_layer_set_anchor(gtk_window, + GTK_LAYER_SHELL_EDGE_RIGHT, + (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT) ? TRUE : FALSE); + gtk_layer_set_anchor(gtk_window, + GTK_LAYER_SHELL_EDGE_TOP, + (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) ? TRUE : FALSE); + gtk_layer_set_anchor(gtk_window, + GTK_LAYER_SHELL_EDGE_BOTTOM, + (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM) ? TRUE : FALSE); gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_LEFT, margins_.left); gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_RIGHT, margins_.right); gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_TOP, margins_.top); gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_BOTTOM, margins_.bottom); - if (width_ > 1 && height_ > 1) { - /* configure events are not emitted if the bar is using initial size */ - setExclusiveZone(width_, height_); - } + setExclusiveZone(width_, height_); } void waybar::Bar::onConfigureGLS(GdkEventConfigure* ev) { /* * GTK wants new size for the window. - * Actual resizing is done within the gtk-layer-shell code; the only remaining action is to apply - * exclusive zone. - * gtk_layer_auto_exclusive_zone_enable() could handle even that, but at the cost of ignoring - * margins on unanchored edge. + * Actual resizing and management of the exclusve zone is handled within the gtk-layer-shell code. + * This event handler only updates stored size of the window and prints some warnings. * * Note: forced resizing to a window smaller than required by GTK would not work with * gtk-layer-shell. @@ -170,14 +170,13 @@ void waybar::Bar::onConfigureGLS(GdkEventConfigure* ev) { spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); } } else { - if (!vertical && height_ > 1 && ev->height > static_cast(height_)) { + if (height_ > 1 && ev->height > static_cast(height_)) { spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); } } width_ = ev->width; height_ = ev->height; spdlog::info(BAR_SIZE_MSG, width_, height_, output->name); - setExclusiveZone(width_, height_); } void waybar::Bar::onMapGLS(GdkEventAny* ev) { @@ -262,26 +261,31 @@ void waybar::Bar::onMap(GdkEventAny* ev) { } void waybar::Bar::setExclusiveZone(uint32_t width, uint32_t height) { - auto zone = 0; - if (visible) { - // exclusive zone already includes margin for anchored edge, - // only opposite margin should be added - if (vertical) { - zone += width; - zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) ? margins_.right : margins_.left; - } else { - zone += height; - zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) ? margins_.bottom : margins_.top; - } - } - spdlog::debug("Set exclusive zone {} for output {}", zone, output->name); - #ifdef HAVE_GTK_LAYER_SHELL if (use_gls_) { - gtk_layer_set_exclusive_zone(window.gobj(), zone); + if (visible) { + spdlog::debug("Enable auto exclusive zone for output {}", output->name); + gtk_layer_auto_exclusive_zone_enable(window.gobj()); + } else { + spdlog::debug("Disable exclusive zone for output {}", output->name); + gtk_layer_set_exclusive_zone(window.gobj(), 0); + } } else #endif { + auto zone = 0; + if (visible) { + // exclusive zone already includes margin for anchored edge, + // only opposite margin should be added + if (vertical) { + zone += width; + zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) ? margins_.right : margins_.left; + } else { + zone += height; + zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) ? margins_.bottom : margins_.top; + } + } + spdlog::debug("Set exclusive zone {} for output {}", zone, output->name); zwlr_layer_surface_v1_set_exclusive_zone(layer_surface_, zone); } } From 7735c80d0e421ab0787f99db6c269895ef856729 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 21 Oct 2020 22:16:12 -0700 Subject: [PATCH 063/303] refactor(bar): Split GLS and raw layer-shell implementations Extract two surface implementations from the bar class: GLSSurfaceImpl and RawSurfaceImpl. This change allowed to remove _all_ surface type conditionals and significantly simplify the Bar code. The change also applies PImpl pattern to the Bar, allowing to remove some headers and fields from `bar.hpp`. --- include/bar.hpp | 62 ++--- src/bar.cpp | 644 ++++++++++++++++++++++++++++-------------------- 2 files changed, 408 insertions(+), 298 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index fdc5a73..df50327 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -7,6 +7,7 @@ #include #include #include + #include "AModule.hpp" #include "idle-inhibit-unstable-v1-client-protocol.h" #include "wlr-layer-shell-unstable-v1-client-protocol.h" @@ -23,13 +24,35 @@ struct waybar_output { nullptr, &zxdg_output_v1_destroy}; }; +struct bar_margins { + int top = 0; + int right = 0; + int bottom = 0; + int left = 0; +}; + +class BarSurface { + protected: + BarSurface() = default; + + public: + virtual void set_exclusive_zone(bool enable) = 0; + virtual void set_layer(const std::string_view &layer) = 0; + virtual void set_margins(const struct bar_margins &margins) = 0; + virtual void set_position(const std::string_view &position) = 0; + virtual void set_size(uint32_t width, uint32_t height) = 0; + + virtual ~BarSurface() = default; +}; + class Bar { public: Bar(struct waybar_output *w_output, const Json::Value &); Bar(const Bar &) = delete; ~Bar() = default; - auto toggle() -> void; + void setVisible(bool visible); + void toggle(); void handleSignal(int); struct waybar_output *output; @@ -40,48 +63,15 @@ class Bar { Gtk::Window window; private: - static constexpr const char *MIN_HEIGHT_MSG = - "Requested height: {} exceeds the minimum height: {} required by the modules"; - static constexpr const char *MIN_WIDTH_MSG = - "Requested width: {} exceeds the minimum width: {} required by the modules"; - static constexpr const char *BAR_SIZE_MSG = - "Bar configured (width: {}, height: {}) for output: {}"; - static constexpr const char *SIZE_DEFINED = - "{} size is defined in the config file so it will stay like that"; - static void layerSurfaceHandleConfigure(void *, struct zwlr_layer_surface_v1 *, uint32_t, - uint32_t, uint32_t); - static void layerSurfaceHandleClosed(void *, struct zwlr_layer_surface_v1 *); - -#ifdef HAVE_GTK_LAYER_SHELL - /* gtk-layer-shell code */ - void initGtkLayerShell(); - void onConfigureGLS(GdkEventConfigure *ev); - void onMapGLS(GdkEventAny *ev); -#endif - /* fallback layer-surface code */ - void onConfigure(GdkEventConfigure *ev); - void onRealize(); - void onMap(GdkEventAny *ev); - void setSurfaceSize(uint32_t width, uint32_t height); - /* common code */ - void setExclusiveZone(uint32_t width, uint32_t height); + void onMap(GdkEventAny *); auto setupWidgets() -> void; void getModules(const Factory &, const std::string &); void setupAltFormatKeyForModule(const std::string &module_name); void setupAltFormatKeyForModuleList(const char *module_list_name); - struct margins { - int top = 0; - int right = 0; - int bottom = 0; - int left = 0; - } margins_; - struct zwlr_layer_surface_v1 *layer_surface_; - // use gtk-layer-shell instead of handling layer surfaces directly - bool use_gls_ = false; + std::unique_ptr surface_impl_; uint32_t width_ = 0; uint32_t height_ = 1; - uint8_t anchor_; Gtk::Box left_; Gtk::Box center_; Gtk::Box right_; diff --git a/src/bar.cpp b/src/bar.cpp index 7f60b2f..a684f12 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -8,13 +8,346 @@ #include "client.hpp" #include "factory.hpp" +namespace waybar { +static constexpr const char* MIN_HEIGHT_MSG = + "Requested height: {} exceeds the minimum height: {} required by the modules"; + +static constexpr const char* MIN_WIDTH_MSG = + "Requested width: {} exceeds the minimum width: {} required by the modules"; + +static constexpr const char* BAR_SIZE_MSG = "Bar configured (width: {}, height: {}) for output: {}"; + +static constexpr const char* SIZE_DEFINED = + "{} size is defined in the config file so it will stay like that"; + +#ifdef HAVE_GTK_LAYER_SHELL +struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { + GLSSurfaceImpl(Gtk::Window& window, struct waybar_output& output) : window_{window} { + output_name_ = output.name; + // this has to be executed before GtkWindow.realize + gtk_layer_init_for_window(window_.gobj()); + gtk_layer_set_keyboard_interactivity(window.gobj(), FALSE); + gtk_layer_set_monitor(window_.gobj(), output.monitor->gobj()); + gtk_layer_set_namespace(window_.gobj(), "waybar"); + + window.signal_configure_event().connect_notify( + sigc::mem_fun(*this, &GLSSurfaceImpl::on_configure)); + } + + void set_exclusive_zone(bool enable) override { + if (enable) { + gtk_layer_auto_exclusive_zone_enable(window_.gobj()); + } else { + gtk_layer_set_exclusive_zone(window_.gobj(), 0); + } + } + + void set_margins(const struct bar_margins& margins) override { + gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_LEFT, margins.left); + gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_RIGHT, margins.right); + gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_TOP, margins.top); + gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_BOTTOM, margins.bottom); + } + + void set_layer(const std::string_view& value) override { + auto layer = GTK_LAYER_SHELL_LAYER_BOTTOM; + if (value == "top") { + layer = GTK_LAYER_SHELL_LAYER_TOP; + } else if (value == "overlay") { + layer = GTK_LAYER_SHELL_LAYER_OVERLAY; + } + gtk_layer_set_layer(window_.gobj(), layer); + } + + void set_position(const std::string_view& position) override { + auto unanchored = GTK_LAYER_SHELL_EDGE_BOTTOM; + vertical_ = false; + if (position == "bottom") { + unanchored = GTK_LAYER_SHELL_EDGE_TOP; + } else if (position == "left") { + unanchored = GTK_LAYER_SHELL_EDGE_RIGHT; + vertical_ = true; + } else if (position == "right") { + vertical_ = true; + unanchored = GTK_LAYER_SHELL_EDGE_LEFT; + } + for (auto edge : {GTK_LAYER_SHELL_EDGE_LEFT, + GTK_LAYER_SHELL_EDGE_RIGHT, + GTK_LAYER_SHELL_EDGE_TOP, + GTK_LAYER_SHELL_EDGE_BOTTOM}) { + gtk_layer_set_anchor(window_.gobj(), edge, unanchored != edge); + } + } + + void set_size(uint32_t width, uint32_t height) override { + width_ = width; + height_ = height; + window_.set_size_request(width_, height_); + }; + + private: + Gtk::Window& window_; + std::string output_name_; + uint32_t width_; + uint32_t height_; + bool vertical_ = false; + + void on_configure(GdkEventConfigure* ev) { + /* + * GTK wants new size for the window. + * Actual resizing and management of the exclusve zone is handled within the gtk-layer-shell + * code. This event handler only updates stored size of the window and prints some warnings. + * + * Note: forced resizing to a window smaller than required by GTK would not work with + * gtk-layer-shell. + */ + if (vertical_) { + if (width_ > 1 && ev->width > static_cast(width_)) { + spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); + } + } else { + if (height_ > 1 && ev->height > static_cast(height_)) { + spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); + } + } + width_ = ev->width; + height_ = ev->height; + spdlog::info(BAR_SIZE_MSG, width_, height_, output_name_); + } +}; +#endif + +struct RawSurfaceImpl : public BarSurface, public sigc::trackable { + RawSurfaceImpl(Gtk::Window& window, struct waybar_output& output) : window_{window} { + output_ = gdk_wayland_monitor_get_wl_output(output.monitor->gobj()); + output_name_ = output.name; + + window.signal_realize().connect_notify(sigc::mem_fun(*this, &RawSurfaceImpl::on_realize)); + window.signal_map_event().connect_notify(sigc::mem_fun(*this, &RawSurfaceImpl::on_map)); + window.signal_configure_event().connect_notify( + sigc::mem_fun(*this, &RawSurfaceImpl::on_configure)); + + if (window.get_realized()) { + on_realize(); + } + } + + void set_exclusive_zone(bool enable) override { + exclusive_zone_ = enable; + if (layer_surface_) { + auto zone = 0; + if (enable) { + // exclusive zone already includes margin for anchored edge, + // only opposite margin should be added + if ((anchor_ & VERTICAL_ANCHOR) == VERTICAL_ANCHOR) { + zone += width_; + zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) ? margins_.right : margins_.left; + } else { + zone += height_; + zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) ? margins_.bottom : margins_.top; + } + } + spdlog::debug("Set exclusive zone {} for output {}", zone, output_name_); + zwlr_layer_surface_v1_set_exclusive_zone(layer_surface_, zone); + } + } + + void set_layer(const std::string_view& layer) override { + layer_ = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; + if (layer == "top") { + layer_ = ZWLR_LAYER_SHELL_V1_LAYER_TOP; + } else if (layer == "overlay") { + layer_ = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; + } + // updating already mapped window + if (layer_surface_) { + if (zwlr_layer_surface_v1_get_version(layer_surface_) >= + ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION) { + zwlr_layer_surface_v1_set_layer(layer_surface_, layer_); + commit(); + } else { + spdlog::warn("Unable to set layer: layer-shell interface version is too old"); + } + } + } + + void set_margins(const struct bar_margins& margins) override { + margins_ = margins; + // updating already mapped window + if (layer_surface_) { + zwlr_layer_surface_v1_set_margin( + layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); + commit(); + } + } + + void set_position(const std::string_view& position) override { + anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; + if (position == "bottom") { + anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; + } else if (position == "left") { + anchor_ = VERTICAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT; + } else if (position == "right") { + anchor_ = VERTICAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; + } + + // updating already mapped window + if (layer_surface_) { + zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); + commit(); + } + } + + void set_size(uint32_t width, uint32_t height) override { + width_ = width; + height_ = height; + // layer_shell.configure handler should update exclusive zone if size changes + window_.set_size_request(width, height); + }; + + private: + constexpr static uint8_t VERTICAL_ANCHOR = + ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; + constexpr static uint8_t HORIZONTAL_ANCHOR = + ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; + + Gtk::Window& window_; + std::string output_name_; + uint32_t width_; + uint32_t height_; + uint8_t anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; + bool exclusive_zone_ = true; + struct bar_margins margins_; + + zwlr_layer_shell_v1_layer layer_ = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; + struct wl_output* output_ = nullptr; + struct wl_surface* surface_ = nullptr; + struct zwlr_layer_surface_v1* layer_surface_ = nullptr; + + void on_realize() { + auto gdk_window = window_.get_window()->gobj(); + gdk_wayland_window_set_use_custom_surface(gdk_window); + } + + void on_map(GdkEventAny* ev) { + auto client = Client::inst(); + auto gdk_window = window_.get_window()->gobj(); + surface_ = gdk_wayland_window_get_wl_surface(gdk_window); + + layer_surface_ = zwlr_layer_shell_v1_get_layer_surface( + client->layer_shell, surface_, output_, layer_, "waybar"); + + zwlr_layer_surface_v1_set_keyboard_interactivity(layer_surface_, false); + + zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); + zwlr_layer_surface_v1_set_margin( + layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); + set_surface_size(width_, height_); + set_exclusive_zone(exclusive_zone_); + + static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { + .configure = on_surface_configure, + .closed = on_surface_closed, + }; + zwlr_layer_surface_v1_add_listener(layer_surface_, &layer_surface_listener, this); + + wl_surface_commit(surface_); + wl_display_roundtrip(client->wl_display); + } + + void on_configure(GdkEventConfigure* ev) { + /* + * GTK wants new size for the window. + * + * Prefer configured size if it's non-default. + * If the size is not set and the window is smaller than requested by GTK, request resize from + * layer surface. + */ + auto tmp_height = height_; + auto tmp_width = width_; + if (ev->height > static_cast(height_)) { + // Default minimal value + if (height_ > 1) { + spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); + } + /* + if (config["height"].isUInt()) { + spdlog::info(SIZE_DEFINED, "Height"); + } else */ + tmp_height = ev->height; + } + if (ev->width > static_cast(width_)) { + // Default minimal value + if (width_ > 1) { + spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); + } + /* + if (config["width"].isUInt()) { + spdlog::info(SIZE_DEFINED, "Width"); + } else */ + tmp_width = ev->width; + } + if (tmp_width != width_ || tmp_height != height_) { + set_surface_size(tmp_width, tmp_height); + } + } + + void commit() { + if (window_.get_mapped()) { + wl_surface_commit(surface_); + } + } + + void set_surface_size(uint32_t width, uint32_t height) { + /* If the client is anchored to two opposite edges, layer_surface.configure will return + * size without margins for the axis. + * layer_surface.set_size, however, expects size with margins for the anchored axis. + * This is not specified by wlr-layer-shell and based on actual behavior of sway. + */ + bool vertical = (anchor_ & VERTICAL_ANCHOR) == VERTICAL_ANCHOR; + if (vertical && height > 1) { + height += margins_.top + margins_.bottom; + } + if (!vertical && width > 1) { + width += margins_.right + margins_.left; + } + spdlog::debug("Set surface size {}x{} for output {}", width, height, output_name_); + zwlr_layer_surface_v1_set_size(layer_surface_, width, height); + } + + static void on_surface_configure(void* data, struct zwlr_layer_surface_v1* surface, + uint32_t serial, uint32_t width, uint32_t height) { + auto o = static_cast(data); + if (width != o->width_ || height != o->height_) { + o->width_ = width; + o->height_ = height; + o->window_.set_size_request(o->width_, o->height_); + o->window_.resize(o->width_, o->height_); + o->set_exclusive_zone(o->exclusive_zone_); + spdlog::info(BAR_SIZE_MSG, + o->width_ == 1 ? "auto" : std::to_string(o->width_), + o->height_ == 1 ? "auto" : std::to_string(o->height_), + o->output_name_); + wl_surface_commit(o->surface_); + } + zwlr_layer_surface_v1_ack_configure(surface, serial); + } + + static void on_surface_closed(void* data, struct zwlr_layer_surface_v1* /* surface */) { + auto o = static_cast(data); + if (o->layer_surface_) { + zwlr_layer_surface_v1_destroy(o->layer_surface_); + o->layer_surface_ = nullptr; + } + } +}; + +}; // namespace waybar + waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) : output(w_output), config(w_config), - surface(nullptr), window{Gtk::WindowType::WINDOW_TOPLEVEL}, - layer_surface_(nullptr), - anchor_(ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP), left_(Gtk::ORIENTATION_HORIZONTAL, 0), center_(Gtk::ORIENTATION_HORIZONTAL, 0), right_(Gtk::ORIENTATION_HORIZONTAL, 0), @@ -29,32 +362,22 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) center_.get_style_context()->add_class("modules-center"); right_.get_style_context()->add_class("modules-right"); - if (config["position"] == "right" || config["position"] == "left") { + auto position = config["position"].asString(); + + if (position == "right" || position == "left") { + left_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); + center_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); + right_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); + box_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); + vertical = true; + height_ = 0; width_ = 1; } height_ = config["height"].isUInt() ? config["height"].asUInt() : height_; width_ = config["width"].isUInt() ? config["width"].asUInt() : width_; - if (config["position"] == "bottom") { - anchor_ = ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; - } else if (config["position"] == "left") { - anchor_ = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT; - } else if (config["position"] == "right") { - anchor_ = ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; - } - if (anchor_ == ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM || - anchor_ == ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) { - anchor_ |= ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; - } else if (anchor_ == ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT || - anchor_ == ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT) { - anchor_ |= ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; - left_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); - center_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); - right_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); - box_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); - vertical = true; - } + struct bar_margins margins_; if (config["margin-top"].isInt() || config["margin-right"].isInt() || config["margin-bottom"].isInt() || config["margin-left"].isInt()) { @@ -102,210 +425,51 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) } #ifdef HAVE_GTK_LAYER_SHELL - use_gls_ = config["gtk-layer-shell"].isBool() ? config["gtk-layer-shell"].asBool() : true; - if (use_gls_) { - initGtkLayerShell(); - window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMapGLS)); - window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Bar::onConfigureGLS)); - } -#endif - - if (!use_gls_) { - window.signal_realize().connect_notify(sigc::mem_fun(*this, &Bar::onRealize)); - window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMap)); - window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Bar::onConfigure)); - } - window.set_size_request(width_, height_); - setupWidgets(); - - if (!use_gls_ && window.get_realized()) { - onRealize(); - } - window.show_all(); -} - -#ifdef HAVE_GTK_LAYER_SHELL -void waybar::Bar::initGtkLayerShell() { - auto gtk_window = window.gobj(); - // this has to be executed before GtkWindow.realize - gtk_layer_init_for_window(gtk_window); - gtk_layer_set_keyboard_interactivity(gtk_window, FALSE); - auto layer = config["layer"] == "top" ? GTK_LAYER_SHELL_LAYER_TOP : GTK_LAYER_SHELL_LAYER_BOTTOM; - gtk_layer_set_layer(gtk_window, layer); - gtk_layer_set_monitor(gtk_window, output->monitor->gobj()); - gtk_layer_set_namespace(gtk_window, "waybar"); - - gtk_layer_set_anchor(gtk_window, - GTK_LAYER_SHELL_EDGE_LEFT, - (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) ? TRUE : FALSE); - gtk_layer_set_anchor(gtk_window, - GTK_LAYER_SHELL_EDGE_RIGHT, - (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT) ? TRUE : FALSE); - gtk_layer_set_anchor(gtk_window, - GTK_LAYER_SHELL_EDGE_TOP, - (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) ? TRUE : FALSE); - gtk_layer_set_anchor(gtk_window, - GTK_LAYER_SHELL_EDGE_BOTTOM, - (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM) ? TRUE : FALSE); - - gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_LEFT, margins_.left); - gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_RIGHT, margins_.right); - gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_TOP, margins_.top); - gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_BOTTOM, margins_.bottom); - - setExclusiveZone(width_, height_); -} - -void waybar::Bar::onConfigureGLS(GdkEventConfigure* ev) { - /* - * GTK wants new size for the window. - * Actual resizing and management of the exclusve zone is handled within the gtk-layer-shell code. - * This event handler only updates stored size of the window and prints some warnings. - * - * Note: forced resizing to a window smaller than required by GTK would not work with - * gtk-layer-shell. - */ - if (vertical) { - if (width_ > 1 && ev->width > static_cast(width_)) { - spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); - } - } else { - if (height_ > 1 && ev->height > static_cast(height_)) { - spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); - } - } - width_ = ev->width; - height_ = ev->height; - spdlog::info(BAR_SIZE_MSG, width_, height_, output->name); -} - -void waybar::Bar::onMapGLS(GdkEventAny* ev) { - /* - * Obtain a pointer to the custom layer surface for modules that require it (idle_inhibitor). - */ - auto gdk_window = window.get_window(); - surface = gdk_wayland_window_get_wl_surface(gdk_window->gobj()); -} - -#endif - -void waybar::Bar::onConfigure(GdkEventConfigure* ev) { - /* - * GTK wants new size for the window. - * - * Prefer configured size if it's non-default. - * If the size is not set and the window is smaller than requested by GTK, request resize from - * layer surface. - */ - auto tmp_height = height_; - auto tmp_width = width_; - if (ev->height > static_cast(height_)) { - // Default minimal value - if (height_ > 1) { - spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); - } - if (config["height"].isUInt()) { - spdlog::info(SIZE_DEFINED, "Height"); - } else { - tmp_height = ev->height; - } - } - if (ev->width > static_cast(width_)) { - // Default minimal value - if (width_ > 1) { - spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); - } - if (config["width"].isUInt()) { - spdlog::info(SIZE_DEFINED, "Width"); - } else { - tmp_width = ev->width; - } - } - if (tmp_width != width_ || tmp_height != height_) { - setSurfaceSize(tmp_width, tmp_height); - } -} - -void waybar::Bar::onRealize() { - auto gdk_window = window.get_window()->gobj(); - gdk_wayland_window_set_use_custom_surface(gdk_window); -} - -void waybar::Bar::onMap(GdkEventAny* ev) { - auto gdk_window = window.get_window()->gobj(); - surface = gdk_wayland_window_get_wl_surface(gdk_window); - - auto client = waybar::Client::inst(); - // owned by output->monitor; no need to destroy - auto wl_output = gdk_wayland_monitor_get_wl_output(output->monitor->gobj()); - auto layer = - config["layer"] == "top" ? ZWLR_LAYER_SHELL_V1_LAYER_TOP : ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; - layer_surface_ = zwlr_layer_shell_v1_get_layer_surface( - client->layer_shell, surface, wl_output, layer, "waybar"); - - zwlr_layer_surface_v1_set_keyboard_interactivity(layer_surface_, false); - zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); - zwlr_layer_surface_v1_set_margin( - layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); - setSurfaceSize(width_, height_); - setExclusiveZone(width_, height_); - - static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { - .configure = layerSurfaceHandleConfigure, - .closed = layerSurfaceHandleClosed, - }; - zwlr_layer_surface_v1_add_listener(layer_surface_, &layer_surface_listener, this); - - wl_surface_commit(surface); - wl_display_roundtrip(client->wl_display); -} - -void waybar::Bar::setExclusiveZone(uint32_t width, uint32_t height) { -#ifdef HAVE_GTK_LAYER_SHELL - if (use_gls_) { - if (visible) { - spdlog::debug("Enable auto exclusive zone for output {}", output->name); - gtk_layer_auto_exclusive_zone_enable(window.gobj()); - } else { - spdlog::debug("Disable exclusive zone for output {}", output->name); - gtk_layer_set_exclusive_zone(window.gobj(), 0); - } + bool use_gls = config["gtk-layer-shell"].isBool() ? config["gtk-layer-shell"].asBool() : true; + if (use_gls) { + surface_impl_ = std::make_unique(window, *output); } else #endif { - auto zone = 0; - if (visible) { - // exclusive zone already includes margin for anchored edge, - // only opposite margin should be added - if (vertical) { - zone += width; - zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) ? margins_.right : margins_.left; - } else { - zone += height; - zone += (anchor_ & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) ? margins_.bottom : margins_.top; - } - } - spdlog::debug("Set exclusive zone {} for output {}", zone, output->name); - zwlr_layer_surface_v1_set_exclusive_zone(layer_surface_, zone); + surface_impl_ = std::make_unique(window, *output); } + + if (config["layer"].isString()) { + surface_impl_->set_layer(config["layer"].asString()); + } + surface_impl_->set_exclusive_zone(true); + surface_impl_->set_margins(margins_); + surface_impl_->set_position(position); + surface_impl_->set_size(width_, height_); + + window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMap)); + + setupWidgets(); + window.show_all(); } -void waybar::Bar::setSurfaceSize(uint32_t width, uint32_t height) { - /* If the client is anchored to two opposite edges, layer_surface.configure will return - * size without margins for the axis. - * layer_surface.set_size, however, expects size with margins for the anchored axis. - * This is not specified by wlr-layer-shell and based on actual behavior of sway. +void waybar::Bar::onMap(GdkEventAny*) { + /* + * Obtain a pointer to the custom layer surface for modules that require it (idle_inhibitor). */ - if (vertical && height > 1) { - height += margins_.top + margins_.bottom; - } - if (!vertical && width > 1) { - width += margins_.right + margins_.left; - } - spdlog::debug("Set surface size {}x{} for output {}", width, height, output->name); - zwlr_layer_surface_v1_set_size(layer_surface_, width, height); + auto gdk_window = window.get_window()->gobj(); + surface = gdk_wayland_window_get_wl_surface(gdk_window); } +void waybar::Bar::setVisible(bool value) { + visible = value; + if (!visible) { + window.get_style_context()->add_class("hidden"); + window.set_opacity(0); + } else { + window.get_style_context()->remove_class("hidden"); + window.set_opacity(1); + } + surface_impl_->set_exclusive_zone(visible); +} + +void waybar::Bar::toggle() { setVisible(!visible); } + // Converting string to button code rn as to avoid doing it later void waybar::Bar::setupAltFormatKeyForModule(const std::string& module_name) { if (config.isMember(module_name)) { @@ -367,50 +531,6 @@ void waybar::Bar::handleSignal(int signal) { } } -void waybar::Bar::layerSurfaceHandleConfigure(void* data, struct zwlr_layer_surface_v1* surface, - uint32_t serial, uint32_t width, uint32_t height) { - auto o = static_cast(data); - if (width != o->width_ || height != o->height_) { - o->width_ = width; - o->height_ = height; - o->window.set_size_request(o->width_, o->height_); - o->window.resize(o->width_, o->height_); - o->setExclusiveZone(width, height); - spdlog::info(BAR_SIZE_MSG, - o->width_ == 1 ? "auto" : std::to_string(o->width_), - o->height_ == 1 ? "auto" : std::to_string(o->height_), - o->output->name); - wl_surface_commit(o->surface); - } - zwlr_layer_surface_v1_ack_configure(surface, serial); -} - -void waybar::Bar::layerSurfaceHandleClosed(void* data, struct zwlr_layer_surface_v1* /*surface*/) { - auto o = static_cast(data); - if (o->layer_surface_) { - zwlr_layer_surface_v1_destroy(o->layer_surface_); - o->layer_surface_ = nullptr; - } - o->modules_left_.clear(); - o->modules_center_.clear(); - o->modules_right_.clear(); -} - -auto waybar::Bar::toggle() -> void { - visible = !visible; - if (!visible) { - window.get_style_context()->add_class("hidden"); - window.set_opacity(0); - } else { - window.get_style_context()->remove_class("hidden"); - window.set_opacity(1); - } - setExclusiveZone(width_, height_); - if (!use_gls_) { - wl_surface_commit(surface); - } -} - void waybar::Bar::getModules(const Factory& factory, const std::string& pos) { if (config[pos].isArray()) { for (const auto& name : config[pos]) { From f01996ae997d4d2aa8ce9904332d99f12f3e4e2c Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 28 Oct 2020 08:06:40 -0700 Subject: [PATCH 064/303] fix(bar): CamelCase SurfaceImpl method names --- include/bar.hpp | 10 +++---- src/bar.cpp | 70 ++++++++++++++++++++++++------------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index df50327..1e3d37b 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -36,11 +36,11 @@ class BarSurface { BarSurface() = default; public: - virtual void set_exclusive_zone(bool enable) = 0; - virtual void set_layer(const std::string_view &layer) = 0; - virtual void set_margins(const struct bar_margins &margins) = 0; - virtual void set_position(const std::string_view &position) = 0; - virtual void set_size(uint32_t width, uint32_t height) = 0; + virtual void setExclusiveZone(bool enable) = 0; + virtual void setLayer(const std::string_view &layer) = 0; + virtual void setMargins(const struct bar_margins &margins) = 0; + virtual void setPosition(const std::string_view &position) = 0; + virtual void setSize(uint32_t width, uint32_t height) = 0; virtual ~BarSurface() = default; }; diff --git a/src/bar.cpp b/src/bar.cpp index a684f12..c7387e3 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -31,10 +31,10 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { gtk_layer_set_namespace(window_.gobj(), "waybar"); window.signal_configure_event().connect_notify( - sigc::mem_fun(*this, &GLSSurfaceImpl::on_configure)); + sigc::mem_fun(*this, &GLSSurfaceImpl::onConfigure)); } - void set_exclusive_zone(bool enable) override { + void setExclusiveZone(bool enable) override { if (enable) { gtk_layer_auto_exclusive_zone_enable(window_.gobj()); } else { @@ -42,14 +42,14 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { } } - void set_margins(const struct bar_margins& margins) override { + void setMargins(const struct bar_margins& margins) override { gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_LEFT, margins.left); gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_RIGHT, margins.right); gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_TOP, margins.top); gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_BOTTOM, margins.bottom); } - void set_layer(const std::string_view& value) override { + void setLayer(const std::string_view& value) override { auto layer = GTK_LAYER_SHELL_LAYER_BOTTOM; if (value == "top") { layer = GTK_LAYER_SHELL_LAYER_TOP; @@ -59,7 +59,7 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { gtk_layer_set_layer(window_.gobj(), layer); } - void set_position(const std::string_view& position) override { + void setPosition(const std::string_view& position) override { auto unanchored = GTK_LAYER_SHELL_EDGE_BOTTOM; vertical_ = false; if (position == "bottom") { @@ -79,7 +79,7 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { } } - void set_size(uint32_t width, uint32_t height) override { + void setSize(uint32_t width, uint32_t height) override { width_ = width; height_ = height; window_.set_size_request(width_, height_); @@ -92,7 +92,7 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { uint32_t height_; bool vertical_ = false; - void on_configure(GdkEventConfigure* ev) { + void onConfigure(GdkEventConfigure* ev) { /* * GTK wants new size for the window. * Actual resizing and management of the exclusve zone is handled within the gtk-layer-shell @@ -122,17 +122,17 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { output_ = gdk_wayland_monitor_get_wl_output(output.monitor->gobj()); output_name_ = output.name; - window.signal_realize().connect_notify(sigc::mem_fun(*this, &RawSurfaceImpl::on_realize)); - window.signal_map_event().connect_notify(sigc::mem_fun(*this, &RawSurfaceImpl::on_map)); + window.signal_realize().connect_notify(sigc::mem_fun(*this, &RawSurfaceImpl::onRealize)); + window.signal_map_event().connect_notify(sigc::mem_fun(*this, &RawSurfaceImpl::onMap)); window.signal_configure_event().connect_notify( - sigc::mem_fun(*this, &RawSurfaceImpl::on_configure)); + sigc::mem_fun(*this, &RawSurfaceImpl::onConfigure)); if (window.get_realized()) { - on_realize(); + onRealize(); } } - void set_exclusive_zone(bool enable) override { + void setExclusiveZone(bool enable) override { exclusive_zone_ = enable; if (layer_surface_) { auto zone = 0; @@ -152,7 +152,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } - void set_layer(const std::string_view& layer) override { + void setLayer(const std::string_view& layer) override { layer_ = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; if (layer == "top") { layer_ = ZWLR_LAYER_SHELL_V1_LAYER_TOP; @@ -171,7 +171,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } - void set_margins(const struct bar_margins& margins) override { + void setMargins(const struct bar_margins& margins) override { margins_ = margins; // updating already mapped window if (layer_surface_) { @@ -181,7 +181,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } - void set_position(const std::string_view& position) override { + void setPosition(const std::string_view& position) override { anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; if (position == "bottom") { anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; @@ -198,7 +198,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } - void set_size(uint32_t width, uint32_t height) override { + void setSize(uint32_t width, uint32_t height) override { width_ = width; height_ = height; // layer_shell.configure handler should update exclusive zone if size changes @@ -224,12 +224,12 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { struct wl_surface* surface_ = nullptr; struct zwlr_layer_surface_v1* layer_surface_ = nullptr; - void on_realize() { + void onRealize() { auto gdk_window = window_.get_window()->gobj(); gdk_wayland_window_set_use_custom_surface(gdk_window); } - void on_map(GdkEventAny* ev) { + void onMap(GdkEventAny* ev) { auto client = Client::inst(); auto gdk_window = window_.get_window()->gobj(); surface_ = gdk_wayland_window_get_wl_surface(gdk_window); @@ -242,12 +242,12 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); zwlr_layer_surface_v1_set_margin( layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); - set_surface_size(width_, height_); - set_exclusive_zone(exclusive_zone_); + setSurfaceSize(width_, height_); + setExclusiveZone(exclusive_zone_); static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { - .configure = on_surface_configure, - .closed = on_surface_closed, + .configure = onSurfaceConfigure, + .closed = onSurfaceClosed, }; zwlr_layer_surface_v1_add_listener(layer_surface_, &layer_surface_listener, this); @@ -255,7 +255,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { wl_display_roundtrip(client->wl_display); } - void on_configure(GdkEventConfigure* ev) { + void onConfigure(GdkEventConfigure* ev) { /* * GTK wants new size for the window. * @@ -288,7 +288,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { tmp_width = ev->width; } if (tmp_width != width_ || tmp_height != height_) { - set_surface_size(tmp_width, tmp_height); + setSurfaceSize(tmp_width, tmp_height); } } @@ -298,7 +298,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } - void set_surface_size(uint32_t width, uint32_t height) { + void setSurfaceSize(uint32_t width, uint32_t height) { /* If the client is anchored to two opposite edges, layer_surface.configure will return * size without margins for the axis. * layer_surface.set_size, however, expects size with margins for the anchored axis. @@ -315,15 +315,15 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { zwlr_layer_surface_v1_set_size(layer_surface_, width, height); } - static void on_surface_configure(void* data, struct zwlr_layer_surface_v1* surface, - uint32_t serial, uint32_t width, uint32_t height) { + static void onSurfaceConfigure(void* data, struct zwlr_layer_surface_v1* surface, uint32_t serial, + uint32_t width, uint32_t height) { auto o = static_cast(data); if (width != o->width_ || height != o->height_) { o->width_ = width; o->height_ = height; o->window_.set_size_request(o->width_, o->height_); o->window_.resize(o->width_, o->height_); - o->set_exclusive_zone(o->exclusive_zone_); + o->setExclusiveZone(o->exclusive_zone_); spdlog::info(BAR_SIZE_MSG, o->width_ == 1 ? "auto" : std::to_string(o->width_), o->height_ == 1 ? "auto" : std::to_string(o->height_), @@ -333,7 +333,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { zwlr_layer_surface_v1_ack_configure(surface, serial); } - static void on_surface_closed(void* data, struct zwlr_layer_surface_v1* /* surface */) { + static void onSurfaceClosed(void* data, struct zwlr_layer_surface_v1* /* surface */) { auto o = static_cast(data); if (o->layer_surface_) { zwlr_layer_surface_v1_destroy(o->layer_surface_); @@ -435,12 +435,12 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) } if (config["layer"].isString()) { - surface_impl_->set_layer(config["layer"].asString()); + surface_impl_->setLayer(config["layer"].asString()); } - surface_impl_->set_exclusive_zone(true); - surface_impl_->set_margins(margins_); - surface_impl_->set_position(position); - surface_impl_->set_size(width_, height_); + surface_impl_->setExclusiveZone(true); + surface_impl_->setMargins(margins_); + surface_impl_->setPosition(position); + surface_impl_->setSize(width_, height_); window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMap)); @@ -465,7 +465,7 @@ void waybar::Bar::setVisible(bool value) { window.get_style_context()->remove_class("hidden"); window.set_opacity(1); } - surface_impl_->set_exclusive_zone(visible); + surface_impl_->setExclusiveZone(visible); } void waybar::Bar::toggle() { setVisible(!visible); } From f97de599dde49943d2742db2903b83769601deac Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 21 Oct 2020 22:45:03 -0700 Subject: [PATCH 065/303] refactor: header cleanup Replace a couple of header includes with forward declarations. --- include/bar.hpp | 2 -- include/client.hpp | 4 ++++ src/bar.cpp | 1 + src/client.cpp | 3 +++ src/modules/idle_inhibitor.cpp | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 1e3d37b..d4748d5 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -9,8 +9,6 @@ #include #include "AModule.hpp" -#include "idle-inhibit-unstable-v1-client-protocol.h" -#include "wlr-layer-shell-unstable-v1-client-protocol.h" #include "xdg-output-unstable-v1-client-protocol.h" namespace waybar { diff --git a/include/client.hpp b/include/client.hpp index 39b6ae3..05215cc 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -8,6 +8,10 @@ #include #include "bar.hpp" +struct zwlr_layer_shell_v1; +struct zwp_idle_inhibitor_v1; +struct zwp_idle_inhibit_manager_v1; + namespace waybar { class Client { diff --git a/src/bar.cpp b/src/bar.cpp index c7387e3..fb04f62 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -7,6 +7,7 @@ #include "bar.hpp" #include "client.hpp" #include "factory.hpp" +#include "wlr-layer-shell-unstable-v1-client-protocol.h" namespace waybar { static constexpr const char* MIN_HEIGHT_MSG = diff --git a/src/client.cpp b/src/client.cpp index 9dd93d8..005761e 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -6,6 +6,9 @@ #include "util/clara.hpp" #include "util/json.hpp" +#include "idle-inhibit-unstable-v1-client-protocol.h" +#include "wlr-layer-shell-unstable-v1-client-protocol.h" + waybar::Client *waybar::Client::inst() { static auto c = new Client(); return c; diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index d94e957..d2cfe90 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -1,4 +1,6 @@ #include "modules/idle_inhibitor.hpp" + +#include "idle-inhibit-unstable-v1-client-protocol.h" #include "util/command.hpp" waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& bar, From d4d35e6b2b6f142844e18c69164c38d6b02f185a Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 22 Oct 2020 08:04:57 -0700 Subject: [PATCH 066/303] chore(subprojects): update gtk-layer-shell to 0.4.0 --- subprojects/gtk-layer-shell.wrap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gtk-layer-shell.wrap b/subprojects/gtk-layer-shell.wrap index 6fe68c3..555fbcb 100644 --- a/subprojects/gtk-layer-shell.wrap +++ b/subprojects/gtk-layer-shell.wrap @@ -1,5 +1,5 @@ [wrap-file] -directory = gtk-layer-shell-0.3.0 -source_filename = gtk-layer-shell-0.3.0.tar.gz -source_hash = edd5e31279d494df66da9e9190c219fa295da547f5538207685e98468dbc134d -source_url = https://github.com/wmww/gtk-layer-shell/archive/v0.3.0/gtk-layer-shell-0.3.0.tar.gz +directory = gtk-layer-shell-0.4.0 +source_filename = gtk-layer-shell-0.4.0.tar.gz +source_hash = 52fd74d3161fefa5528585ca5a523c3150934961f2284ad010ae54336dad097e +source_url = https://github.com/wmww/gtk-layer-shell/archive/v0.4.0/gtk-layer-shell-0.4.0.tar.gz From 591a417b7db973304e788ccf58bbbfdb289ed9a7 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 23 Oct 2020 00:13:23 -0700 Subject: [PATCH 067/303] fix(bar): rework surface commit calls for RawSurfaceImpl wayland log shows that some changes were committed twice and some weren't committed until the next redraw. --- include/bar.hpp | 1 + src/bar.cpp | 34 ++++++++++++++++------------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index d4748d5..8348070 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -39,6 +39,7 @@ class BarSurface { virtual void setMargins(const struct bar_margins &margins) = 0; virtual void setPosition(const std::string_view &position) = 0; virtual void setSize(uint32_t width, uint32_t height) = 0; + virtual void commit(){}; virtual ~BarSurface() = default; }; diff --git a/src/bar.cpp b/src/bar.cpp index fb04f62..8e5d7b0 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -165,7 +165,6 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { if (zwlr_layer_surface_v1_get_version(layer_surface_) >= ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION) { zwlr_layer_surface_v1_set_layer(layer_surface_, layer_); - commit(); } else { spdlog::warn("Unable to set layer: layer-shell interface version is too old"); } @@ -178,7 +177,6 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { if (layer_surface_) { zwlr_layer_surface_v1_set_margin( layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); - commit(); } } @@ -195,7 +193,6 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { // updating already mapped window if (layer_surface_) { zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); - commit(); } } @@ -206,6 +203,12 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { window_.set_size_request(width, height); }; + void commit() override { + if (surface_) { + wl_surface_commit(surface_); + } + } + private: constexpr static uint8_t VERTICAL_ANCHOR = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; @@ -231,6 +234,10 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } void onMap(GdkEventAny* ev) { + static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { + .configure = onSurfaceConfigure, + .closed = onSurfaceClosed, + }; auto client = Client::inst(); auto gdk_window = window_.get_window()->gobj(); surface_ = gdk_wayland_window_get_wl_surface(gdk_window); @@ -238,21 +245,16 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { layer_surface_ = zwlr_layer_shell_v1_get_layer_surface( client->layer_shell, surface_, output_, layer_, "waybar"); + zwlr_layer_surface_v1_add_listener(layer_surface_, &layer_surface_listener, this); zwlr_layer_surface_v1_set_keyboard_interactivity(layer_surface_, false); - zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); zwlr_layer_surface_v1_set_margin( layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); + setSurfaceSize(width_, height_); setExclusiveZone(exclusive_zone_); - static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { - .configure = onSurfaceConfigure, - .closed = onSurfaceClosed, - }; - zwlr_layer_surface_v1_add_listener(layer_surface_, &layer_surface_listener, this); - - wl_surface_commit(surface_); + commit(); wl_display_roundtrip(client->wl_display); } @@ -290,12 +292,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } if (tmp_width != width_ || tmp_height != height_) { setSurfaceSize(tmp_width, tmp_height); - } - } - - void commit() { - if (window_.get_mapped()) { - wl_surface_commit(surface_); + commit(); } } @@ -329,7 +326,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { o->width_ == 1 ? "auto" : std::to_string(o->width_), o->height_ == 1 ? "auto" : std::to_string(o->height_), o->output_name_); - wl_surface_commit(o->surface_); + o->commit(); } zwlr_layer_surface_v1_ack_configure(surface, serial); } @@ -467,6 +464,7 @@ void waybar::Bar::setVisible(bool value) { window.set_opacity(1); } surface_impl_->setExclusiveZone(visible); + surface_impl_->commit(); } void waybar::Bar::toggle() { setVisible(!visible); } From fe3aeb36c51267b87c8a8b8fa2ea827047c25196 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 23 Oct 2020 00:49:09 -0700 Subject: [PATCH 068/303] refactor(bar): wrap layer_surface pointer in unique_ptr --- src/bar.cpp | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/bar.cpp b/src/bar.cpp index 8e5d7b0..c2cf6d3 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -4,6 +4,8 @@ #include +#include + #include "bar.hpp" #include "client.hpp" #include "factory.hpp" @@ -149,7 +151,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } spdlog::debug("Set exclusive zone {} for output {}", zone, output_name_); - zwlr_layer_surface_v1_set_exclusive_zone(layer_surface_, zone); + zwlr_layer_surface_v1_set_exclusive_zone(layer_surface_.get(), zone); } } @@ -162,9 +164,9 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } // updating already mapped window if (layer_surface_) { - if (zwlr_layer_surface_v1_get_version(layer_surface_) >= + if (zwlr_layer_surface_v1_get_version(layer_surface_.get()) >= ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION) { - zwlr_layer_surface_v1_set_layer(layer_surface_, layer_); + zwlr_layer_surface_v1_set_layer(layer_surface_.get(), layer_); } else { spdlog::warn("Unable to set layer: layer-shell interface version is too old"); } @@ -176,7 +178,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { // updating already mapped window if (layer_surface_) { zwlr_layer_surface_v1_set_margin( - layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); + layer_surface_.get(), margins_.top, margins_.right, margins_.bottom, margins_.left); } } @@ -192,7 +194,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { // updating already mapped window if (layer_surface_) { - zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); + zwlr_layer_surface_v1_set_anchor(layer_surface_.get(), anchor_); } } @@ -215,6 +217,11 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { constexpr static uint8_t HORIZONTAL_ANCHOR = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; + template + using deleter_fn = std::integral_constant; + using layer_surface_ptr = + std::unique_ptr>; + Gtk::Window& window_; std::string output_name_; uint32_t width_; @@ -223,10 +230,10 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { bool exclusive_zone_ = true; struct bar_margins margins_; - zwlr_layer_shell_v1_layer layer_ = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; - struct wl_output* output_ = nullptr; - struct wl_surface* surface_ = nullptr; - struct zwlr_layer_surface_v1* layer_surface_ = nullptr; + zwlr_layer_shell_v1_layer layer_ = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; + struct wl_output* output_ = nullptr; // owned by GTK + struct wl_surface* surface_ = nullptr; // owned by GTK + layer_surface_ptr layer_surface_; void onRealize() { auto gdk_window = window_.get_window()->gobj(); @@ -242,14 +249,14 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { auto gdk_window = window_.get_window()->gobj(); surface_ = gdk_wayland_window_get_wl_surface(gdk_window); - layer_surface_ = zwlr_layer_shell_v1_get_layer_surface( - client->layer_shell, surface_, output_, layer_, "waybar"); + layer_surface_.reset(zwlr_layer_shell_v1_get_layer_surface( + client->layer_shell, surface_, output_, layer_, "waybar")); - zwlr_layer_surface_v1_add_listener(layer_surface_, &layer_surface_listener, this); - zwlr_layer_surface_v1_set_keyboard_interactivity(layer_surface_, false); - zwlr_layer_surface_v1_set_anchor(layer_surface_, anchor_); + zwlr_layer_surface_v1_add_listener(layer_surface_.get(), &layer_surface_listener, this); + zwlr_layer_surface_v1_set_keyboard_interactivity(layer_surface_.get(), false); + zwlr_layer_surface_v1_set_anchor(layer_surface_.get(), anchor_); zwlr_layer_surface_v1_set_margin( - layer_surface_, margins_.top, margins_.right, margins_.bottom, margins_.left); + layer_surface_.get(), margins_.top, margins_.right, margins_.bottom, margins_.left); setSurfaceSize(width_, height_); setExclusiveZone(exclusive_zone_); @@ -310,7 +317,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { width += margins_.right + margins_.left; } spdlog::debug("Set surface size {}x{} for output {}", width, height, output_name_); - zwlr_layer_surface_v1_set_size(layer_surface_, width, height); + zwlr_layer_surface_v1_set_size(layer_surface_.get(), width, height); } static void onSurfaceConfigure(void* data, struct zwlr_layer_surface_v1* surface, uint32_t serial, @@ -333,10 +340,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { static void onSurfaceClosed(void* data, struct zwlr_layer_surface_v1* /* surface */) { auto o = static_cast(data); - if (o->layer_surface_) { - zwlr_layer_surface_v1_destroy(o->layer_surface_); - o->layer_surface_ = nullptr; - } + o->layer_surface_.reset(); } }; From fc5906dbd4a9d026a6f746ffe37ec69ee5e2e7ea Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 22 Oct 2020 23:04:58 -0700 Subject: [PATCH 069/303] feat(bar): change layer to `bottom` when hidden Invisible bar on a `top` layer would still intercept pointer events and stop them from reaching windows below. Always changing the layer to to `bottom` along with making bar invisible would prevent that. --- include/bar.hpp | 9 ++++++++- src/bar.cpp | 27 +++++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 8348070..88df8b7 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -22,6 +22,12 @@ struct waybar_output { nullptr, &zxdg_output_v1_destroy}; }; +enum class bar_layer : uint8_t { + BOTTOM, + TOP, + OVERLAY, +}; + struct bar_margins { int top = 0; int right = 0; @@ -35,7 +41,7 @@ class BarSurface { public: virtual void setExclusiveZone(bool enable) = 0; - virtual void setLayer(const std::string_view &layer) = 0; + virtual void setLayer(bar_layer layer) = 0; virtual void setMargins(const struct bar_margins &margins) = 0; virtual void setPosition(const std::string_view &position) = 0; virtual void setSize(uint32_t width, uint32_t height) = 0; @@ -71,6 +77,7 @@ class Bar { std::unique_ptr surface_impl_; uint32_t width_ = 0; uint32_t height_ = 1; + bar_layer layer_; Gtk::Box left_; Gtk::Box center_; Gtk::Box right_; diff --git a/src/bar.cpp b/src/bar.cpp index c2cf6d3..f0fe64a 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -52,11 +52,11 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { gtk_layer_set_margin(window_.gobj(), GTK_LAYER_SHELL_EDGE_BOTTOM, margins.bottom); } - void setLayer(const std::string_view& value) override { + void setLayer(bar_layer value) override { auto layer = GTK_LAYER_SHELL_LAYER_BOTTOM; - if (value == "top") { + if (value == bar_layer::TOP) { layer = GTK_LAYER_SHELL_LAYER_TOP; - } else if (value == "overlay") { + } else if (value == bar_layer::OVERLAY) { layer = GTK_LAYER_SHELL_LAYER_OVERLAY; } gtk_layer_set_layer(window_.gobj(), layer); @@ -155,11 +155,11 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } - void setLayer(const std::string_view& layer) override { + void setLayer(bar_layer layer) override { layer_ = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; - if (layer == "top") { + if (layer == bar_layer::TOP) { layer_ = ZWLR_LAYER_SHELL_V1_LAYER_TOP; - } else if (layer == "overlay") { + } else if (layer == bar_layer::OVERLAY) { layer_ = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; } // updating already mapped window @@ -168,7 +168,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION) { zwlr_layer_surface_v1_set_layer(layer_surface_.get(), layer_); } else { - spdlog::warn("Unable to set layer: layer-shell interface version is too old"); + spdlog::warn("Unable to change layer: layer-shell implementation is too old"); } } } @@ -350,6 +350,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) : output(w_output), config(w_config), window{Gtk::WindowType::WINDOW_TOPLEVEL}, + layer_{bar_layer::BOTTOM}, left_(Gtk::ORIENTATION_HORIZONTAL, 0), center_(Gtk::ORIENTATION_HORIZONTAL, 0), right_(Gtk::ORIENTATION_HORIZONTAL, 0), @@ -364,6 +365,12 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) center_.get_style_context()->add_class("modules-center"); right_.get_style_context()->add_class("modules-right"); + if (config["layer"] == "top") { + layer_ = bar_layer::TOP; + } else if (config["layer"] == "overlay") { + layer_ = bar_layer::OVERLAY; + } + auto position = config["position"].asString(); if (position == "right" || position == "left") { @@ -436,9 +443,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) surface_impl_ = std::make_unique(window, *output); } - if (config["layer"].isString()) { - surface_impl_->setLayer(config["layer"].asString()); - } + surface_impl_->setLayer(layer_); surface_impl_->setExclusiveZone(true); surface_impl_->setMargins(margins_); surface_impl_->setPosition(position); @@ -463,9 +468,11 @@ void waybar::Bar::setVisible(bool value) { if (!visible) { window.get_style_context()->add_class("hidden"); window.set_opacity(0); + surface_impl_->setLayer(bar_layer::BOTTOM); } else { window.get_style_context()->remove_class("hidden"); window.set_opacity(1); + surface_impl_->setLayer(layer_); } surface_impl_->setExclusiveZone(visible); surface_impl_->commit(); From 9c566564e1c892b4f681be3787cd8a589f95a0ec Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 23 Oct 2020 02:59:04 -0700 Subject: [PATCH 070/303] fix(bar): address some of RawSurfaceImpl resizing issues --- include/bar.hpp | 2 -- src/bar.cpp | 55 ++++++++++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 88df8b7..8aab8f7 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -75,8 +75,6 @@ class Bar { void setupAltFormatKeyForModuleList(const char *module_list_name); std::unique_ptr surface_impl_; - uint32_t width_ = 0; - uint32_t height_ = 1; bar_layer layer_; Gtk::Box left_; Gtk::Box center_; diff --git a/src/bar.cpp b/src/bar.cpp index f0fe64a..771adab 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -199,8 +199,8 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } void setSize(uint32_t width, uint32_t height) override { - width_ = width; - height_ = height; + configured_width_ = width_ = width; + configured_height_ = height_ = height; // layer_shell.configure handler should update exclusive zone if size changes window_.set_size_request(width, height); }; @@ -224,8 +224,10 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { Gtk::Window& window_; std::string output_name_; - uint32_t width_; - uint32_t height_; + uint32_t configured_width_ = 0; + uint32_t configured_height_ = 0; + uint32_t width_ = 0; + uint32_t height_ = 0; uint8_t anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; bool exclusive_zone_ = true; struct bar_margins margins_; @@ -280,22 +282,22 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { if (height_ > 1) { spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); } - /* - if (config["height"].isUInt()) { + if (configured_height_ > 1) { spdlog::info(SIZE_DEFINED, "Height"); - } else */ - tmp_height = ev->height; + } else { + tmp_height = ev->height; + } } if (ev->width > static_cast(width_)) { // Default minimal value if (width_ > 1) { spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); } - /* - if (config["width"].isUInt()) { + if (configured_width_ > 1) { spdlog::info(SIZE_DEFINED, "Width"); - } else */ - tmp_width = ev->width; + } else { + tmp_width = ev->width; + } } if (tmp_width != width_ || tmp_height != height_) { setSurfaceSize(tmp_width, tmp_height); @@ -308,13 +310,20 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { * size without margins for the axis. * layer_surface.set_size, however, expects size with margins for the anchored axis. * This is not specified by wlr-layer-shell and based on actual behavior of sway. + * + * If the size for unanchored axis is not set (0), change request to 1 to avoid automatic + * assignment by the compositor. */ - bool vertical = (anchor_ & VERTICAL_ANCHOR) == VERTICAL_ANCHOR; - if (vertical && height > 1) { - height += margins_.top + margins_.bottom; - } - if (!vertical && width > 1) { - width += margins_.right + margins_.left; + if ((anchor_ & VERTICAL_ANCHOR) == VERTICAL_ANCHOR) { + width = width > 0 ? width : 1; + if (height > 1) { + height += margins_.top + margins_.bottom; + } + } else { + height = height > 0 ? height : 1; + if (width > 1) { + width += margins_.right + margins_.left; + } } spdlog::debug("Set surface size {}x{} for output {}", width, height, output_name_); zwlr_layer_surface_v1_set_size(layer_surface_.get(), width, height); @@ -379,12 +388,10 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) right_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); box_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); vertical = true; - - height_ = 0; - width_ = 1; } - height_ = config["height"].isUInt() ? config["height"].asUInt() : height_; - width_ = config["width"].isUInt() ? config["width"].asUInt() : width_; + + uint32_t height = config["height"].isUInt() ? config["height"].asUInt() : 0; + uint32_t width = config["width"].isUInt() ? config["width"].asUInt() : 0; struct bar_margins margins_; @@ -447,7 +454,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) surface_impl_->setExclusiveZone(true); surface_impl_->setMargins(margins_); surface_impl_->setPosition(position); - surface_impl_->setSize(width_, height_); + surface_impl_->setSize(width, height); window.signal_map_event().connect_notify(sigc::mem_fun(*this, &Bar::onMap)); From 96d965fe04272c522a976cc5bd6a39dc7ff2631d Mon Sep 17 00:00:00 2001 From: Laurent Arnoud Date: Sat, 10 Oct 2020 14:09:55 +0200 Subject: [PATCH 071/303] Add simpleclock as fallback when hhdate is not available ref https://github.com/Alexays/Waybar/issues/668 --- include/factory.hpp | 4 ++++ include/modules/simpleclock.hpp | 24 ++++++++++++++++++++++++ meson.build | 14 ++++++++++++-- src/modules/simpleclock.cpp | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 include/modules/simpleclock.hpp create mode 100644 src/modules/simpleclock.cpp diff --git a/include/factory.hpp b/include/factory.hpp index 853e6b0..1cae68c 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -1,7 +1,11 @@ #pragma once #include +#ifdef HAVE_LIBDATE #include "modules/clock.hpp" +#else +#include "modules/simpleclock.hpp" +#endif #ifdef HAVE_SWAY #include "modules/sway/mode.hpp" #include "modules/sway/window.hpp" diff --git a/include/modules/simpleclock.hpp b/include/modules/simpleclock.hpp new file mode 100644 index 0000000..aa9a0a2 --- /dev/null +++ b/include/modules/simpleclock.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include +#if FMT_VERSION < 60000 +#include +#else +#include +#endif +#include "ALabel.hpp" +#include "util/sleeper_thread.hpp" + +namespace waybar::modules { + +class Clock : public ALabel { + public: + Clock(const std::string&, const Json::Value&); + ~Clock() = default; + auto update() -> void; + + private: + util::SleeperThread thread_; +}; + +} // namespace waybar::modules diff --git a/meson.build b/meson.build index 7f4ffac..48faeda 100644 --- a/meson.build +++ b/meson.build @@ -113,7 +113,11 @@ gtk_layer_shell = dependency('gtk-layer-shell-0', required: get_option('gtk-layer-shell'), fallback : ['gtk-layer-shell', 'gtk_layer_shell_dep']) systemd = dependency('systemd', required: get_option('systemd')) -tz_dep = dependency('date', default_options : [ 'use_system_tzdb=true' ], modules : [ 'date::date', 'date::date-tz' ], fallback: [ 'date', 'tz_dep' ]) +tz_dep = dependency('date', + required: false, + default_options : [ 'use_system_tzdb=true' ], + modules : [ 'date::date', 'date::date-tz' ], + fallback: [ 'date', 'tz_dep' ]) prefix = get_option('prefix') sysconfdir = get_option('sysconfdir') @@ -137,7 +141,6 @@ src_files = files( 'src/factory.cpp', 'src/AModule.cpp', 'src/ALabel.cpp', - 'src/modules/clock.cpp', 'src/modules/custom.cpp', 'src/modules/disk.cpp', 'src/modules/idle_inhibitor.cpp', @@ -237,6 +240,13 @@ if get_option('rfkill').enabled() endif endif +if tz_dep.found() + add_project_arguments('-DHAVE_LIBDATE', language: 'cpp') + src_files += 'src/modules/clock.cpp' +else + src_files += 'src/modules/simpleclock.cpp' +endif + subdir('protocol') executable( diff --git a/src/modules/simpleclock.cpp b/src/modules/simpleclock.cpp new file mode 100644 index 0000000..3004fc2 --- /dev/null +++ b/src/modules/simpleclock.cpp @@ -0,0 +1,33 @@ +#include "modules/simpleclock.hpp" +#include + +waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config) + : ALabel(config, "clock", id, "{:%H:%M}", 60) { + thread_ = [this] { + dp.emit(); + auto now = std::chrono::system_clock::now(); + auto timeout = std::chrono::floor(now + interval_); + auto diff = std::chrono::seconds(timeout.time_since_epoch().count() % interval_.count()); + thread_.sleep_until(timeout - diff); + }; +} + +auto waybar::modules::Clock::update() -> void { + tzset(); // Update timezone information + auto now = std::chrono::system_clock::now(); + auto localtime = fmt::localtime(std::chrono::system_clock::to_time_t(now)); + auto text = fmt::format(format_, localtime); + label_.set_markup(text); + + if (tooltipEnabled()) { + if (config_["tooltip-format"].isString()) { + auto tooltip_format = config_["tooltip-format"].asString(); + auto tooltip_text = fmt::format(tooltip_format, localtime); + label_.set_tooltip_text(tooltip_text); + } else { + label_.set_tooltip_text(text); + } + } + // Call parent update + ALabel::update(); +} From abe1fa5bd41db67058a6a9606efcc9b4c1f99e14 Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sat, 31 Oct 2020 12:21:51 +0000 Subject: [PATCH 072/303] Custom module - only call label_.set_tooltip_markup if tooltip markup has actually changed - fixes tooltips not appearing at all if a custom module is updating too frequently. --- src/modules/custom.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 92eedaa..ba55edd 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -131,9 +131,13 @@ auto waybar::modules::Custom::update() -> void { label_.set_markup(str); if (tooltipEnabled()) { if (text_ == tooltip_) { - label_.set_tooltip_markup(str); + if (label_.get_tooltip_markup() != str) { + label_.set_tooltip_markup(str); + } } else { - label_.set_tooltip_markup(tooltip_); + if (label_.get_tooltip_markup() != tooltip_) { + label_.set_tooltip_markup(tooltip_); + } } } auto classes = label_.get_style_context()->list_classes(); From 4872091442e869769c5db05d96358d3b660e03ad Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sat, 31 Oct 2020 16:31:27 +0000 Subject: [PATCH 073/303] Draft fix for syncing idle inhibitor across outputs. The idle_inhibitor surface has been moved to Client, all instances of idle inhibitor module now use one surface between them. Any time an idle inhibitor is clicked, currently it force updates ALL modules on all outputs, this needs work. --- include/bar.hpp | 1 + include/client.hpp | 1 + include/modules/idle_inhibitor.hpp | 1 - src/bar.cpp | 12 ++++++++++++ src/modules/idle_inhibitor.cpp | 30 +++++++++++++++++++++--------- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index fdc5a73..d107784 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -31,6 +31,7 @@ class Bar { auto toggle() -> void; void handleSignal(int); + void updateAll(); struct waybar_output *output; Json::Value config; diff --git a/include/client.hpp b/include/client.hpp index 39b6ae3..b7631cc 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -22,6 +22,7 @@ class Client { struct zwlr_layer_shell_v1 * layer_shell = nullptr; struct zxdg_output_manager_v1 * xdg_output_manager = nullptr; struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr; + struct zwp_idle_inhibitor_v1* idle_inhibitor; std::vector> bars; private: diff --git a/include/modules/idle_inhibitor.hpp b/include/modules/idle_inhibitor.hpp index 5ce324d..f1c690d 100644 --- a/include/modules/idle_inhibitor.hpp +++ b/include/modules/idle_inhibitor.hpp @@ -18,7 +18,6 @@ class IdleInhibitor : public ALabel { const Bar& bar_; std::string status_; - struct zwp_idle_inhibitor_v1* idle_inhibitor_; int pid_; }; diff --git a/src/bar.cpp b/src/bar.cpp index 8af6b97..747f0bf 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -461,3 +461,15 @@ auto waybar::Bar::setupWidgets() -> void { right_.pack_end(*module, false, false); } } + +void waybar::Bar::updateAll() { + for (auto const& module : modules_left_) { + module->update(); + } + for (auto const& module : modules_center_) { + module->update(); + } + for (auto const& module : modules_right_) { + module->update(); + } +} diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index d94e957..c6a4c78 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -6,7 +6,6 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& : ALabel(config, "idle_inhibitor", id, "{status}"), bar_(bar), status_("deactivated"), - idle_inhibitor_(nullptr), pid_(-1) { event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect( @@ -15,9 +14,9 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& } waybar::modules::IdleInhibitor::~IdleInhibitor() { - if (idle_inhibitor_ != nullptr) { - zwp_idle_inhibitor_v1_destroy(idle_inhibitor_); - idle_inhibitor_ = nullptr; + if (waybar::Client::inst()->idle_inhibitor != nullptr) { + zwp_idle_inhibitor_v1_destroy(waybar::Client::inst()->idle_inhibitor); + waybar::Client::inst()->idle_inhibitor = nullptr; } if (pid_ != -1) { kill(-pid_, 9); @@ -26,6 +25,13 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { } auto waybar::modules::IdleInhibitor::update() -> void { + // Check status + if (waybar::Client::inst()->idle_inhibitor != nullptr) { + status_ = "activated"; + } else { + status_ = "deactivated"; + } + label_.set_markup( fmt::format(format_, fmt::arg("status", status_), fmt::arg("icon", getIcon(0, status_)))); label_.get_style_context()->add_class(status_); @@ -39,17 +45,23 @@ auto waybar::modules::IdleInhibitor::update() -> void { bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { if (e->button == 1) { label_.get_style_context()->remove_class(status_); - if (idle_inhibitor_ != nullptr) { - zwp_idle_inhibitor_v1_destroy(idle_inhibitor_); - idle_inhibitor_ = nullptr; + if (waybar::Client::inst()->idle_inhibitor != nullptr) { + zwp_idle_inhibitor_v1_destroy(waybar::Client::inst()->idle_inhibitor); + waybar::Client::inst()->idle_inhibitor = nullptr; status_ = "deactivated"; } else { - idle_inhibitor_ = zwp_idle_inhibit_manager_v1_create_inhibitor( - waybar::Client::inst()->idle_inhibit_manager, bar_.surface); + waybar::Client::inst()->idle_inhibitor = zwp_idle_inhibit_manager_v1_create_inhibitor( + waybar::Client::inst()->idle_inhibit_manager, bar_.surface); status_ = "activated"; } click_param = status_; } + + // Make all modules update + for (auto const& bar : waybar::Client::inst()->bars) { + bar->updateAll(); + } + ALabel::handleToggle(e); return true; } From aa4fc3dd29544586482525e20f55c8c5becb82f0 Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sat, 31 Oct 2020 17:30:25 +0000 Subject: [PATCH 074/303] Idle inhibitor toggle no longer update all modules - a list of idle inhibitors is maintained on the Client. --- include/bar.hpp | 1 - include/client.hpp | 3 +++ src/bar.cpp | 12 ------------ src/modules/idle_inhibitor.cpp | 9 ++++++--- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index d107784..fdc5a73 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -31,7 +31,6 @@ class Bar { auto toggle() -> void; void handleSignal(int); - void updateAll(); struct waybar_output *output; Json::Value config; diff --git a/include/client.hpp b/include/client.hpp index b7631cc..b6762f6 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -21,8 +21,11 @@ class Client { struct wl_registry * registry = nullptr; struct zwlr_layer_shell_v1 * layer_shell = nullptr; struct zxdg_output_manager_v1 * xdg_output_manager = nullptr; + struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr; struct zwp_idle_inhibitor_v1* idle_inhibitor; + std::vector idle_inhibitor_modules; + std::vector> bars; private: diff --git a/src/bar.cpp b/src/bar.cpp index 747f0bf..8af6b97 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -461,15 +461,3 @@ auto waybar::Bar::setupWidgets() -> void { right_.pack_end(*module, false, false); } } - -void waybar::Bar::updateAll() { - for (auto const& module : modules_left_) { - module->update(); - } - for (auto const& module : modules_center_) { - module->update(); - } - for (auto const& module : modules_right_) { - module->update(); - } -} diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index c6a4c78..7a0dd50 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -10,6 +10,7 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect( sigc::mem_fun(*this, &IdleInhibitor::handleToggle)); + waybar::Client::inst()->idle_inhibitor_modules.push_back(this); dp.emit(); } @@ -57,9 +58,11 @@ bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { click_param = status_; } - // Make all modules update - for (auto const& bar : waybar::Client::inst()->bars) { - bar->updateAll(); + // Make all other idle inhibitor modules update + for (auto const& module : waybar::Client::inst()->idle_inhibitor_modules) { + if (module != this) { + module->update(); + } } ALabel::handleToggle(e); From 4889e655ebe5a58b18c294ef3b96d8dd6a46240c Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sun, 1 Nov 2020 13:33:28 +0000 Subject: [PATCH 075/303] Since idle_inhibitor's have a surface, we should have one for each inhibitor module. Therefore, the status is stored on the Client, and all modules create or destroy their inhibitors depending on Client's idle_inhibitor_status. Also, when modules are destroyed they remove themselves from Client's idle_inhibitor_modules. --- include/client.hpp | 4 +-- include/modules/idle_inhibitor.hpp | 2 +- src/modules/idle_inhibitor.cpp | 49 ++++++++++++++++++------------ 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index b6762f6..592af8f 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -23,8 +23,8 @@ class Client { struct zxdg_output_manager_v1 * xdg_output_manager = nullptr; struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr; - struct zwp_idle_inhibitor_v1* idle_inhibitor; - std::vector idle_inhibitor_modules; + std::list idle_inhibitor_modules; + std::string idle_inhibitor_status = "deactivated"; std::vector> bars; diff --git a/include/modules/idle_inhibitor.hpp b/include/modules/idle_inhibitor.hpp index f1c690d..abfc996 100644 --- a/include/modules/idle_inhibitor.hpp +++ b/include/modules/idle_inhibitor.hpp @@ -12,12 +12,12 @@ class IdleInhibitor : public ALabel { IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); ~IdleInhibitor(); auto update() -> void; + struct zwp_idle_inhibitor_v1* idle_inhibitor_ = nullptr; private: bool handleToggle(GdkEventButton* const& e); const Bar& bar_; - std::string status_; int pid_; }; diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index 7a0dd50..fe7ee16 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -5,20 +5,26 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& const Json::Value& config) : ALabel(config, "idle_inhibitor", id, "{status}"), bar_(bar), - status_("deactivated"), pid_(-1) { event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect( sigc::mem_fun(*this, &IdleInhibitor::handleToggle)); + + // Add this to the Client's idle_inhibitor_modules waybar::Client::inst()->idle_inhibitor_modules.push_back(this); + dp.emit(); } waybar::modules::IdleInhibitor::~IdleInhibitor() { - if (waybar::Client::inst()->idle_inhibitor != nullptr) { - zwp_idle_inhibitor_v1_destroy(waybar::Client::inst()->idle_inhibitor); - waybar::Client::inst()->idle_inhibitor = nullptr; + if (idle_inhibitor_ != nullptr) { + zwp_idle_inhibitor_v1_destroy(idle_inhibitor_); + idle_inhibitor_ = nullptr; } + + // Remove this from the Client's idle_inhibitor_modules + waybar::Client::inst()->idle_inhibitor_modules.remove(this); + if (pid_ != -1) { kill(-pid_, 9); pid_ = -1; @@ -27,17 +33,24 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { auto waybar::modules::IdleInhibitor::update() -> void { // Check status - if (waybar::Client::inst()->idle_inhibitor != nullptr) { - status_ = "activated"; + std::string status = waybar::Client::inst()->idle_inhibitor_status; + if (status == "activated") { + if (idle_inhibitor_ == nullptr) { + idle_inhibitor_ = zwp_idle_inhibit_manager_v1_create_inhibitor( + waybar::Client::inst()->idle_inhibit_manager, bar_.surface); + } } else { - status_ = "deactivated"; + if (idle_inhibitor_ != nullptr) { + zwp_idle_inhibitor_v1_destroy(idle_inhibitor_); + idle_inhibitor_ = nullptr; + } } label_.set_markup( - fmt::format(format_, fmt::arg("status", status_), fmt::arg("icon", getIcon(0, status_)))); - label_.get_style_context()->add_class(status_); + fmt::format(format_, fmt::arg("status", status), fmt::arg("icon", getIcon(0, status)))); + label_.get_style_context()->add_class(status); if (tooltipEnabled()) { - label_.set_tooltip_text(status_); + label_.set_tooltip_text(status); } // Call parent update ALabel::update(); @@ -45,17 +58,15 @@ auto waybar::modules::IdleInhibitor::update() -> void { bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { if (e->button == 1) { - label_.get_style_context()->remove_class(status_); - if (waybar::Client::inst()->idle_inhibitor != nullptr) { - zwp_idle_inhibitor_v1_destroy(waybar::Client::inst()->idle_inhibitor); - waybar::Client::inst()->idle_inhibitor = nullptr; - status_ = "deactivated"; + std::string status = waybar::Client::inst()->idle_inhibitor_status; + label_.get_style_context()->remove_class(status); + if (status == "activated") { + status = "deactivated"; } else { - waybar::Client::inst()->idle_inhibitor = zwp_idle_inhibit_manager_v1_create_inhibitor( - waybar::Client::inst()->idle_inhibit_manager, bar_.surface); - status_ = "activated"; + status = "activated"; } - click_param = status_; + waybar::Client::inst()->idle_inhibitor_status = status; + click_param = status; } // Make all other idle inhibitor modules update From bb33427f6532dfbf09d7bbc6755ca3e2f3946115 Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sun, 1 Nov 2020 13:38:58 +0000 Subject: [PATCH 076/303] Making idle_inhibitor_ private and initialised in constructor, as it was before. --- include/modules/idle_inhibitor.hpp | 2 +- src/modules/idle_inhibitor.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/modules/idle_inhibitor.hpp b/include/modules/idle_inhibitor.hpp index abfc996..a857011 100644 --- a/include/modules/idle_inhibitor.hpp +++ b/include/modules/idle_inhibitor.hpp @@ -12,12 +12,12 @@ class IdleInhibitor : public ALabel { IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); ~IdleInhibitor(); auto update() -> void; - struct zwp_idle_inhibitor_v1* idle_inhibitor_ = nullptr; private: bool handleToggle(GdkEventButton* const& e); const Bar& bar_; + struct zwp_idle_inhibitor_v1* idle_inhibitor_; int pid_; }; diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index fe7ee16..990af2c 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -5,6 +5,7 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& const Json::Value& config) : ALabel(config, "idle_inhibitor", id, "{status}"), bar_(bar), + idle_inhibitor_(nullptr), pid_(-1) { event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect( From c6743988d3f7afee8a4952b24817eaa59a08fe49 Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sun, 1 Nov 2020 16:03:39 +0000 Subject: [PATCH 077/303] Removing 'click_param' as it is no longer used. --- include/ALabel.hpp | 1 - src/modules/idle_inhibitor.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/include/ALabel.hpp b/include/ALabel.hpp index 6848d67..5b9ac54 100644 --- a/include/ALabel.hpp +++ b/include/ALabel.hpp @@ -19,7 +19,6 @@ class ALabel : public AModule { protected: Gtk::Label label_; std::string format_; - std::string click_param; const std::chrono::seconds interval_; bool alt_ = false; std::string default_format_; diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index 990af2c..5eb94eb 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -67,7 +67,6 @@ bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { status = "activated"; } waybar::Client::inst()->idle_inhibitor_status = status; - click_param = status; } // Make all other idle inhibitor modules update From 071cb86b45d5a348430feac0516794836cf77721 Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sun, 1 Nov 2020 17:09:48 +0000 Subject: [PATCH 078/303] Moving idle inhibitor shared stuff out of Client and into idle_inhibitor module as static members. --- include/client.hpp | 2 -- include/modules/idle_inhibitor.hpp | 2 ++ src/modules/idle_inhibitor.cpp | 15 +++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index 592af8f..902f686 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -23,8 +23,6 @@ class Client { struct zxdg_output_manager_v1 * xdg_output_manager = nullptr; struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr; - std::list idle_inhibitor_modules; - std::string idle_inhibitor_status = "deactivated"; std::vector> bars; diff --git a/include/modules/idle_inhibitor.hpp b/include/modules/idle_inhibitor.hpp index a857011..f592631 100644 --- a/include/modules/idle_inhibitor.hpp +++ b/include/modules/idle_inhibitor.hpp @@ -12,6 +12,8 @@ class IdleInhibitor : public ALabel { IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); ~IdleInhibitor(); auto update() -> void; + static std::list idle_inhibitor_modules; + static std::string idle_inhibitor_status; private: bool handleToggle(GdkEventButton* const& e); diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index 5eb94eb..ce5f991 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -1,6 +1,9 @@ #include "modules/idle_inhibitor.hpp" #include "util/command.hpp" +std::list waybar::modules::IdleInhibitor::idle_inhibitor_modules; +std::string waybar::modules::IdleInhibitor::idle_inhibitor_status = "deactivated"; + waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& bar, const Json::Value& config) : ALabel(config, "idle_inhibitor", id, "{status}"), @@ -12,7 +15,7 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& sigc::mem_fun(*this, &IdleInhibitor::handleToggle)); // Add this to the Client's idle_inhibitor_modules - waybar::Client::inst()->idle_inhibitor_modules.push_back(this); + waybar::modules::IdleInhibitor::idle_inhibitor_modules.push_back(this); dp.emit(); } @@ -24,7 +27,7 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { } // Remove this from the Client's idle_inhibitor_modules - waybar::Client::inst()->idle_inhibitor_modules.remove(this); + waybar::modules::IdleInhibitor::idle_inhibitor_modules.remove(this); if (pid_ != -1) { kill(-pid_, 9); @@ -34,7 +37,7 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { auto waybar::modules::IdleInhibitor::update() -> void { // Check status - std::string status = waybar::Client::inst()->idle_inhibitor_status; + std::string status = waybar::modules::IdleInhibitor::idle_inhibitor_status; if (status == "activated") { if (idle_inhibitor_ == nullptr) { idle_inhibitor_ = zwp_idle_inhibit_manager_v1_create_inhibitor( @@ -59,18 +62,18 @@ auto waybar::modules::IdleInhibitor::update() -> void { bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { if (e->button == 1) { - std::string status = waybar::Client::inst()->idle_inhibitor_status; + std::string status = waybar::modules::IdleInhibitor::idle_inhibitor_status; label_.get_style_context()->remove_class(status); if (status == "activated") { status = "deactivated"; } else { status = "activated"; } - waybar::Client::inst()->idle_inhibitor_status = status; + waybar::modules::IdleInhibitor::idle_inhibitor_status = status; } // Make all other idle inhibitor modules update - for (auto const& module : waybar::Client::inst()->idle_inhibitor_modules) { + for (auto const& module : waybar::modules::IdleInhibitor::idle_inhibitor_modules) { if (module != this) { module->update(); } From a9dae931c73e44f6c18fa0fc8a3220fbea5f265b Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sun, 1 Nov 2020 17:14:05 +0000 Subject: [PATCH 079/303] Renaming idle_inhibitor_modules and idle_inhibitor_status to shorter, more convenient names. --- include/client.hpp | 2 -- include/modules/idle_inhibitor.hpp | 4 ++-- src/modules/idle_inhibitor.cpp | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index 902f686..39b6ae3 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -21,9 +21,7 @@ class Client { struct wl_registry * registry = nullptr; struct zwlr_layer_shell_v1 * layer_shell = nullptr; struct zxdg_output_manager_v1 * xdg_output_manager = nullptr; - struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr; - std::vector> bars; private: diff --git a/include/modules/idle_inhibitor.hpp b/include/modules/idle_inhibitor.hpp index f592631..2cbc6f1 100644 --- a/include/modules/idle_inhibitor.hpp +++ b/include/modules/idle_inhibitor.hpp @@ -12,8 +12,8 @@ class IdleInhibitor : public ALabel { IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); ~IdleInhibitor(); auto update() -> void; - static std::list idle_inhibitor_modules; - static std::string idle_inhibitor_status; + static std::list modules; + static std::string status; private: bool handleToggle(GdkEventButton* const& e); diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index ce5f991..96db879 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -1,8 +1,8 @@ #include "modules/idle_inhibitor.hpp" #include "util/command.hpp" -std::list waybar::modules::IdleInhibitor::idle_inhibitor_modules; -std::string waybar::modules::IdleInhibitor::idle_inhibitor_status = "deactivated"; +std::list waybar::modules::IdleInhibitor::modules; +std::string waybar::modules::IdleInhibitor::status = "deactivated"; waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& bar, const Json::Value& config) @@ -14,8 +14,8 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& event_box_.signal_button_press_event().connect( sigc::mem_fun(*this, &IdleInhibitor::handleToggle)); - // Add this to the Client's idle_inhibitor_modules - waybar::modules::IdleInhibitor::idle_inhibitor_modules.push_back(this); + // Add this to the modules list + waybar::modules::IdleInhibitor::modules.push_back(this); dp.emit(); } @@ -26,8 +26,8 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { idle_inhibitor_ = nullptr; } - // Remove this from the Client's idle_inhibitor_modules - waybar::modules::IdleInhibitor::idle_inhibitor_modules.remove(this); + // Remove this from the modules list + waybar::modules::IdleInhibitor::modules.remove(this); if (pid_ != -1) { kill(-pid_, 9); @@ -37,7 +37,7 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { auto waybar::modules::IdleInhibitor::update() -> void { // Check status - std::string status = waybar::modules::IdleInhibitor::idle_inhibitor_status; + std::string status = waybar::modules::IdleInhibitor::status; if (status == "activated") { if (idle_inhibitor_ == nullptr) { idle_inhibitor_ = zwp_idle_inhibit_manager_v1_create_inhibitor( @@ -62,18 +62,18 @@ auto waybar::modules::IdleInhibitor::update() -> void { bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { if (e->button == 1) { - std::string status = waybar::modules::IdleInhibitor::idle_inhibitor_status; + std::string status = waybar::modules::IdleInhibitor::status; label_.get_style_context()->remove_class(status); if (status == "activated") { status = "deactivated"; } else { status = "activated"; } - waybar::modules::IdleInhibitor::idle_inhibitor_status = status; + waybar::modules::IdleInhibitor::status = status; } // Make all other idle inhibitor modules update - for (auto const& module : waybar::modules::IdleInhibitor::idle_inhibitor_modules) { + for (auto const& module : waybar::modules::IdleInhibitor::modules) { if (module != this) { module->update(); } From b015836e7b55def65d83cba9b3367ce2c1636417 Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sun, 1 Nov 2020 18:17:51 +0000 Subject: [PATCH 080/303] Ensure style class is removed from all IdleInhibitor instances by moving it to update(). --- src/modules/idle_inhibitor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index 96db879..24d94f5 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -37,13 +37,14 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { auto waybar::modules::IdleInhibitor::update() -> void { // Check status - std::string status = waybar::modules::IdleInhibitor::status; if (status == "activated") { + label_.get_style_context()->remove_class("deactivated"); if (idle_inhibitor_ == nullptr) { idle_inhibitor_ = zwp_idle_inhibit_manager_v1_create_inhibitor( waybar::Client::inst()->idle_inhibit_manager, bar_.surface); } } else { + label_.get_style_context()->remove_class("activated"); if (idle_inhibitor_ != nullptr) { zwp_idle_inhibitor_v1_destroy(idle_inhibitor_); idle_inhibitor_ = nullptr; @@ -62,14 +63,11 @@ auto waybar::modules::IdleInhibitor::update() -> void { bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { if (e->button == 1) { - std::string status = waybar::modules::IdleInhibitor::status; - label_.get_style_context()->remove_class(status); if (status == "activated") { status = "deactivated"; } else { status = "activated"; } - waybar::modules::IdleInhibitor::status = status; } // Make all other idle inhibitor modules update From 9785a8901382278c1832320a2c67cfec75dcf45f Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sun, 1 Nov 2020 18:25:41 +0000 Subject: [PATCH 081/303] Making active a bool --- include/modules/idle_inhibitor.hpp | 4 ++-- src/modules/idle_inhibitor.cpp | 27 ++++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/modules/idle_inhibitor.hpp b/include/modules/idle_inhibitor.hpp index 2cbc6f1..4b6c097 100644 --- a/include/modules/idle_inhibitor.hpp +++ b/include/modules/idle_inhibitor.hpp @@ -12,8 +12,8 @@ class IdleInhibitor : public ALabel { IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); ~IdleInhibitor(); auto update() -> void; - static std::list modules; - static std::string status; + static std::list modules; + static bool status; private: bool handleToggle(GdkEventButton* const& e); diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index 24d94f5..ba5d694 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -2,7 +2,7 @@ #include "util/command.hpp" std::list waybar::modules::IdleInhibitor::modules; -std::string waybar::modules::IdleInhibitor::status = "deactivated"; +bool waybar::modules::IdleInhibitor::status = false; waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& bar, const Json::Value& config) @@ -37,7 +37,7 @@ waybar::modules::IdleInhibitor::~IdleInhibitor() { auto waybar::modules::IdleInhibitor::update() -> void { // Check status - if (status == "activated") { + if (status) { label_.get_style_context()->remove_class("deactivated"); if (idle_inhibitor_ == nullptr) { idle_inhibitor_ = zwp_idle_inhibit_manager_v1_create_inhibitor( @@ -51,11 +51,12 @@ auto waybar::modules::IdleInhibitor::update() -> void { } } + std::string status_text = status ? "activated" : "deactivated"; label_.set_markup( - fmt::format(format_, fmt::arg("status", status), fmt::arg("icon", getIcon(0, status)))); - label_.get_style_context()->add_class(status); + fmt::format(format_, fmt::arg("status", status_text), fmt::arg("icon", getIcon(0, status_text)))); + label_.get_style_context()->add_class(status_text); if (tooltipEnabled()) { - label_.set_tooltip_text(status); + label_.set_tooltip_text(status_text); } // Call parent update ALabel::update(); @@ -63,17 +64,13 @@ auto waybar::modules::IdleInhibitor::update() -> void { bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) { if (e->button == 1) { - if (status == "activated") { - status = "deactivated"; - } else { - status = "activated"; - } - } + status = !status; - // Make all other idle inhibitor modules update - for (auto const& module : waybar::modules::IdleInhibitor::modules) { - if (module != this) { - module->update(); + // Make all other idle inhibitor modules update + for (auto const& module : waybar::modules::IdleInhibitor::modules) { + if (module != this) { + module->update(); + } } } From d8dafa7ecc189dd203617e24441012e3ac54d9a0 Mon Sep 17 00:00:00 2001 From: Arnaud Vallette d'Osia Date: Wed, 18 Nov 2020 20:12:07 +0100 Subject: [PATCH 082/303] add minimize-raise() action --- src/modules/wlr/taskbar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 8d6fa9b..5c830e0 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -436,6 +436,14 @@ bool Task::handle_clicked(GdkEventButton *bt) activate(); else if (action == "minimize") minimize(!minimized()); + else if (action == "minimize-raise"){ + if (minimized()) + minimize(false); + else if (active()) + minimize(true); + else + activate(); + } else if (action == "maximize") maximize(!maximized()); else if (action == "fullscreen") From 82823850745d5ec367070e1a08f568c8b3a77eb8 Mon Sep 17 00:00:00 2001 From: Arnaud Vallette d'Osia Date: Sun, 22 Nov 2020 13:06:46 +0100 Subject: [PATCH 083/303] update actions on taskbar man page --- man/waybar-wlr-taskbar.5.scd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/man/waybar-wlr-taskbar.5.scd b/man/waybar-wlr-taskbar.5.scd index 55d2afd..a2bff26 100644 --- a/man/waybar-wlr-taskbar.5.scd +++ b/man/waybar-wlr-taskbar.5.scd @@ -83,9 +83,10 @@ Addressed by *wlr/taskbar* # CLICK ACTIONS *activate*: Bring the application into foreground. -*minimize*: Minimize the application. -*maximize*: Maximize the application. -*fullscreen*: Set the application to fullscreen. +*minimize*: Toggle application's minimized state. +*minimize-raise*: Bring the application into foreground or toggle its minimized state. +*maximize*: Toggle application's maximized state. +*fullscreen*: Toggle application's fullscreen state. *close*: Close the application. # EXAMPLES From 374d5ae5a198611011b8f78fc97a20b7ece5a049 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 26 Nov 2020 15:10:33 +0100 Subject: [PATCH 084/303] fix: check get_icon return non nullpt --- src/modules/wlr/taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 5c830e0..a18c3e2 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -95,7 +95,7 @@ static std::string get_from_desktop_app_info(const std::string &app_id) if (!app_info) app_info = Gio::DesktopAppInfo::create_from_filename(prefix + folder + app_id + suffix); - if (app_info) + if (app_info && app_info->get_icon() != nullptr) return app_info->get_icon()->to_string(); return ""; From 05b12602d4f1fde4c13309a0b3a70afb010d3231 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 26 Nov 2020 15:16:55 +0100 Subject: [PATCH 085/303] fix: don't check against nullptr --- src/modules/wlr/taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index a18c3e2..bdc980c 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -95,7 +95,7 @@ static std::string get_from_desktop_app_info(const std::string &app_id) if (!app_info) app_info = Gio::DesktopAppInfo::create_from_filename(prefix + folder + app_id + suffix); - if (app_info && app_info->get_icon() != nullptr) + if (app_info && app_info->get_icon()) return app_info->get_icon()->to_string(); return ""; From 85e00b2aab89381feda50f683d79287ec9f13e86 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 26 Nov 2020 15:31:40 -0800 Subject: [PATCH 086/303] fix: build fails with meson < 0.53.0 meson.build:12:0: ERROR: Module "fs" does not exist Fixes #909 --- meson.build | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 7f4ffac..1e7e22c 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,7 @@ project( 'waybar', 'cpp', 'c', version: '0.9.4', license: 'MIT', + meson_version: '>= 0.49.0', default_options : [ 'cpp_std=c++17', 'buildtype=release', @@ -9,8 +10,6 @@ project( ], ) -fs = import('fs') - compiler = meson.get_compiler('cpp') cpp_args = [] @@ -318,9 +317,9 @@ if scdoc.found() foreach file : man_files path = '@0@'.format(file) - basename = fs.name(path) + basename = path.split('/')[-1] - topic = basename.split('.')[-3].split('/')[-1] + topic = basename.split('.')[-3] section = basename.split('.')[-2] output = '@0@.@1@'.format(topic, section) From 2695985da04675a18f21d2ba4e09bb2c232b1eee Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 26 Nov 2020 15:38:41 -0800 Subject: [PATCH 087/303] fix: compilation error with gcc 11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../src/modules/network.cpp:22:6: error: ‘optional’ in namespace ‘std’ does not name a template type 22 | std::optional read_netstat(std::string_view category, std::string_view key) { | ^~~~~~~~ ../src/modules/network.cpp:7:1: note: ‘std::optional’ is defined in header ‘’; did you forget to ‘#include ’? 6 | #include "util/format.hpp" +++ |+#include 7 | #ifdef WANT_RFKILL --- src/modules/network.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 74ae913..7d9da8b 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "util/format.hpp" #ifdef WANT_RFKILL #include "util/rfkill.hpp" From 3b576ae12dc1302e7c86d2e1d98d8e578debf694 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Wed, 21 Oct 2020 13:10:10 -0400 Subject: [PATCH 088/303] Add "tooltip-format" to temperature module --- man/waybar-temperature.5.scd | 5 +++++ src/modules/temperature.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/man/waybar-temperature.5.scd b/man/waybar-temperature.5.scd index 8649736..7810a59 100644 --- a/man/waybar-temperature.5.scd +++ b/man/waybar-temperature.5.scd @@ -50,6 +50,11 @@ Addressed by *temperature* typeof: array ++ Based on the current temperature (Celsius) and *critical-threshold* if available, the corresponding icon gets selected. The order is *low* to *high*. +*tooltip-format*: ++ + typeof: string ++ + default: {temperatureC}°C ++ + The format for the tooltip + *rotate*: ++ typeof: integer ++ Positive value to rotate the text label. diff --git a/src/modules/temperature.cpp b/src/modules/temperature.cpp index dc6b2d7..84560e8 100644 --- a/src/modules/temperature.cpp +++ b/src/modules/temperature.cpp @@ -40,6 +40,16 @@ auto waybar::modules::Temperature::update() -> void { fmt::arg("temperatureF", temperature_f), fmt::arg("temperatureK", temperature_k), fmt::arg("icon", getIcon(temperature_c, "", max_temp)))); + if (tooltipEnabled()) { + std::string tooltip_format = "{temperatureC}°C"; + if (config_["tooltip-format"].isString()) { + tooltip_format = config_["tooltip-format"].asString(); + } + label_.set_tooltip_text(fmt::format(tooltip_format, + fmt::arg("temperatureC", temperature_c), + fmt::arg("temperatureF", temperature_f), + fmt::arg("temperatureK", temperature_k))); + } // Call parent update ALabel::update(); } From a7056f7ccec0126f3b2a1c86b09a4d6dacef8cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Thu, 26 Nov 2020 01:02:06 +0000 Subject: [PATCH 089/303] Calculate battery state from just energy values The energy values are all that's needed to calculate the battery state. Using other values for the total capacity results in broken results in some cases. This matches the output of TLP and i3status, while also being more straightforward. --- src/modules/battery.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index beb0554..93fcc8b 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -80,18 +80,15 @@ void waybar::modules::Battery::getBatteries() { const std::tuple waybar::modules::Battery::getInfos() const { try { - uint16_t total = 0; uint32_t total_power = 0; // μW uint32_t total_energy = 0; // μWh uint32_t total_energy_full = 0; std::string status = "Unknown"; for (auto const& bat : batteries_) { - uint16_t capacity; uint32_t power_now; uint32_t energy_full; uint32_t energy_now; std::string _status; - std::ifstream(bat / "capacity") >> capacity; std::ifstream(bat / "status") >> _status; auto rate_path = fs::exists(bat / "current_now") ? "current_now" : "power_now"; std::ifstream(bat / rate_path) >> power_now; @@ -102,7 +99,6 @@ const std::tuple waybar::modules::Battery::getInfos if (_status != "Unknown") { status = _status; } - total += capacity; total_power += power_now; total_energy += energy_now; total_energy_full += energy_full; @@ -120,7 +116,7 @@ const std::tuple waybar::modules::Battery::getInfos } else if (status == "Charging" && total_power != 0) { time_remaining = -(float)(total_energy_full - total_energy) / total_power; } - uint16_t capacity = total / batteries_.size(); + float capacity = ((float)total_energy * 100.0f / (float) total_energy_full); // Handle full-at if (config_["full-at"].isUInt()) { auto full_at = config_["full-at"].asUInt(); From e0cdcb6e30efbf56a862b0b4dfb7baa5677bf35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Thu, 26 Nov 2020 02:16:57 +0000 Subject: [PATCH 090/303] Handle charging above 100% gracefully When calibrating a battery it's possible to go above 100%. Handle that gracefully by just presenting the battery as full and 100%. --- src/modules/battery.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 93fcc8b..02e05b7 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -115,6 +115,11 @@ const std::tuple waybar::modules::Battery::getInfos time_remaining = (float)total_energy / total_power; } else if (status == "Charging" && total_power != 0) { time_remaining = -(float)(total_energy_full - total_energy) / total_power; + if (time_remaining > 0.0f) { + // If we've turned positive it means the battery is past 100% and so + // just report that as no time remaining + time_remaining = 0.0f; + } } float capacity = ((float)total_energy * 100.0f / (float) total_energy_full); // Handle full-at @@ -127,6 +132,12 @@ const std::tuple waybar::modules::Battery::getInfos } } } + if (capacity > 100.f) { + // This can happen when the battery is calibrating and goes above 100% + // Handle it gracefully by clamping at 100% and presenting it as full + capacity = 100.f; + status = "Full"; + } return {capacity, time_remaining, status}; } catch (const std::exception& e) { spdlog::error("Battery: {}", e.what()); From eb3f4216d402903b18c41b38cf4ddb8f0a72ad3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Thu, 26 Nov 2020 02:20:53 +0000 Subject: [PATCH 091/303] Show battery state as rounded number Round the battery charge state so that 99.9% shows as 100%. --- src/modules/battery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 02e05b7..eece435 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -138,7 +138,7 @@ const std::tuple waybar::modules::Battery::getInfos capacity = 100.f; status = "Full"; } - return {capacity, time_remaining, status}; + return {round(capacity), time_remaining, status}; } catch (const std::exception& e) { spdlog::error("Battery: {}", e.what()); return {0, 0, "Unknown"}; From f45d5829577d59eb9980a31793f2feb2f0c15eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Thu, 26 Nov 2020 02:34:36 +0000 Subject: [PATCH 092/303] Always mark battery as full at 100% Since we're now clamping at 100% and rounding, mark as full at that point. Some batteries will stay in charging state for a long time while stuck at the same charge level. Just mark them as full to not be confusing. --- src/modules/battery.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index eece435..2d55370 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -134,11 +134,17 @@ const std::tuple waybar::modules::Battery::getInfos } if (capacity > 100.f) { // This can happen when the battery is calibrating and goes above 100% - // Handle it gracefully by clamping at 100% and presenting it as full + // Handle it gracefully by clamping at 100% capacity = 100.f; + } + uint8_t cap = round(capacity); + if (cap == 100) { + // If we've reached 100% just mark as full as some batteries can stay + // stuck reporting they're still charging but not yet done status = "Full"; } - return {round(capacity), time_remaining, status}; + + return {cap, time_remaining, status}; } catch (const std::exception& e) { spdlog::error("Battery: {}", e.what()); return {0, 0, "Unknown"}; From 908fa2c6c239af7a27c53658940f1f20bc5fa5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Fri, 27 Nov 2020 10:55:27 +0000 Subject: [PATCH 093/303] Make the battery full-at go to 100% full-at was capped at the value instead of allowing the battery to show 100% when you were at the full-at value. Uncapping makes more sense as it makes the full-at value the new 100% and the scale goes down from there. Whereas before the battery would stay at the full-at value until it went down enough which is unrealistic. --- man/waybar-battery.5.scd | 2 +- src/modules/battery.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/man/waybar-battery.5.scd b/man/waybar-battery.5.scd index 917a03d..c9e6e78 100644 --- a/man/waybar-battery.5.scd +++ b/man/waybar-battery.5.scd @@ -20,7 +20,7 @@ The *battery* module displays the current capacity and state (eg. charging) of y *full-at*: ++ typeof: integer ++ - Define the max percentage of the battery, useful for an old battery, e.g. 96 + Define the max percentage of the battery, for when you've set the battery to stop charging at a lower level to save it. For example, if you've set the battery to stop at 80% that will become the new 100%. *interval*: ++ typeof: integer ++ diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 2d55370..031c949 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -127,9 +127,6 @@ const std::tuple waybar::modules::Battery::getInfos auto full_at = config_["full-at"].asUInt(); if (full_at < 100) { capacity = 100.f * capacity / full_at; - if (capacity > full_at) { - capacity = full_at; - } } } if (capacity > 100.f) { From 89ca155c43eea73593cacfa4f58e687851a0989c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Fri, 27 Nov 2020 13:56:04 +0000 Subject: [PATCH 094/303] Support hotplugging of batteries Refresh the list of batteries on update to handle hotplug correctly. Probably fixes #490. --- include/modules/battery.hpp | 6 ++-- src/modules/battery.cpp | 69 +++++++++++++++++++++++++++++-------- 2 files changed, 58 insertions(+), 17 deletions(-) diff --git a/include/modules/battery.hpp b/include/modules/battery.hpp index d4d20d1..f0e3c39 100644 --- a/include/modules/battery.hpp +++ b/include/modules/battery.hpp @@ -31,16 +31,16 @@ class Battery : public ALabel { private: static inline const fs::path data_dir_ = "/sys/class/power_supply/"; - void getBatteries(); + void refreshBatteries(); void worker(); const std::string getAdapterStatus(uint8_t capacity) const; const std::tuple getInfos() const; const std::string formatTimeRemaining(float hoursRemaining); - std::vector batteries_; + int global_watch; + std::map batteries_; fs::path adapter_; int fd_; - std::vector wds_; std::string old_status_; util::SleeperThread thread_; diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 031c949..84bc973 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -4,23 +4,31 @@ waybar::modules::Battery::Battery(const std::string& id, const Json::Value& config) : ALabel(config, "battery", id, "{capacity}%", 60) { - getBatteries(); fd_ = inotify_init1(IN_CLOEXEC); if (fd_ == -1) { throw std::runtime_error("Unable to listen batteries."); } - for (auto const& bat : batteries_) { - auto wd = inotify_add_watch(fd_, (bat / "uevent").c_str(), IN_ACCESS); - if (wd != -1) { - wds_.push_back(wd); - } + + // Watch the directory for any added or removed batteries + global_watch = inotify_add_watch(fd_, data_dir_.c_str(), IN_CREATE | IN_DELETE); + if (global_watch < 0) { + throw std::runtime_error("Could not watch for battery plug/unplug"); } + + refreshBatteries(); worker(); } waybar::modules::Battery::~Battery() { - for (auto wd : wds_) { - inotify_rm_watch(fd_, wd); + if (global_watch >= 0) { + inotify_rm_watch(fd_, global_watch); + } + for (auto it = batteries_.cbegin(); it != batteries_.cend(); it++) { + auto watch_id = (*it).second; + if (watch_id >= 0) { + inotify_rm_watch(fd_, watch_id); + } + batteries_.erase(it); } close(fd_); } @@ -43,7 +51,13 @@ void waybar::modules::Battery::worker() { }; } -void waybar::modules::Battery::getBatteries() { +void waybar::modules::Battery::refreshBatteries() { + // Mark existing list of batteries as not necessarily found + std::map check_map; + for (auto const& bat : batteries_) { + check_map[bat.first] = false; + } + try { for (auto& node : fs::directory_iterator(data_dir_)) { if (!fs::is_directory(node)) { @@ -54,12 +68,22 @@ void waybar::modules::Battery::getBatteries() { if (((bat_defined && dir_name == config_["bat"].asString()) || !bat_defined) && fs::exists(node.path() / "capacity") && fs::exists(node.path() / "uevent") && fs::exists(node.path() / "status") && fs::exists(node.path() / "type")) { - std::string type; - std::ifstream(node.path() / "type") >> type; + std::string type; + std::ifstream(node.path() / "type") >> type; - if (!type.compare("Battery")){ - batteries_.push_back(node.path()); + if (!type.compare("Battery")){ + check_map[node.path()] = true; + auto search = batteries_.find(node.path()); + if (search == batteries_.end()) { + // We've found a new battery save it and start listening for events + auto event_path = (node.path() / "uevent"); + auto wd = inotify_add_watch(fd_, event_path.c_str(), IN_ACCESS); + if (wd < 0) { + throw std::runtime_error("Could not watch events for " + node.path().string()); } + batteries_[node.path()] = wd; + } + } } auto adap_defined = config_["adapter"].isString(); if (((adap_defined && dir_name == config_["adapter"].asString()) || !adap_defined) && @@ -76,6 +100,17 @@ void waybar::modules::Battery::getBatteries() { } throw std::runtime_error("No batteries."); } + + // Remove any batteries that are no longer present and unwatch them + for (auto const& check : check_map) { + if (!check.second) { + auto watch_id = batteries_[check.first]; + if (watch_id >= 0) { + inotify_rm_watch(fd_, watch_id); + } + batteries_.erase(check.first); + } + } } const std::tuple waybar::modules::Battery::getInfos() const { @@ -84,7 +119,8 @@ const std::tuple waybar::modules::Battery::getInfos uint32_t total_energy = 0; // μWh uint32_t total_energy_full = 0; std::string status = "Unknown"; - for (auto const& bat : batteries_) { + for (auto const& item : batteries_) { + auto bat = item.first; uint32_t power_now; uint32_t energy_full; uint32_t energy_now; @@ -175,6 +211,11 @@ const std::string waybar::modules::Battery::formatTimeRemaining(float hoursRemai } auto waybar::modules::Battery::update() -> void { + // Make sure we have the correct set of batteries, in case of hotplug + // TODO: split the global watch into it's own event and only run the refresh + // when there's been a CREATE/DELETE event + refreshBatteries(); + auto [capacity, time_remaining, status] = getInfos(); if (status == "Unknown") { status = getAdapterStatus(capacity); From 31a4aff1f8328037ad8986e2ffd1a4a90af33114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Fri, 27 Nov 2020 14:23:37 +0000 Subject: [PATCH 095/303] Don't show battery estimate at 0 If we think we're done might as well not show 0h 0min as the estimate and just not show anything. --- src/modules/battery.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 84bc973..c506171 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -200,10 +200,14 @@ const std::string waybar::modules::Battery::getAdapterStatus(uint8_t capacity) c } const std::string waybar::modules::Battery::formatTimeRemaining(float hoursRemaining) { - hoursRemaining = std::fabs(hoursRemaining); + hoursRemaining = std::fabs(hoursRemaining); uint16_t full_hours = static_cast(hoursRemaining); uint16_t minutes = static_cast(60 * (hoursRemaining - full_hours)); auto format = std::string("{H} h {M} min"); + if (full_hours == 0 && minutes == 0) { + // Migh as well not show "0h 0min" + return ""; + } if (config_["format-time"].isString()) { format = config_["format-time"].asString(); } From c784e8170e61bc7cd36c64e0967372524cd0fd7e Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Mon, 30 Nov 2020 12:49:48 -0800 Subject: [PATCH 096/303] clock: initialize cached date We are currently using this value once before it's initialized, since we check it before we set it in Clock::calendar_text(). This was caught by Valgrind, producing the following error: ==8962== Conditional jump or move depends on uninitialised value(s) ==8962== at 0x138285: date::operator==(date::year_month_day const&, date::year_month_day const&) (date.h:2793) ==8962== by 0x135F11: waybar::modules::Clock::calendar_text[abi:cxx11](waybar::modules::waybar_time const&) (clock.cpp:111) ==8962== by 0x13587C: waybar::modules::Clock::update() (clock.cpp:62) ==8962== by 0x156EFA: waybar::Bar::getModules(waybar::Factory const&, std::__cxx11::basic_string, std::allocator > const&)::{lambda()#1}::operator()() const (bar.cpp:577) ==8962== by 0x157F39: sigc::adaptor_functor, std::allocator > const&)::{lambda()#1}>::operator()() const (adaptor_trait.h:256) ==8962== by 0x157D94: sigc::internal::slot_call0, std::allocator > const&)::{lambda()#1}, void>::call_it(sigc::internal::slot_rep*) (slot.h:136) ==8962== by 0x5177B21: Glib::DispatchNotifier::pipe_io_handler(Glib::IOCondition) (in /usr/lib/libglibmm-2.4.so.1.3.0) ==8962== by 0x517DB5B: Glib::IOSource::dispatch(sigc::slot_base*) (in /usr/lib/libglibmm-2.4.so.1.3.0) ==8962== by 0x5188B96: Glib::Source::dispatch_vfunc(_GSource*, int (*)(void*), void*) (in /usr/lib/libglibmm-2.4.so.1.3.0) ==8962== by 0x5CBC913: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6600.2) ==8962== by 0x5D107D0: ??? (in /usr/lib/libglib-2.0.so.0.6600.2) ==8962== by 0x5CBB120: g_main_context_iteration (in /usr/lib/libglib-2.0.so.0.6600.2) Initialize the value to prevent the error. --- include/modules/clock.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/modules/clock.hpp b/include/modules/clock.hpp index 643b736..b3e2634 100644 --- a/include/modules/clock.hpp +++ b/include/modules/clock.hpp @@ -29,7 +29,7 @@ class Clock : public ALabel { const date::time_zone* time_zone_; bool fixed_time_zone_; int time_zone_idx_; - date::year_month_day cached_calendar_ymd_; + date::year_month_day cached_calendar_ymd_ = date::January/1/0; std::string cached_calendar_text_; bool handleScroll(GdkEventScroll* e); From e8dbdee2385ee77c5b1f0e03dd3f3f912ee98a8e Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Mon, 30 Nov 2020 17:01:58 -0800 Subject: [PATCH 097/303] Make spdlog use the same version of fmt we use spdlog bundles a version of fmt. However, we also depend on and use fmt directly. If we don't tell spdlog not to use its bundled version, we end up with two versions of fmt in our include path, since both libraries are header-only, meaning any slight API mismatches will cause build failures and undesired behavior. We seem to have gotten lucky so far, but I ran into all sorts of issues when I tried to update to a newer version of spdlog. This change prevents them. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1e7e22c..70067ee 100644 --- a/meson.build +++ b/meson.build @@ -80,7 +80,7 @@ is_openbsd = host_machine.system() == 'openbsd' thread_dep = dependency('threads') fmt = dependency('fmt', version : ['>=5.3.0'], fallback : ['fmt', 'fmt_dep']) -spdlog = dependency('spdlog', version : ['>=1.3.1'], fallback : ['spdlog', 'spdlog_dep']) +spdlog = dependency('spdlog', version : ['>=1.3.1'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=true']) wayland_client = dependency('wayland-client') wayland_cursor = dependency('wayland-cursor') wayland_protos = dependency('wayland-protocols') From ad40511358ef057c1a0a8ff9b0bcfcf61ede6ff0 Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Mon, 30 Nov 2020 17:10:02 -0800 Subject: [PATCH 098/303] Update spdlog subproject to 1.8.1 Among other changes, this adds spdlog::should_log(), which lets us easily determine whether a log message will be printed so that we can avoid extra computation when unnecessary. New wrap file taken from https://wrapdb.mesonbuild.com/spdlog and modified to download from GitHub as per commit 99dde1aff8db ("Download patch files from Github instead of wrapdb"). --- meson.build | 2 +- subprojects/spdlog.wrap | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 70067ee..7f9db5f 100644 --- a/meson.build +++ b/meson.build @@ -80,7 +80,7 @@ is_openbsd = host_machine.system() == 'openbsd' thread_dep = dependency('threads') fmt = dependency('fmt', version : ['>=5.3.0'], fallback : ['fmt', 'fmt_dep']) -spdlog = dependency('spdlog', version : ['>=1.3.1'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=true']) +spdlog = dependency('spdlog', version : ['>=1.8.0'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=true']) wayland_client = dependency('wayland-client') wayland_cursor = dependency('wayland-cursor') wayland_protos = dependency('wayland-protocols') diff --git a/subprojects/spdlog.wrap b/subprojects/spdlog.wrap index 750036b..c30450e 100644 --- a/subprojects/spdlog.wrap +++ b/subprojects/spdlog.wrap @@ -1,10 +1,13 @@ [wrap-file] -directory = spdlog-1.3.1 +directory = spdlog-1.8.1 -source_url = https://github.com/gabime/spdlog/archive/v1.3.1.tar.gz -source_filename = v1.3.1.tar.gz -source_hash = 160845266e94db1d4922ef755637f6901266731c4cb3b30b45bf41efa0e6ab70 +source_url = https://github.com/gabime/spdlog/archive/v1.8.1.tar.gz +source_filename = v1.8.1.tar.gz +source_hash = 5197b3147cfcfaa67dd564db7b878e4a4b3d9f3443801722b3915cdeced656cb -patch_url = https://github.com/mesonbuild/spdlog/releases/download/1.3.1-1/spdlog.zip -patch_filename = spdlog-1.3.1-1-wrap.zip -patch_hash = 715a0229781019b853d409cc0bf891ee4b9d3a17bec0cf87f4ad30b28bbecc87 +patch_url = https://github.com/mesonbuild/spdlog/releases/download/1.8.1-1/spdlog.zip +patch_filename = spdlog-1.8.1-1-wrap.zip +patch_hash = 76844292a8e912aec78450618271a311841b33b17000988f215ddd6c64dd71b3 + +[provide] +spdlog = spdlog_dep From 85df7ce2da2caa8910151a28fcd42f46ea150a6b Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Mon, 30 Nov 2020 12:05:18 -0800 Subject: [PATCH 099/303] Add debug log message to print each bar's widget tree This is very useful when writing CSS that affects more than just a single widget. Pass `-l debug` to enable debug logging and show this information. Example output: [2020-11-30 12:38:51.141] [debug] GTK widget tree: window#waybar.background.bottom.eDP-1.:dir(ltr) decoration:dir(ltr) box.horizontal:dir(ltr) box.horizontal.modules-left:dir(ltr) widget:dir(ltr) box#workspaces.horizontal:dir(ltr) widget:dir(ltr) label#mode:dir(ltr) widget:dir(ltr) label#window:dir(ltr) box.horizontal.modules-center:dir(ltr) box.horizontal.modules-right:dir(ltr) widget:dir(ltr) box#tray.horizontal:dir(ltr) widget:dir(ltr) label#idle_inhibitor:dir(ltr) widget:dir(ltr) label#pulseaudio:dir(ltr) widget:dir(ltr) label#network:dir(ltr) widget:dir(ltr) label#cpu:dir(ltr) widget:dir(ltr) label#memory:dir(ltr) widget:dir(ltr) label#temperature:dir(ltr) widget:dir(ltr) label#backlight:dir(ltr) widget:dir(ltr) label#battery:dir(ltr) widget:dir(ltr) label#clock:dir(ltr) --- src/bar.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bar.cpp b/src/bar.cpp index 771adab..7bd6172 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -460,6 +460,16 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) setupWidgets(); window.show_all(); + + if (spdlog::should_log(spdlog::level::debug)) { + // Unfortunately, this function isn't in the C++ bindings, so we have to call the C version. + char* gtk_tree = gtk_style_context_to_string( + window.get_style_context()->gobj(), + (GtkStyleContextPrintFlags)(GTK_STYLE_CONTEXT_PRINT_RECURSE | + GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE)); + spdlog::debug("GTK widget tree:\n{}", gtk_tree); + g_free(gtk_tree); + } } void waybar::Bar::onMap(GdkEventAny*) { From 407bf27401c25a96cefd332fd9a5d9f1fef12fce Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Mon, 30 Nov 2020 17:32:06 -0800 Subject: [PATCH 100/303] Update fmt subproject to 7.1.3 There is no particular change in this update that we require. However, our previous version, 5.3.0, is nearly two years old, so it seems prudent to pull in all the upstream fixes that have been made since then. New wrap file taken from https://wrapdb.mesonbuild.com/fmt and modified to download from GitHub as per commit 99dde1aff8db ("Download patch files from Github instead of wrapdb"). --- subprojects/fmt.wrap | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap index eb79283..71abc80 100644 --- a/subprojects/fmt.wrap +++ b/subprojects/fmt.wrap @@ -1,10 +1,13 @@ [wrap-file] -directory = fmt-5.3.0 +directory = fmt-7.1.3 -source_url = https://github.com/fmtlib/fmt/archive/5.3.0.tar.gz -source_filename = fmt-5.3.0.tar.gz -source_hash = defa24a9af4c622a7134076602070b45721a43c51598c8456ec6f2c4dbb51c89 +source_url = https://github.com/fmtlib/fmt/archive/7.1.3.tar.gz +source_filename = fmt-7.1.3.tar.gz +source_hash = 5cae7072042b3043e12d53d50ef404bbb76949dad1de368d7f993a15c8c05ecc -patch_url = https://github.com/mesonbuild/fmt/releases/download/5.3.0-1/fmt.zip -patch_filename = fmt-5.3.0-1-wrap.zip -patch_hash = 18f21a3b8833949c35d4ac88a7059577d5fa24b98786e4b1b2d3d81bb811440f \ No newline at end of file +patch_url = https://github.com/mesonbuild/fmt/releases/download/7.1.3-1/fmt.zip +patch_filename = fmt-7.1.3-1-wrap.zip +patch_hash = 6eb951a51806fd6ffd596064825c39b844c1fe1799840ef507b61a53dba08213 + +[provide] +fmt = fmt_dep From 29f78e04267f726363d11a3fb135d60aa4ce1f41 Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Mon, 30 Nov 2020 18:07:22 -0800 Subject: [PATCH 101/303] Fix a few compiler warnings There was one uninitialized value warning and two mismatched-sign compare warnings. They both appear valid, the first occurring when MPD's "format-stopped" contains {songPosition} or {queueLength} and the second occurring when the clock's "timezones" array is more than 2 billion items long (not likely, I admit). Fix both issues. --- src/modules/clock.cpp | 10 ++++------ src/modules/mpd/mpd.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index f313606..5b2c3f4 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -85,13 +85,11 @@ bool waybar::modules::Clock::handleScroll(GdkEventScroll *e) { return true; } auto nr_zones = config_["timezones"].size(); - int new_idx = time_zone_idx_ + ((dir == SCROLL_DIR::UP) ? 1 : -1); - if (new_idx < 0) { - time_zone_idx_ = nr_zones - 1; - } else if (new_idx >= nr_zones) { - time_zone_idx_ = 0; + if (dir == SCROLL_DIR::UP) { + size_t new_idx = time_zone_idx_ + 1; + time_zone_idx_ = new_idx == nr_zones ? 0 : new_idx; } else { - time_zone_idx_ = new_idx; + time_zone_idx_ = time_zone_idx_ == 0 ? nr_zones - 1 : time_zone_idx_ - 1; } auto zone_name = config_["timezones"][time_zone_idx_]; if (!zone_name.isString() || zone_name.empty()) { diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index 710f23f..98332dc 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -100,7 +100,7 @@ void waybar::modules::MPD::setLabel() { auto format = format_; std::string artist, album_artist, album, title, date; - int song_pos, queue_length; + int song_pos = 0, queue_length = 0; std::chrono::seconds elapsedTime, totalTime; std::string stateIcon = ""; From dd596a5c6c15cd7fa7e7033b1dccf3c9868f9d1c Mon Sep 17 00:00:00 2001 From: Jeremy Attali Date: Mon, 30 Nov 2020 23:11:51 -0500 Subject: [PATCH 102/303] fix(systemd): restart when service fails The current service doesn't play too nice with Sway when it is started from [sway service](https://github.com/xdbob/sway-services). Waybar is started before the system has a display. ``` Nov 30 22:11:23 ansan waybar[1352]: Unable to init server: Could not connect: Connection refused Nov 30 22:11:23 ansan waybar[1352]: cannot open display: Nov 30 22:11:23 ansan systemd[1306]: waybar.service: Main process exited, code=exited, status=1/FAILURE Nov 30 22:11:23 ansan systemd[1306]: waybar.service: Failed with result 'exit-code'. ``` Restarting the service after the system has been initialized works nicely, so this restart rule should do the trick without tinkering with the target. --- resources/waybar.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/waybar.service.in b/resources/waybar.service.in index 2c907e9..af5832d 100644 --- a/resources/waybar.service.in +++ b/resources/waybar.service.in @@ -6,6 +6,7 @@ After=graphical-session.target [Service] ExecStart=@prefix@/bin/waybar +Restart=on-failure [Install] WantedBy=graphical-session.target From 1fe0bcacc0f30f10c9eabf3f01782b3557c4446a Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Sat, 29 Aug 2020 23:18:26 -0700 Subject: [PATCH 103/303] style: add 4px margins to window and workspaces modules These modules, unlike others, have no horizontal margins by default. This means that they'll appear uncomfortably close together in any config that puts them side-by-side. In general, the default style should make configs with any module ordering look good. Add the same 4px horizontal margins that other module have to these. To preserve the current default appearance, exempt the workspace module from a margin on the appropriate side when it's the leftmost or rightmost module on the bar. --- resources/style.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/resources/style.css b/resources/style.css index 99fbbae..920bb52 100644 --- a/resources/style.css +++ b/resources/style.css @@ -83,6 +83,21 @@ window#waybar.chromium { color: #ffffff; } +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + #clock { background-color: #64727D; } From 09c89bcd2024b29903ae2acc9fe13ae019f49e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Thu, 3 Dec 2020 09:52:33 +0000 Subject: [PATCH 104/303] Don't update battery list on every update Speedup battery state update by only updating the battery list when we get a CREATE/DELETE event in the directory or whenever we do a full refresh on the interval. --- include/modules/battery.hpp | 7 +++-- src/modules/battery.cpp | 53 +++++++++++++++++++++++++------------ 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/include/modules/battery.hpp b/include/modules/battery.hpp index f0e3c39..08dd79d 100644 --- a/include/modules/battery.hpp +++ b/include/modules/battery.hpp @@ -34,16 +34,19 @@ class Battery : public ALabel { void refreshBatteries(); void worker(); const std::string getAdapterStatus(uint8_t capacity) const; - const std::tuple getInfos() const; + const std::tuple getInfos(); const std::string formatTimeRemaining(float hoursRemaining); int global_watch; std::map batteries_; fs::path adapter_; - int fd_; + int battery_watch_fd_; + int global_watch_fd_; + std::mutex battery_list_mutex_; std::string old_status_; util::SleeperThread thread_; + util::SleeperThread thread_battery_update_; util::SleeperThread thread_timer_; }; diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index c506171..0b54e9c 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -4,13 +4,18 @@ waybar::modules::Battery::Battery(const std::string& id, const Json::Value& config) : ALabel(config, "battery", id, "{capacity}%", 60) { - fd_ = inotify_init1(IN_CLOEXEC); - if (fd_ == -1) { + battery_watch_fd_ = inotify_init1(IN_CLOEXEC); + if (battery_watch_fd_ == -1) { + throw std::runtime_error("Unable to listen batteries."); + } + + global_watch_fd_ = inotify_init1(IN_CLOEXEC); + if (global_watch_fd_ == -1) { throw std::runtime_error("Unable to listen batteries."); } // Watch the directory for any added or removed batteries - global_watch = inotify_add_watch(fd_, data_dir_.c_str(), IN_CREATE | IN_DELETE); + global_watch = inotify_add_watch(global_watch_fd_, data_dir_.c_str(), IN_CREATE | IN_DELETE); if (global_watch < 0) { throw std::runtime_error("Could not watch for battery plug/unplug"); } @@ -20,38 +25,55 @@ waybar::modules::Battery::Battery(const std::string& id, const Json::Value& conf } waybar::modules::Battery::~Battery() { + std::lock_guard guard(battery_list_mutex_); + if (global_watch >= 0) { - inotify_rm_watch(fd_, global_watch); + inotify_rm_watch(global_watch_fd_, global_watch); } + close(global_watch_fd_); + for (auto it = batteries_.cbegin(); it != batteries_.cend(); it++) { auto watch_id = (*it).second; if (watch_id >= 0) { - inotify_rm_watch(fd_, watch_id); + inotify_rm_watch(battery_watch_fd_, watch_id); } batteries_.erase(it); } - close(fd_); + close(battery_watch_fd_); } void waybar::modules::Battery::worker() { thread_timer_ = [this] { + // Make sure we eventually update the list of batteries even if we miss an + // inotify event for some reason + refreshBatteries(); dp.emit(); thread_timer_.sleep_for(interval_); }; thread_ = [this] { struct inotify_event event = {0}; - int nbytes = read(fd_, &event, sizeof(event)); + int nbytes = read(battery_watch_fd_, &event, sizeof(event)); if (nbytes != sizeof(event) || event.mask & IN_IGNORED) { thread_.stop(); return; } - // TODO: don't stop timer for now since there is some bugs :? - // thread_timer_.stop(); + dp.emit(); + }; + thread_battery_update_ = [this] { + struct inotify_event event = {0}; + int nbytes = read(global_watch_fd_, &event, sizeof(event)); + if (nbytes != sizeof(event) || event.mask & IN_IGNORED) { + thread_.stop(); + return; + } + refreshBatteries(); dp.emit(); }; } void waybar::modules::Battery::refreshBatteries() { + std::lock_guard guard(battery_list_mutex_); + // Mark existing list of batteries as not necessarily found std::map check_map; for (auto const& bat : batteries_) { @@ -77,7 +99,7 @@ void waybar::modules::Battery::refreshBatteries() { if (search == batteries_.end()) { // We've found a new battery save it and start listening for events auto event_path = (node.path() / "uevent"); - auto wd = inotify_add_watch(fd_, event_path.c_str(), IN_ACCESS); + auto wd = inotify_add_watch(battery_watch_fd_, event_path.c_str(), IN_ACCESS); if (wd < 0) { throw std::runtime_error("Could not watch events for " + node.path().string()); } @@ -106,14 +128,16 @@ void waybar::modules::Battery::refreshBatteries() { if (!check.second) { auto watch_id = batteries_[check.first]; if (watch_id >= 0) { - inotify_rm_watch(fd_, watch_id); + inotify_rm_watch(battery_watch_fd_, watch_id); } batteries_.erase(check.first); } } } -const std::tuple waybar::modules::Battery::getInfos() const { +const std::tuple waybar::modules::Battery::getInfos() { + std::lock_guard guard(battery_list_mutex_); + try { uint32_t total_power = 0; // μW uint32_t total_energy = 0; // μWh @@ -215,11 +239,6 @@ const std::string waybar::modules::Battery::formatTimeRemaining(float hoursRemai } auto waybar::modules::Battery::update() -> void { - // Make sure we have the correct set of batteries, in case of hotplug - // TODO: split the global watch into it's own event and only run the refresh - // when there's been a CREATE/DELETE event - refreshBatteries(); - auto [capacity, time_remaining, status] = getInfos(); if (status == "Unknown") { status = getAdapterStatus(capacity); From bb60e68b9d39cb21b195cbd156d05b0987fc653f Mon Sep 17 00:00:00 2001 From: Till Smejkal Date: Thu, 3 Dec 2020 21:52:20 +0100 Subject: [PATCH 105/303] Update to the latest version of the foreign toplevel manager protocol There was an update the of the toplevel manager protocol. Unfortunately, there are no new interesting updates with regard to the taskbar implementation. Nonetheless, update the protocol xml files to the latest version so that the implementation is up-to-date. While being there, also change the debug warning that is shown when there is a version mismatch between the server and client version of the protocol. --- ...lr-foreign-toplevel-management-unstable-v1.xml | 15 +++++++++++++-- src/modules/wlr/taskbar.cpp | 13 +++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/protocol/wlr-foreign-toplevel-management-unstable-v1.xml b/protocol/wlr-foreign-toplevel-management-unstable-v1.xml index a97738f..1081337 100644 --- a/protocol/wlr-foreign-toplevel-management-unstable-v1.xml +++ b/protocol/wlr-foreign-toplevel-management-unstable-v1.xml @@ -25,7 +25,7 @@ THIS SOFTWARE. - + The purpose of this protocol is to enable the creation of taskbars and docks by providing them with a list of opened applications and @@ -68,7 +68,7 @@ - + A zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel window. Each app may have multiple opened toplevels. @@ -255,5 +255,16 @@ actually changes, this will be indicated by the state event. + + + + + + This event is emitted whenever the parent of the toplevel changes. + + No event is emitted when the parent handle is destroyed by the client. + + + diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index bdc980c..0a42ca1 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -187,6 +187,12 @@ static void tl_handle_done(void *data, struct zwlr_foreign_toplevel_handle_v1 *h return static_cast(data)->handle_done(); } +static void tl_handle_parent(void *data, struct zwlr_foreign_toplevel_handle_v1 *handle, + struct zwlr_foreign_toplevel_handle_v1 *parent) +{ + /* This is explicitly left blank */ +} + static void tl_handle_closed(void *data, struct zwlr_foreign_toplevel_handle_v1 *handle) { return static_cast(data)->handle_closed(); @@ -200,6 +206,7 @@ static const struct zwlr_foreign_toplevel_handle_v1_listener toplevel_handle_imp .state = tl_handle_state, .done = tl_handle_done, .closed = tl_handle_closed, + .parent = tl_handle_parent, }; Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar, @@ -661,9 +668,11 @@ void Taskbar::register_manager(struct wl_registry *registry, uint32_t name, uint spdlog::warn("Register foreign toplevel manager again although already existing!"); return; } - if (version < ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN_SINCE_VERSION) { - spdlog::warn("Using different foreign toplevel manager protocol version: {}", version); + if (version < ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_SET_FULLSCREEN_SINCE_VERSION) { + spdlog::warn("Foreign toplevel manager server does not have the appropriate version." + " To be able to use all features, you need at least version 2, but server is version {}", version); } + // limit version to a highest supported by the client protocol file version = std::min(version, zwlr_foreign_toplevel_manager_v1_interface.version); From 18f129a7128ee7a3991fba316fe956c455177360 Mon Sep 17 00:00:00 2001 From: Till Smejkal Date: Fri, 4 Dec 2020 08:04:02 +0100 Subject: [PATCH 106/303] Spit out a warning when trying to set/unset fullscreen without server supporting it Previously we only checked when connecting to the server whether it had the minimum required version but didn't act accordingly in the various functions that use the functionality of later versions. If there were a server in the wild, that actually would not have this functionality, there would have been a crash. Fix this by checking the version before using the functionality and gracefully abort it. --- src/modules/wlr/taskbar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 0a42ca1..e70ad9c 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -546,6 +546,11 @@ void Task::activate() void Task::fullscreen(bool set) { + if (zwlr_foreign_toplevel_handle_v1_get_version(handle_) < ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_SET_FULLSCREEN_SINCE_VERSION) { + spdlog::warn("Foreign toplevel manager server does not support for set/unset fullscreen."); + return; + } + if (set) zwlr_foreign_toplevel_handle_v1_set_fullscreen(handle_, nullptr); else From 68b6136989bf102b30a05b7b1964c44bca59a57b Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 4 Dec 2020 00:38:18 -0800 Subject: [PATCH 107/303] fix(sway/workspaces): ignore emulated scroll events GDK Wayland backend can emit two events for mouse scroll: one is a GDK_SCROLL_SMOOTH and the other one is an emulated scroll event with direction. We only receive emulated events on a window, thus it is not possible to handle these in a module and stop propagation. Ignoring emulated events should be safe since those are duplicates of smooth scroll events anyways. Fixes #386 --- src/modules/sway/workspaces.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 8d78bf5..d0c2463 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -291,6 +291,12 @@ std::string Workspaces::getIcon(const std::string &name, const Json::Value &node } bool Workspaces::handleScroll(GdkEventScroll *e) { + if (gdk_event_get_pointer_emulated((GdkEvent *)e)) { + /** + * Ignore emulated scroll events on window + */ + return false; + } auto dir = AModule::getScrollDir(e); if (dir == SCROLL_DIR::NONE) { return true; From 0d03c1d4da50ef248b197c29301e7cd879f98336 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Fri, 4 Dec 2020 23:44:43 +0100 Subject: [PATCH 108/303] Fix waybar-pulseaudio with pipewire-pulse --- src/modules/pulseaudio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 571a78e..b5193f5 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -178,8 +178,8 @@ void waybar::modules::Pulseaudio::serverInfoCb(pa_context *context, const pa_ser pa->default_sink_name_ = i->default_sink_name; pa->default_source_name_ = i->default_source_name; - pa_context_get_sink_info_by_name(context, i->default_sink_name, sinkInfoCb, data); - pa_context_get_source_info_by_name(context, i->default_source_name, sourceInfoCb, data); + pa_context_get_sink_info_by_name(context, "@DEFAULT_SINK@", sinkInfoCb, data); + pa_context_get_source_info_by_name(context, "@DEFAULT_SOURCE@", sourceInfoCb, data); } static const std::array ports = { From 50ecc972843fd6dcc514775349a8b733e1dd2468 Mon Sep 17 00:00:00 2001 From: danielrainer <34983953+danielrainer@users.noreply.github.com> Date: Sat, 12 Dec 2020 23:21:17 +0100 Subject: [PATCH 109/303] Fix typo --- man/waybar-states.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/waybar-states.5.scd b/man/waybar-states.5.scd index fe6a730..ae2df1b 100644 --- a/man/waybar-states.5.scd +++ b/man/waybar-states.5.scd @@ -13,7 +13,7 @@ apply a class when the value matches the declared state value. Each class gets activated when the current capacity is equal or below the configured **. - Also each state can have its own *format*. - Those con be configured via *format-*. + Those can be configured via *format-*. Or if you want to differentiate a bit more even as *format--*. # EXAMPLE From 85ca5027f41b4c15a7c90a5ffeef3c1f5a2d2340 Mon Sep 17 00:00:00 2001 From: Harit Kapadia Date: Fri, 18 Dec 2020 18:14:14 -0500 Subject: [PATCH 110/303] Fix Sway #waybar.solo CSS rule applying on split This error occurs because of an incorrect assumption that the size of the list of nodes that contains the focused window is the number of windows in a workspace. The windows in a workspace are stored as a tree by Sway, rather than a list, so the number of windows has to be found by counting the leaves of a workspace tree. --- src/modules/sway/window.cpp | 47 +++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index f10bf1c..64f7252 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -64,29 +64,51 @@ auto Window::update() -> void { ALabel::update(); } -std::tuple Window::getFocusedNode( - const Json::Value& nodes, std::string& output) { - for (auto const& node : nodes) { +int leafNodesInWorkspace(const Json::Value& node) { + auto const& nodes = node["nodes"]; + if(nodes.empty()) { + if(node["type"] == "workspace") + return 0; + else + return 1; + } + int sum = 0; + for(auto const& node : nodes) + sum += leafNodesInWorkspace(node); + return sum; +} + +std::tuple gfnWithWorkspace( + const Json::Value& nodes, std::string& output, const Json::Value& config_, + const Bar& bar_, Json::Value& parentWorkspace) { + for(auto const& node : nodes) { if (node["output"].isString()) { output = node["output"].asString(); } + // found node if (node["focused"].asBool() && (node["type"] == "con" || node["type"] == "floating_con")) { if ((!config_["all-outputs"].asBool() && output == bar_.output->name) || config_["all-outputs"].asBool()) { auto app_id = node["app_id"].isString() ? node["app_id"].asString() - : node["window_properties"]["instance"].asString(); - return {nodes.size(), - node["id"].asInt(), - Glib::Markup::escape_text(node["name"].asString()), - app_id}; + : node["window_properties"]["instance"].asString(); + int nb = node.size(); + if(parentWorkspace != 0) + nb = leafNodesInWorkspace(parentWorkspace); + return {nb, + node["id"].asInt(), + Glib::Markup::escape_text(node["name"].asString()), + app_id}; } } - auto [nb, id, name, app_id] = getFocusedNode(node["nodes"], output); + // iterate + if(node["type"] == "workspace") + parentWorkspace = node; + auto [nb, id, name, app_id] = gfnWithWorkspace(node["nodes"], output, config_, bar_, parentWorkspace); if (id > -1 && !name.empty()) { return {nb, id, name, app_id}; } // Search for floating node - std::tie(nb, id, name, app_id) = getFocusedNode(node["floating_nodes"], output); + std::tie(nb, id, name, app_id) = gfnWithWorkspace(node["floating_nodes"], output, config_, bar_, parentWorkspace); if (id > -1 && !name.empty()) { return {nb, id, name, app_id}; } @@ -94,6 +116,11 @@ std::tuple Window::getFocusedNode( return {0, -1, "", ""}; } +std::tuple Window::getFocusedNode( + const Json::Value& nodes, std::string& output) { + return gfnWithWorkspace(nodes, output, config_, bar_, placeholder); +} + void Window::getTree() { try { ipc_.sendCmd(IPC_GET_TREE); From cb7baee045d41d32bd4d90f7e0237f1ec925b528 Mon Sep 17 00:00:00 2001 From: Harit Kapadia Date: Fri, 18 Dec 2020 18:17:17 -0500 Subject: [PATCH 111/303] Fixed compile error --- src/modules/sway/window.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index 64f7252..e920345 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -118,6 +118,7 @@ std::tuple gfnWithWorkspace( std::tuple Window::getFocusedNode( const Json::Value& nodes, std::string& output) { + Json::Value placeholder = 0; return gfnWithWorkspace(nodes, output, config_, bar_, placeholder); } From 4b29aef048b640f162cd4d0b7ad082fc20b1c0b8 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 23 Dec 2020 21:33:40 +0100 Subject: [PATCH 112/303] chore: v0.9.5 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7f9db5f..839c1dc 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project( 'waybar', 'cpp', 'c', - version: '0.9.4', + version: '0.9.5', license: 'MIT', meson_version: '>= 0.49.0', default_options : [ From e4340a7536d31332d8e455714d160d343d462932 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 29 Nov 2020 20:43:04 +0000 Subject: [PATCH 113/303] CI: add FreeBSD to Actions --- .github/workflows/freebsd.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/freebsd.yml diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml new file mode 100644 index 0000000..7072c49 --- /dev/null +++ b/.github/workflows/freebsd.yml @@ -0,0 +1,22 @@ +name: freebsd + +on: [ push, pull_request ] + +jobs: + clang: + runs-on: macos-latest # until https://github.com/actions/runner/issues/385 + steps: + - uses: actions/checkout@v2 + - name: Test in FreeBSD VM + uses: vmactions/freebsd-vm@v0.0.9 # aka FreeBSD 12.2 + with: + usesh: true + prepare: | + export CPPFLAGS=-isystem/usr/local/include LDFLAGS=-L/usr/local/lib # sndio + sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + pkg install -y git # subprojects/date + pkg install -y gtk-layer-shell gtkmm30 jsoncpp libdbusmenu sndio \ + libfmt libmpdclient libudev-devd meson pkgconf pulseaudio scdoc spdlog + run: | + meson build -Dman-pages=enabled + ninja -C build From f3911867496d4d3f119e5a5f464aa2ff30f90750 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 25 Dec 2020 09:28:05 +0100 Subject: [PATCH 114/303] Revert "Replace lowercase "k" with uppercase "K" to make it look more consistent" --- include/util/format.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/util/format.hpp b/include/util/format.hpp index d7d1609..288d8f0 100644 --- a/include/util/format.hpp +++ b/include/util/format.hpp @@ -42,7 +42,7 @@ namespace fmt { template auto format(const pow_format& s, FormatContext &ctx) -> decltype (ctx.out()) { - const char* units[] = { "", "K", "M", "G", "T", "P", nullptr}; + const char* units[] = { "", "k", "M", "G", "T", "P", nullptr}; auto base = s.binary_ ? 1024ull : 1000ll; auto fraction = (double) s.val_; From 005af7f7b743731229d6e7d7866a5628650bce68 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Fri, 25 Dec 2020 17:37:21 +0100 Subject: [PATCH 115/303] Revert "Fix waybar-pulseaudio with pipewire-pulse" This reverts commit 0d03c1d4da50ef248b197c29301e7cd879f98336. --- src/modules/pulseaudio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index b5193f5..571a78e 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -178,8 +178,8 @@ void waybar::modules::Pulseaudio::serverInfoCb(pa_context *context, const pa_ser pa->default_sink_name_ = i->default_sink_name; pa->default_source_name_ = i->default_source_name; - pa_context_get_sink_info_by_name(context, "@DEFAULT_SINK@", sinkInfoCb, data); - pa_context_get_source_info_by_name(context, "@DEFAULT_SOURCE@", sourceInfoCb, data); + pa_context_get_sink_info_by_name(context, i->default_sink_name, sinkInfoCb, data); + pa_context_get_source_info_by_name(context, i->default_source_name, sourceInfoCb, data); } static const std::array ports = { From 0233e0eeec03f9eb00b98bbf04301852431c0cdd Mon Sep 17 00:00:00 2001 From: Andreas Backx Date: Fri, 25 Dec 2020 20:54:38 +0000 Subject: [PATCH 116/303] Added waybar_output.identifier support. Resolves #602. --- include/bar.hpp | 1 + include/client.hpp | 15 ++++++++------- src/client.cpp | 48 ++++++++++++++++++++++++++++------------------ 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 8aab8f7..d6cd895 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -17,6 +17,7 @@ class Factory; struct waybar_output { Glib::RefPtr monitor; std::string name; + std::string identifier; std::unique_ptr xdg_output = { nullptr, &zxdg_output_v1_destroy}; diff --git a/include/client.hpp b/include/client.hpp index 05215cc..f533942 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -6,6 +6,7 @@ #include #include #include + #include "bar.hpp" struct zwlr_layer_shell_v1; @@ -33,18 +34,18 @@ class Client { std::tuple getConfigs(const std::string &config, const std::string &style) const; void bindInterfaces(); - const std::string getValidPath(const std::vector &paths) const; - void handleOutput(struct waybar_output &output); - bool isValidOutput(const Json::Value &config, struct waybar_output &output); - auto setupConfig(const std::string &config_file) -> void; - auto setupCss(const std::string &css_file) -> void; - struct waybar_output &getOutput(void *); + const std::string getValidPath(const std::vector &paths) const; + void handleOutput(struct waybar_output &output); + bool isValidOutput(const Json::Value &config, struct waybar_output &output); + auto setupConfig(const std::string &config_file) -> void; + auto setupCss(const std::string &css_file) -> void; + struct waybar_output & getOutput(void *); std::vector getOutputConfigs(struct waybar_output &output); static void handleGlobal(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version); static void handleGlobalRemove(void *data, struct wl_registry *registry, uint32_t name); - static void handleOutputName(void *, struct zxdg_output_v1 *, const char *); + static void handleOutputDescription(void *, struct zxdg_output_v1 *, const char *); void handleMonitorAdded(Glib::RefPtr monitor); void handleMonitorRemoved(Glib::RefPtr monitor); diff --git a/src/client.cpp b/src/client.cpp index 005761e..627904c 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1,12 +1,14 @@ #include "client.hpp" + #include #include + #include #include -#include "util/clara.hpp" -#include "util/json.hpp" #include "idle-inhibit-unstable-v1-client-protocol.h" +#include "util/clara.hpp" +#include "util/json.hpp" #include "wlr-layer-shell-unstable-v1-client-protocol.h" waybar::Client *waybar::Client::inst() { @@ -59,8 +61,8 @@ void waybar::Client::handleOutput(struct waybar_output &output) { .logical_position = [](void *, struct zxdg_output_v1 *, int32_t, int32_t) {}, .logical_size = [](void *, struct zxdg_output_v1 *, int32_t, int32_t) {}, .done = [](void *, struct zxdg_output_v1 *) {}, - .name = &handleOutputName, - .description = [](void *, struct zxdg_output_v1 *, const char *) {}, + .name = [](void *, struct zxdg_output_v1 *, const char *) {}, + .description = &handleOutputDescription, }; // owned by output->monitor; no need to destroy auto wl_output = gdk_wayland_monitor_get_wl_output(output.monitor->gobj()); @@ -71,18 +73,21 @@ void waybar::Client::handleOutput(struct waybar_output &output) { bool waybar::Client::isValidOutput(const Json::Value &config, struct waybar_output &output) { if (config["output"].isArray()) { for (auto const &output_conf : config["output"]) { - if (output_conf.isString() && output_conf.asString() == output.name) { + if (output_conf.isString() && + (output_conf.asString() == output.name || output_conf.asString() == output.identifier)) { + std::cout << output_conf.asString() << std::endl; return true; } } return false; } else if (config["output"].isString()) { - auto config_output_name = config["output"].asString(); - if (!config_output_name.empty()) { - if (config_output_name.substr(0, 1) == "!") { - return config_output_name.substr(1) != output.name; + auto config_output = config["output"].asString(); + if (!config_output.empty()) { + if (config_output.substr(0, 1) == "!") { + return config_output.substr(1) != output.name || + config_output.substr(1) != output.identifier; } - return config_output_name == output.name; + return config_output == output.name || config_output == output.identifier; } } @@ -112,16 +117,20 @@ std::vector waybar::Client::getOutputConfigs(struct waybar_output & return configs; } -void waybar::Client::handleOutputName(void * data, struct zxdg_output_v1 * /*xdg_output*/, - const char *name) { +void waybar::Client::handleOutputDescription(void *data, struct zxdg_output_v1 * /*xdg_output*/, + const char *description) { auto client = waybar::Client::inst(); try { - auto &output = client->getOutput(data); - output.name = name; - spdlog::debug("Output detected: {} ({} {})", - name, - output.monitor->get_manufacturer(), - output.monitor->get_model()); + auto & output = client->getOutput(data); + const char *open_paren = strrchr(description, '('); + const char *close_paren = strrchr(description, ')'); + + // Description format: "identifier (name)" + size_t identifier_length = open_paren - description; + output.identifier = std::string(description, identifier_length - 1); + output.name = std::string(description + identifier_length + 1, close_paren - open_paren - 1); + + spdlog::debug("Output detected: {}", description); auto configs = client->getOutputConfigs(output); if (configs.empty()) { output.xdg_output.reset(); @@ -260,7 +269,8 @@ int waybar::Client::main(int argc, char *argv[]) { if (!log_level.empty()) { spdlog::set_level(spdlog::level::from_str(log_level)); } - gtk_app = Gtk::Application::create(argc, argv, "fr.arouillard.waybar", Gio::APPLICATION_HANDLES_COMMAND_LINE); + gtk_app = Gtk::Application::create( + argc, argv, "fr.arouillard.waybar", Gio::APPLICATION_HANDLES_COMMAND_LINE); gdk_display = Gdk::Display::get_default(); if (!gdk_display) { throw std::runtime_error("Can't find display"); From e5684c6127d2fb063a7171a35cd52e03d5187ab3 Mon Sep 17 00:00:00 2001 From: Andreas Backx Date: Fri, 25 Dec 2020 23:03:01 +0000 Subject: [PATCH 117/303] Separated name and description setup and moved bar creation to done callback. --- include/client.hpp | 2 ++ src/client.cpp | 51 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index f533942..f2eafb1 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -45,6 +45,8 @@ class Client { static void handleGlobal(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version); static void handleGlobalRemove(void *data, struct wl_registry *registry, uint32_t name); + static void handleOutputDone(void *, struct zxdg_output_v1 *); + static void handleOutputName(void *, struct zxdg_output_v1 *, const char *); static void handleOutputDescription(void *, struct zxdg_output_v1 *, const char *); void handleMonitorAdded(Glib::RefPtr monitor); void handleMonitorRemoved(Glib::RefPtr monitor); diff --git a/src/client.cpp b/src/client.cpp index 627904c..4240f09 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -60,8 +60,8 @@ void waybar::Client::handleOutput(struct waybar_output &output) { static const struct zxdg_output_v1_listener xdgOutputListener = { .logical_position = [](void *, struct zxdg_output_v1 *, int32_t, int32_t) {}, .logical_size = [](void *, struct zxdg_output_v1 *, int32_t, int32_t) {}, - .done = [](void *, struct zxdg_output_v1 *) {}, - .name = [](void *, struct zxdg_output_v1 *, const char *) {}, + .done = &handleOutputDone, + .name = &handleOutputName, .description = &handleOutputDescription, }; // owned by output->monitor; no need to destroy @@ -75,7 +75,6 @@ bool waybar::Client::isValidOutput(const Json::Value &config, struct waybar_outp for (auto const &output_conf : config["output"]) { if (output_conf.isString() && (output_conf.asString() == output.name || output_conf.asString() == output.identifier)) { - std::cout << output_conf.asString() << std::endl; return true; } } @@ -84,7 +83,7 @@ bool waybar::Client::isValidOutput(const Json::Value &config, struct waybar_outp auto config_output = config["output"].asString(); if (!config_output.empty()) { if (config_output.substr(0, 1) == "!") { - return config_output.substr(1) != output.name || + return config_output.substr(1) != output.name && config_output.substr(1) != output.identifier; } return config_output == output.name || config_output == output.identifier; @@ -117,20 +116,12 @@ std::vector waybar::Client::getOutputConfigs(struct waybar_output & return configs; } -void waybar::Client::handleOutputDescription(void *data, struct zxdg_output_v1 * /*xdg_output*/, - const char *description) { +void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_output*/) { auto client = waybar::Client::inst(); try { - auto & output = client->getOutput(data); - const char *open_paren = strrchr(description, '('); - const char *close_paren = strrchr(description, ')'); + auto &output = client->getOutput(data); + spdlog::debug("Output detection done: {} ({})", output.name, output.identifier); - // Description format: "identifier (name)" - size_t identifier_length = open_paren - description; - output.identifier = std::string(description, identifier_length - 1); - output.name = std::string(description + identifier_length + 1, close_paren - open_paren - 1); - - spdlog::debug("Output detected: {}", description); auto configs = client->getOutputConfigs(output); if (configs.empty()) { output.xdg_output.reset(); @@ -148,6 +139,36 @@ void waybar::Client::handleOutputDescription(void *data, struct zxdg_output_v1 * } } +void waybar::Client::handleOutputName(void * data, struct zxdg_output_v1 * /*xdg_output*/, + const char *name) { + auto client = waybar::Client::inst(); + try { + auto &output = client->getOutput(data); + spdlog::debug("Output detected with name: {} ({} {})", + name, + output.monitor->get_manufacturer(), + output.monitor->get_model()); + output.name = name; + } catch (const std::exception &e) { + std::cerr << e.what() << std::endl; + } +} + +void waybar::Client::handleOutputDescription(void *data, struct zxdg_output_v1 * /*xdg_output*/, + const char *description) { + auto client = waybar::Client::inst(); + try { + auto & output = client->getOutput(data); + const char *open_paren = strrchr(description, '('); + + // Description format: "identifier (name)" + size_t identifier_length = open_paren - description; + output.identifier = std::string(description, identifier_length - 1); + } catch (const std::exception &e) { + std::cerr << e.what() << std::endl; + } +} + void waybar::Client::handleMonitorAdded(Glib::RefPtr monitor) { auto &output = outputs_.emplace_back(); output.monitor = monitor; From 3fbbbf85416cb6755cd0b6fb81f84e8938b58658 Mon Sep 17 00:00:00 2001 From: Andreas Backx Date: Fri, 25 Dec 2020 23:31:29 +0000 Subject: [PATCH 118/303] Removed redundant log line. --- src/client.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 4240f09..ad281d5 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -144,10 +144,6 @@ void waybar::Client::handleOutputName(void * data, struct zxdg_output_v1 * auto client = waybar::Client::inst(); try { auto &output = client->getOutput(data); - spdlog::debug("Output detected with name: {} ({} {})", - name, - output.monitor->get_manufacturer(), - output.monitor->get_model()); output.name = name; } catch (const std::exception &e) { std::cerr << e.what() << std::endl; From c0361e8546213d8d4653859329a7d02da4f56191 Mon Sep 17 00:00:00 2001 From: dorgnarg Date: Mon, 28 Dec 2020 13:34:59 -0700 Subject: [PATCH 119/303] A hopeful fix to the module section classes when the bar is vertical --- src/bar.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bar.cpp b/src/bar.cpp index 7bd6172..10cf0fc 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -387,6 +387,9 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) center_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); right_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); box_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); + left_.get_style_context()->add_class("modules-left"); + center_.get_style_context()->add_class("modules-center"); + right_.get_style_context()->add_class("modules-right"); vertical = true; } From 42e86677739a62abaeb078cfdaed773e6ce03eea Mon Sep 17 00:00:00 2001 From: dorgnarg Date: Mon, 28 Dec 2020 13:44:16 -0700 Subject: [PATCH 120/303] Better way of doing it by just moving the original delcarations after everything's for sure been set --- src/bar.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/bar.cpp b/src/bar.cpp index 10cf0fc..1dbd69a 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -370,9 +370,6 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) window.get_style_context()->add_class(output->name); window.get_style_context()->add_class(config["name"].asString()); window.get_style_context()->add_class(config["position"].asString()); - left_.get_style_context()->add_class("modules-left"); - center_.get_style_context()->add_class("modules-center"); - right_.get_style_context()->add_class("modules-right"); if (config["layer"] == "top") { layer_ = bar_layer::TOP; @@ -387,11 +384,12 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) center_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); right_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); box_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); - left_.get_style_context()->add_class("modules-left"); - center_.get_style_context()->add_class("modules-center"); - right_.get_style_context()->add_class("modules-right"); vertical = true; } + + left_.get_style_context()->add_class("modules-left"); + center_.get_style_context()->add_class("modules-center"); + right_.get_style_context()->add_class("modules-right"); uint32_t height = config["height"].isUInt() ? config["height"].asUInt() : 0; uint32_t width = config["width"].isUInt() ? config["width"].asUInt() : 0; From 00046d309d25c29d8b339475c028685b0dafb221 Mon Sep 17 00:00:00 2001 From: ocisra Date: Sun, 3 Jan 2021 15:25:19 +0100 Subject: [PATCH 121/303] add an option to use battery design capacity as a reference for percentage informations --- man/waybar-battery.5.scd | 5 +++++ src/modules/battery.cpp | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/man/waybar-battery.5.scd b/man/waybar-battery.5.scd index c9e6e78..869df32 100644 --- a/man/waybar-battery.5.scd +++ b/man/waybar-battery.5.scd @@ -22,6 +22,11 @@ The *battery* module displays the current capacity and state (eg. charging) of y typeof: integer ++ Define the max percentage of the battery, for when you've set the battery to stop charging at a lower level to save it. For example, if you've set the battery to stop at 80% that will become the new 100%. +*design-capacity*: ++ + typeof: bool ++ + default: false ++ + Option to use the battery design capacity instead of it's current maximal capacity. + *interval*: ++ typeof: integer ++ default: 60 ++ diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 0b54e9c..daf113c 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -142,12 +142,14 @@ const std::tuple waybar::modules::Battery::getInfos uint32_t total_power = 0; // μW uint32_t total_energy = 0; // μWh uint32_t total_energy_full = 0; + uint32_t total_energy_full_design = 0; std::string status = "Unknown"; for (auto const& item : batteries_) { auto bat = item.first; uint32_t power_now; uint32_t energy_full; uint32_t energy_now; + uint32_t energy_full_design; std::string _status; std::ifstream(bat / "status") >> _status; auto rate_path = fs::exists(bat / "current_now") ? "current_now" : "power_now"; @@ -156,17 +158,20 @@ const std::tuple waybar::modules::Battery::getInfos std::ifstream(bat / now_path) >> energy_now; auto full_path = fs::exists(bat / "charge_full") ? "charge_full" : "energy_full"; std::ifstream(bat / full_path) >> energy_full; + auto full_design_path = fs::exists(bat / "charge_full_design") ? "charge_full_design" : "energy_full_design"; + std::ifstream(bat / full_design_path) >> energy_full_design; if (_status != "Unknown") { status = _status; } total_power += power_now; total_energy += energy_now; total_energy_full += energy_full; + total_energy_full_design += energy_full_design; } if (!adapter_.empty() && status == "Discharging") { bool online; std::ifstream(adapter_ / "online") >> online; - if (online) { + if (online) { status = "Plugged"; } } @@ -182,6 +187,10 @@ const std::tuple waybar::modules::Battery::getInfos } } float capacity = ((float)total_energy * 100.0f / (float) total_energy_full); + // Handle design-capacity + if (config_["design-capacity"].isBool() ? config_["design-capacity"].asBool() : false) { + capacity = ((float)total_energy * 100.0f / (float) total_energy_full_design); + } // Handle full-at if (config_["full-at"].isUInt()) { auto full_at = config_["full-at"].asUInt(); From f20dbbbd74316917b0541c7b64aa29f3d58d66ee Mon Sep 17 00:00:00 2001 From: Johannes Christenson Date: Sun, 3 Jan 2021 19:08:06 +0100 Subject: [PATCH 122/303] Fixing logic in getIcon --- src/ALabel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 3a4063d..9371a0e 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -60,14 +60,14 @@ std::string ALabel::getIcon(uint16_t percentage, const std::string& alt, uint16_ std::string ALabel::getIcon(uint16_t percentage, std::vector& alts, uint16_t max) { auto format_icons = config_["format-icons"]; if (format_icons.isObject()) { + std::string _alt = "default"; for (const auto& alt : alts) { if (!alt.empty() && (format_icons[alt].isString() || format_icons[alt].isArray())) { - format_icons = format_icons[alt]; + _alt = alt; break; - } else { - format_icons = format_icons["default"]; } } + format_icons = format_icons[_alt]; } if (format_icons.isArray()) { auto size = format_icons.size(); From ef9c3ef1cbb57afa2f64a70282fffe33e5519dfe Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 6 Jan 2021 07:03:14 -0800 Subject: [PATCH 123/303] fix(wlr/taskbar): fix wl_array out-of-bounds access wl_array->size contains the number of bytes in the array instead of the number of elements. --- src/modules/wlr/taskbar.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index e70ad9c..46147bd 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -367,16 +367,16 @@ void Task::handle_output_leave(struct wl_output *output) void Task::handle_state(struct wl_array *state) { state_ = 0; - for (auto* entry = static_cast(state->data); - entry < static_cast(state->data) + state->size; - entry++) { - if (*entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MAXIMIZED) + size_t size = state->size / sizeof(uint32_t); + for (size_t i = 0; i < size; ++i) { + auto entry = static_cast(state->data)[i]; + if (entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MAXIMIZED) state_ |= MAXIMIZED; - if (*entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MINIMIZED) + if (entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MINIMIZED) state_ |= MINIMIZED; - if (*entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED) + if (entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED) state_ |= ACTIVE; - if (*entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN) + if (entry == ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN) state_ |= FULLSCREEN; } } From b79301a5bdafb2d0a7764990530898996a97c386 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 8 Jan 2021 15:07:04 -0800 Subject: [PATCH 124/303] fix(wlr/taskbar): protocol error when reconnecting outputs Destroy request is not specified for foreign toplevel manager and it does not prevent the compositor from sending more events. Libwayland would ignore events to a destroyed objects, but that could indirectly cause a gap in the sequence of new object ids and trigger error condition in the library. With this commit waybar sends a `stop` request to notify the compositor about the destruction of a toplevel manager. That fixes abnormal termination of the bar with following errors: ``` (waybar:11791): Gdk-DEBUG: 20:04:19.778: not a valid new object id (4278190088), message toplevel(n) Gdk-Message: 20:04:19.778: Error reading events from display: Invalid argument ``` --- src/modules/wlr/taskbar.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 46147bd..4cbb8ce 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -637,8 +637,20 @@ Taskbar::Taskbar(const std::string &id, const waybar::Bar &bar, const Json::Valu Taskbar::~Taskbar() { if (manager_) { - zwlr_foreign_toplevel_manager_v1_destroy(manager_); - manager_ = nullptr; + struct wl_display *display = Client::inst()->wl_display; + /* + * Send `stop` request and wait for one roundtrip. + * This is not quite correct as the protocol encourages us to wait for the .finished event, + * but it should work with wlroots foreign toplevel manager implementation. + */ + zwlr_foreign_toplevel_manager_v1_stop(manager_); + wl_display_roundtrip(display); + + if (manager_) { + spdlog::warn("Foreign toplevel manager destroyed before .finished event"); + zwlr_foreign_toplevel_manager_v1_destroy(manager_); + manager_ = nullptr; + } } } From f4ffb21c8c364eea6589f88dbf49d7661d2f07a6 Mon Sep 17 00:00:00 2001 From: Kamus Hadenes Date: Tue, 12 Jan 2021 18:51:44 -0300 Subject: [PATCH 125/303] improve sink/source separation Add additional fields, namely `source_volume` and `source_desc` Add `tooltip-format`, reverting to default behavior if not specified Add additional CSS classes, namely `sink-muted` and `source-muted` --- src/modules/pulseaudio.cpp | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 571a78e..72327fe 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -207,6 +207,7 @@ const std::string waybar::modules::Pulseaudio::getPortIcon() const { auto waybar::modules::Pulseaudio::update() -> void { auto format = format_; + std::string tooltip_format; if (!alt_) { std::string format_name = "format"; if (monitor_.find("a2dp_sink") != std::string::npos) { @@ -222,28 +223,53 @@ auto waybar::modules::Pulseaudio::update() -> void { } format_name = format_name + "-muted"; label_.get_style_context()->add_class("muted"); + label_.get_style_context()->add_class("sink-muted"); } else { label_.get_style_context()->remove_class("muted"); + label_.get_style_context()->remove_class("sink-muted"); } format = config_[format_name].isString() ? config_[format_name].asString() : format; } // TODO: find a better way to split source/sink std::string format_source = "{volume}%"; - if (source_muted_ && config_["format-source-muted"].isString()) { - format_source = config_["format-source-muted"].asString(); - } else if (!source_muted_ && config_["format-source"].isString()) { - format_source = config_["format-source"].asString(); + if (source_muted_) { + label_.get_style_context()->add_class("source-muted"); + if (config_["format-source-muted"].isString()) { + format_source = config_["format-source-muted"].asString(); + } + } else { + label_.get_style_context()->remove_class("source-muted"); + if (config_["format-source-muted"].isString()) { + format_source = config_["format-source"].asString(); + } } format_source = fmt::format(format_source, fmt::arg("volume", source_volume_)); label_.set_markup(fmt::format(format, fmt::arg("desc", desc_), fmt::arg("volume", volume_), fmt::arg("format_source", format_source), + fmt::arg("source_volume", source_volume_), + fmt::arg("source_desc", source_desc_), fmt::arg("icon", getIcon(volume_, getPortIcon())))); getState(volume_); + if (tooltipEnabled()) { - label_.set_tooltip_text(desc_); + if (tooltip_format.empty() && config_["tooltip-format"].isString()) { + tooltip_format = config_["tooltip-format"].asString(); + } + if (!tooltip_format.empty()) { + label_.set_tooltip_text(fmt::format( + tooltip_format, + fmt::arg("desc", desc_), + fmt::arg("volume", volume_), + fmt::arg("format_source", format_source), + fmt::arg("source_volume", source_volume_), + fmt::arg("source_desc", source_desc_), + fmt::arg("icon", getIcon(volume_, getPortIcon()))); + } else { + label_.set_tooltip_text(desc_); + } } // Call parent update From a7941a00c59035415066acf387822322982a3238 Mon Sep 17 00:00:00 2001 From: Kamus Hadenes Date: Tue, 12 Jan 2021 19:10:34 -0300 Subject: [PATCH 126/303] fix missing parentheses --- src/modules/pulseaudio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 72327fe..7f4f3b6 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -266,7 +266,7 @@ auto waybar::modules::Pulseaudio::update() -> void { fmt::arg("format_source", format_source), fmt::arg("source_volume", source_volume_), fmt::arg("source_desc", source_desc_), - fmt::arg("icon", getIcon(volume_, getPortIcon()))); + fmt::arg("icon", getIcon(volume_, getPortIcon())))); } else { label_.set_tooltip_text(desc_); } From 9d5ce45f3b7571d10d19ee122f9739c6b3d04e40 Mon Sep 17 00:00:00 2001 From: sjtio Date: Fri, 15 Jan 2021 01:07:56 +0000 Subject: [PATCH 127/303] add option tag-labels to river/tags --- man/waybar-river-tags.5.scd | 4 ++++ src/modules/river/tags.cpp | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/man/waybar-river-tags.5.scd b/man/waybar-river-tags.5.scd index a02ddeb..0f02724 100644 --- a/man/waybar-river-tags.5.scd +++ b/man/waybar-river-tags.5.scd @@ -17,6 +17,10 @@ Addressed by *river/tags* default: 9 ++ The number of tags that should be displayed. +*tag-labels*: ++ + typeof: array ++ + The label to display for each tag. + # EXAMPLE ``` diff --git a/src/modules/river/tags.cpp b/src/modules/river/tags.cpp index 804ea09..e96b201 100644 --- a/src/modules/river/tags.cpp +++ b/src/modules/river/tags.cpp @@ -3,6 +3,8 @@ #include #include +#include + #include "client.hpp" #include "modules/river/tags.hpp" #include "river-status-unstable-v1-client-protocol.h" @@ -64,8 +66,20 @@ Tags::Tags(const std::string &id, const waybar::Bar &bar, const Json::Value &con // Default to 9 tags const uint32_t num_tags = config["num-tags"].isUInt() ? config_["num-tags"].asUInt() : 9; - for (uint32_t tag = 1; tag <= num_tags; ++tag) { - Gtk::Button &button = buttons_.emplace_back(std::to_string(tag)); + + std::vector tag_labels(num_tags); + for (uint32_t tag = 0; tag < num_tags; ++tag) { + tag_labels[tag] = std::to_string(tag+1); + } + const Json::Value custom_labels = config["tag-labels"]; + if (custom_labels.isArray() && !custom_labels.empty()) { + for (uint32_t tag = 0; tag < std::min(num_tags, custom_labels.size()); ++tag) { + tag_labels[tag] = custom_labels[tag].asString(); + } + } + + for (const auto &tag_label : tag_labels) { + Gtk::Button &button = buttons_.emplace_back(tag_label); button.set_relief(Gtk::RELIEF_NONE); box_.pack_start(button, false, false, 0); button.show(); From ce0bf6269b3b75ccc3a37792e1b4065cd15b98a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20=C4=8Cernoch?= Date: Mon, 18 Jan 2021 12:32:51 +0100 Subject: [PATCH 128/303] battery: use timeTo as the default format name --- src/modules/battery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index e0f9aca..8b86212 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -253,7 +253,7 @@ auto waybar::modules::Battery::update() -> void { auto time_remaining_formatted = formatTimeRemaining(time_remaining); if (tooltipEnabled()) { std::string tooltip_text_default; - std::string tooltip_format = "{autoTooltip}"; + std::string tooltip_format = "{timeTo}"; if (time_remaining != 0) { std::string time_to = std::string("Time to ") + ((time_remaining > 0) ? "empty" : "full"); tooltip_text_default = time_to + ": " + time_remaining_formatted; @@ -270,7 +270,7 @@ auto waybar::modules::Battery::update() -> void { tooltip_format = config_["tooltip-format"].asString(); } label_.set_tooltip_text(fmt::format(tooltip_format, - fmt::arg("autoTooltip", tooltip_text_default), + fmt::arg("timeTo", tooltip_text_default), fmt::arg("capacity", capacity), fmt::arg("time", time_remaining_formatted))); } From 0bd96f339eadca58142e694732ac2381cc5ea9b7 Mon Sep 17 00:00:00 2001 From: ocisra Date: Mon, 18 Jan 2021 12:38:02 +0100 Subject: [PATCH 129/303] typo --- .../index/ALabel.cpp.09E9F4748A3CBF6C.idx | Bin 0 -> 3224 bytes .../index/ALabel.hpp.81F9065828AA88EC.idx | Bin 0 -> 1438 bytes .../index/AModule.cpp.8C79E6793B0ABDDC.idx | Bin 0 -> 3206 bytes .../index/AModule.hpp.D8753B04060BBA88.idx | Bin 0 -> 1730 bytes .../index/IModule.hpp.E1245342A901572D.idx | Bin 0 -> 482 bytes .../index/backlight.cpp.8F986B9BECE3CA9B.idx | Bin 0 -> 5394 bytes .../index/backlight.hpp.0EF1448C3968172E.idx | Bin 0 -> 2104 bytes .../clangd/index/bar.cpp.499C72A404C3B6E0.idx | Bin 0 -> 11056 bytes .../clangd/index/bar.hpp.548C657FFF81C379.idx | Bin 0 -> 3490 bytes .../index/battery.cpp.C1194A004F38A6C5.idx | Bin 0 -> 5698 bytes .../index/battery.hpp.A5CF2192CCD687A2.idx | Bin 0 -> 1704 bytes .../clangd/index/clara.hpp.37039B002C851AB7.idx | Bin 0 -> 30604 bytes .../index/client.cpp.142786E5739C6086.idx | Bin 0 -> 3324 bytes .../index/client.cpp.90DC0642EC0F3846.idx | Bin 0 -> 7640 bytes .../index/client.hpp.B4D0F538B28EFA9A.idx | Bin 0 -> 1852 bytes .../index/client.hpp.F7B62724EF944420.idx | Bin 0 -> 2630 bytes .../clangd/index/clock.cpp.622BF041106573C2.idx | Bin 0 -> 4824 bytes .../clangd/index/clock.hpp.6C252B8E1A974E1B.idx | Bin 0 -> 1528 bytes .../index/command.hpp.11D8330C13D77545.idx | Bin 0 -> 2266 bytes .../index/common.cpp.8896DC31B9E7EE81.idx | Bin 0 -> 2080 bytes .../index/common.cpp.FA1CA1F6B4D16C67.idx | Bin 0 -> 1866 bytes .../clangd/index/cpu.hpp.A6F11840DCF8A513.idx | Bin 0 -> 1026 bytes .../index/custom.cpp.EA9CE9AF81C1E5D4.idx | Bin 0 -> 4732 bytes .../index/custom.hpp.36F2F4DF290D9AA1.idx | Bin 0 -> 1720 bytes .../clangd/index/disk.cpp.1F7580C201D672A2.idx | Bin 0 -> 1998 bytes .../clangd/index/disk.hpp.E57994872D8447F8.idx | Bin 0 -> 728 bytes .../index/factory.cpp.CEDE1C1627112064.idx | Bin 0 -> 2394 bytes .../index/factory.hpp.2AEC37A00908E370.idx | Bin 0 -> 904 bytes .../index/format.hpp.A472BFB350A64B30.idx | Bin 0 -> 964 bytes .../clangd/index/host.cpp.0C1CF26FC798A71A.idx | Bin 0 -> 4080 bytes .../clangd/index/host.hpp.D6E6FF9FFAF571DF.idx | Bin 0 -> 1978 bytes .../idle_inhibitor.cpp.3D718BD05B870FA9.idx | Bin 0 -> 2398 bytes .../idle_inhibitor.hpp.A4AFAA5C5DDDE471.idx | Bin 0 -> 898 bytes .../clangd/index/ipc.hpp.804BDBBDF260032D.idx | Bin 0 -> 1498 bytes .../clangd/index/item.cpp.BDF1AC58410539C1.idx | Bin 0 -> 7280 bytes .../clangd/index/item.hpp.CF2C10DA19A462FB.idx | Bin 0 -> 3008 bytes .../clangd/index/json.hpp.6C08A0DAD19BC4D8.idx | Bin 0 -> 750 bytes .../index/language.cpp.7CFC0E2AB711785B.idx | Bin 0 -> 2412 bytes .../index/language.hpp.045E99AD59170347.idx | Bin 0 -> 954 bytes .../clangd/index/linux.cpp.AA11E43948BF7636.idx | Bin 0 -> 1320 bytes .../clangd/index/linux.cpp.EBDA54C079A9D2C4.idx | Bin 0 -> 1528 bytes .../clangd/index/main.cpp.9D6EE073CE3F67E9.idx | Bin 0 -> 2136 bytes .../index/memory.hpp.220BFCF008454788.idx | Bin 0 -> 740 bytes .../clangd/index/mode.cpp.DEC43BA6A32D0056.idx | Bin 0 -> 2090 bytes .../clangd/index/mode.hpp.6A926FBEE534F2A9.idx | Bin 0 -> 888 bytes .../clangd/index/mpd.cpp.7FCBEF52ABE61287.idx | Bin 0 -> 6492 bytes .../clangd/index/mpd.hpp.F92558038735ED47.idx | Bin 0 -> 2124 bytes .../index/network.cpp.109ECEBB28F3CA1E.idx | Bin 0 -> 12826 bytes .../index/network.hpp.959179E628BFA829.idx | Bin 0 -> 3296 bytes .../index/pulseaudio.cpp.33560C8DDD3A5AD3.idx | Bin 0 -> 5832 bytes .../index/pulseaudio.hpp.C6D74738A7A6B198.idx | Bin 0 -> 2202 bytes .../sleeper_thread.hpp.B273FAC75439EB17.idx | Bin 0 -> 1672 bytes .../clangd/index/sndio.cpp.1174277772D16F52.idx | Bin 0 -> 3834 bytes .../clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx | Bin 0 -> 1304 bytes .../clangd/index/state.cpp.E5F8B9AFD9E7ED3F.idx | Bin 0 -> 7084 bytes .../clangd/index/state.hpp.210A97315D520642.idx | Bin 0 -> 7032 bytes .../index/state.inl.hpp.07C5BE693644AFA7.idx | Bin 0 -> 1336 bytes .../clangd/index/tags.cpp.901229A9EA5F0AD7.idx | Bin 0 -> 3004 bytes .../clangd/index/tags.hpp.38EBC6B49867D962.idx | Bin 0 -> 1076 bytes .../index/taskbar.cpp.3B871EDA6D279756.idx | Bin 0 -> 12886 bytes .../index/taskbar.hpp.3F1105A3E0CB852D.idx | Bin 0 -> 5366 bytes .../index/temperature.cpp.BB5C0ED5BD80EEFE.idx | Bin 0 -> 2538 bytes .../index/temperature.hpp.58F6012FF8EB97C4.idx | Bin 0 -> 818 bytes .../clangd/index/tray.cpp.02A8D890AD31BCCD.idx | Bin 0 -> 2114 bytes .../clangd/index/tray.hpp.469C1AF36DEA64C2.idx | Bin 0 -> 988 bytes .../index/watcher.cpp.793479CFFB135BF1.idx | Bin 0 -> 4334 bytes .../index/watcher.hpp.F4849F54352399E5.idx | Bin 0 -> 2232 bytes .../index/window.cpp.8AB8664D31F55915.idx | Bin 0 -> 3582 bytes .../index/window.hpp.E69A5ADAD0A0E8F9.idx | Bin 0 -> 1456 bytes .../index/workspaces.cpp.EC0CB7DF82BEDBA3.idx | Bin 0 -> 7454 bytes .../index/workspaces.hpp.0FDE443B68162423.idx | Bin 0 -> 2044 bytes src/modules/battery.cpp | 2 +- 72 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .cache/clangd/index/ALabel.cpp.09E9F4748A3CBF6C.idx create mode 100644 .cache/clangd/index/ALabel.hpp.81F9065828AA88EC.idx create mode 100644 .cache/clangd/index/AModule.cpp.8C79E6793B0ABDDC.idx create mode 100644 .cache/clangd/index/AModule.hpp.D8753B04060BBA88.idx create mode 100644 .cache/clangd/index/IModule.hpp.E1245342A901572D.idx create mode 100644 .cache/clangd/index/backlight.cpp.8F986B9BECE3CA9B.idx create mode 100644 .cache/clangd/index/backlight.hpp.0EF1448C3968172E.idx create mode 100644 .cache/clangd/index/bar.cpp.499C72A404C3B6E0.idx create mode 100644 .cache/clangd/index/bar.hpp.548C657FFF81C379.idx create mode 100644 .cache/clangd/index/battery.cpp.C1194A004F38A6C5.idx create mode 100644 .cache/clangd/index/battery.hpp.A5CF2192CCD687A2.idx create mode 100644 .cache/clangd/index/clara.hpp.37039B002C851AB7.idx create mode 100644 .cache/clangd/index/client.cpp.142786E5739C6086.idx create mode 100644 .cache/clangd/index/client.cpp.90DC0642EC0F3846.idx create mode 100644 .cache/clangd/index/client.hpp.B4D0F538B28EFA9A.idx create mode 100644 .cache/clangd/index/client.hpp.F7B62724EF944420.idx create mode 100644 .cache/clangd/index/clock.cpp.622BF041106573C2.idx create mode 100644 .cache/clangd/index/clock.hpp.6C252B8E1A974E1B.idx create mode 100644 .cache/clangd/index/command.hpp.11D8330C13D77545.idx create mode 100644 .cache/clangd/index/common.cpp.8896DC31B9E7EE81.idx create mode 100644 .cache/clangd/index/common.cpp.FA1CA1F6B4D16C67.idx create mode 100644 .cache/clangd/index/cpu.hpp.A6F11840DCF8A513.idx create mode 100644 .cache/clangd/index/custom.cpp.EA9CE9AF81C1E5D4.idx create mode 100644 .cache/clangd/index/custom.hpp.36F2F4DF290D9AA1.idx create mode 100644 .cache/clangd/index/disk.cpp.1F7580C201D672A2.idx create mode 100644 .cache/clangd/index/disk.hpp.E57994872D8447F8.idx create mode 100644 .cache/clangd/index/factory.cpp.CEDE1C1627112064.idx create mode 100644 .cache/clangd/index/factory.hpp.2AEC37A00908E370.idx create mode 100644 .cache/clangd/index/format.hpp.A472BFB350A64B30.idx create mode 100644 .cache/clangd/index/host.cpp.0C1CF26FC798A71A.idx create mode 100644 .cache/clangd/index/host.hpp.D6E6FF9FFAF571DF.idx create mode 100644 .cache/clangd/index/idle_inhibitor.cpp.3D718BD05B870FA9.idx create mode 100644 .cache/clangd/index/idle_inhibitor.hpp.A4AFAA5C5DDDE471.idx create mode 100644 .cache/clangd/index/ipc.hpp.804BDBBDF260032D.idx create mode 100644 .cache/clangd/index/item.cpp.BDF1AC58410539C1.idx create mode 100644 .cache/clangd/index/item.hpp.CF2C10DA19A462FB.idx create mode 100644 .cache/clangd/index/json.hpp.6C08A0DAD19BC4D8.idx create mode 100644 .cache/clangd/index/language.cpp.7CFC0E2AB711785B.idx create mode 100644 .cache/clangd/index/language.hpp.045E99AD59170347.idx create mode 100644 .cache/clangd/index/linux.cpp.AA11E43948BF7636.idx create mode 100644 .cache/clangd/index/linux.cpp.EBDA54C079A9D2C4.idx create mode 100644 .cache/clangd/index/main.cpp.9D6EE073CE3F67E9.idx create mode 100644 .cache/clangd/index/memory.hpp.220BFCF008454788.idx create mode 100644 .cache/clangd/index/mode.cpp.DEC43BA6A32D0056.idx create mode 100644 .cache/clangd/index/mode.hpp.6A926FBEE534F2A9.idx create mode 100644 .cache/clangd/index/mpd.cpp.7FCBEF52ABE61287.idx create mode 100644 .cache/clangd/index/mpd.hpp.F92558038735ED47.idx create mode 100644 .cache/clangd/index/network.cpp.109ECEBB28F3CA1E.idx create mode 100644 .cache/clangd/index/network.hpp.959179E628BFA829.idx create mode 100644 .cache/clangd/index/pulseaudio.cpp.33560C8DDD3A5AD3.idx create mode 100644 .cache/clangd/index/pulseaudio.hpp.C6D74738A7A6B198.idx create mode 100644 .cache/clangd/index/sleeper_thread.hpp.B273FAC75439EB17.idx create mode 100644 .cache/clangd/index/sndio.cpp.1174277772D16F52.idx create mode 100644 .cache/clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx create mode 100644 .cache/clangd/index/state.cpp.E5F8B9AFD9E7ED3F.idx create mode 100644 .cache/clangd/index/state.hpp.210A97315D520642.idx create mode 100644 .cache/clangd/index/state.inl.hpp.07C5BE693644AFA7.idx create mode 100644 .cache/clangd/index/tags.cpp.901229A9EA5F0AD7.idx create mode 100644 .cache/clangd/index/tags.hpp.38EBC6B49867D962.idx create mode 100644 .cache/clangd/index/taskbar.cpp.3B871EDA6D279756.idx create mode 100644 .cache/clangd/index/taskbar.hpp.3F1105A3E0CB852D.idx create mode 100644 .cache/clangd/index/temperature.cpp.BB5C0ED5BD80EEFE.idx create mode 100644 .cache/clangd/index/temperature.hpp.58F6012FF8EB97C4.idx create mode 100644 .cache/clangd/index/tray.cpp.02A8D890AD31BCCD.idx create mode 100644 .cache/clangd/index/tray.hpp.469C1AF36DEA64C2.idx create mode 100644 .cache/clangd/index/watcher.cpp.793479CFFB135BF1.idx create mode 100644 .cache/clangd/index/watcher.hpp.F4849F54352399E5.idx create mode 100644 .cache/clangd/index/window.cpp.8AB8664D31F55915.idx create mode 100644 .cache/clangd/index/window.hpp.E69A5ADAD0A0E8F9.idx create mode 100644 .cache/clangd/index/workspaces.cpp.EC0CB7DF82BEDBA3.idx create mode 100644 .cache/clangd/index/workspaces.hpp.0FDE443B68162423.idx diff --git a/.cache/clangd/index/ALabel.cpp.09E9F4748A3CBF6C.idx b/.cache/clangd/index/ALabel.cpp.09E9F4748A3CBF6C.idx new file mode 100644 index 0000000000000000000000000000000000000000..ce9ae3c77ff53668450d36c7f728fc9387c484cc GIT binary patch literal 3224 zcmYLL30PCt5)R>#^(KTQge;I12qZ+nu!sTK6j=olLO7zJgb-zs62yXQt5Tn$Rur^u zpw_yfXrBtWpj6SK^@$6L)&&>DiW|1JihbHQX+M4U`|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=K?6vBwHg7kbxM%g=&G^dm-y%nypWc0NUQn5{*Uu<+Pms@{9Uc$+Vmb=*6oa(c zUl`t-@?75V?*jil&(ilX&c0rDoT0cfH)#>j{T$Ipl0Po>-Ob0uB*?%bCM%{0CKxzC zo&^HQx4z+@dG_w$V`2u%i_41ZfC;#~qjK{GhyM5f1emx4Av#$2#rS36@;(;??t41< zcknTB0`-f?il~4IxO`B}zC8OYhqd{bc!BbwvZ88W0xq8+d0T@+o&zWX>k6QckF3nv>V513%!goGa> z3*#BpzVpv#Ke;Tx#0_(yl$ewp+=i=Wk!!bReaaGG;)lueiSfz6<%?3&iZ>(06eAZn zhF}o`K^_)B{fR!y+Ij0Avez2n4_)3uq=NreJXc4gqMd!oLwA9O7TmHhWH7oznEyl3UsG{u7EKt zdV%f)MJp^efm~25=GsIE+f9u+22?D}F3baqOQ3r|5!wFZ$jgwx?=3)CDS0V1SWGf9 zfn#v;ylUgF0|#1xvfQHFQm}Xgnhc7+9d1)A);T=C!N|hG@5t|bnQH#U{`kP%OeC56A^Y+QZ1(55k2D%M&E7m)1Bxjx(Z-F3Ktw6ox? zmC?rjZ~^&GjAw-lSDV2FY|dSHt;no#5-#9ZywJu!$9@)EAj!LJI!8e3Q@B7ob1Fwl zqx@^QK%f1RzONS1i{Jta*4lsSU@Z2A3mlDVjhp3mZ6#dba&g#tIir_yaDl7Nf)%$8 zmCu9={E*b{Q8^^%UtE-2Yz-)w6s@`}X!q7B+ScRt5lU Cca^#T literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/AModule.cpp.8C79E6793B0ABDDC.idx b/.cache/clangd/index/AModule.cpp.8C79E6793B0ABDDC.idx new file mode 100644 index 0000000000000000000000000000000000000000..c782cda4988b99322fe60e0a6a72ab6213ae373f GIT binary patch literal 3206 zcmYM030M=?7RQH>3|VGE5(6Yb2#G-U4I)ceLI7E05l~1Nl*b}f%p$V*;sSm8tou^; zwSu^7MSUtoTu`jFRX;73D%Pcpc^yS8KT5=Lr*-@ZW;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%WVt%F-$g z{B)$0E0gc{+>P|<= TG_Gfs4~NChEKVPtk&XNfhRExb literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/AModule.hpp.D8753B04060BBA88.idx b/.cache/clangd/index/AModule.hpp.D8753B04060BBA88.idx new file mode 100644 index 0000000000000000000000000000000000000000..89805e901843f756a5e62f3548a9bbe530f5a76b GIT binary patch literal 1730 zcmYL}drVVT9LH}Dl+xa3TYB5l7t$6GVlc6ok*G`%6kl_lk8Mmhz+#wo3oUF`w?C%U zB@>9q#$+gtiLyXcHVrbye3T7e_`n(Gbi5LnhKvrK#5Nk-IakkZlYVp0`JCVRo!)-# zb>`>gb;S@w&c^($ZdZ9>G(iwF{Cdkhr78(QaDX7T9;n*4@HPKzZrA;me=arL`ab!C zyxU(zpKsSyuPEKr?9NQgSXcY%kCmE=+Z%SYq=g*QPYUb}g`H=rg4+DR{yN`a z)1EH!1l2cHJOA^i3vPVee>K0xH_$$zfA*vIs%MqFV?*q~mhWXx5DLED;SkAIIy2i14OW9rKrL zRxm&gxlv;@3L$dk&asQWMOlY+AlCF^M@GpiwIVm`YmQ}B+vE(OV7*$c)(9c;v|;zD zAjefQKnJ;1ZPf}P@+NcLvJeq|XDC$E+H;!&dR(uk^^xB{^42|F zcyRV}8ITwVhKwO;Aqe>kKO~G~B)oz=nHku_04?lb&=}%{5Ia0x5R|qJRRRw1xPyhY zL^_1d+PBYWt6HuFX3SXyON#ZO{#Pb%PWviYLWb@@JZ}_2f&s z$XfEHr*McQ#ac=vf{t-vwsF_t?!P4zW0ILzEG1lwjKmJYArf%zhnq60Tys{!#TKI_ z6&r{eLH*v4=leVY%$q#DgNnxQ?W~H&3s1SOIO_azP zWFQs~Qe++W48X-uGK$dw9kqi8<0A*ZT?XJVUY9~K3C4uf+NANGdjC)BU>9|)T2&h3J0Xr4Au417S<*h<(7*@z{CLnI$|4jl{%cY1B>W%Ig5CEURVY;uaR1G^l1 z2TPD|STk6H92p0{=Cn2sQ(q6Ke5vOF`Gzfyyhemei7Fk84Ze8u&=#=0s88OmE>I(^he!>xYq6 z`R2}capH2Dr=U#s^96C@R!+~m^OiCpabhC;z%%(Uu%7UGioJ``3q$qdt$~vH^3Ud} ZgsCf(lvAqIETN1bb>xzbTyl}i{{aqF*CPM` literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/IModule.hpp.E1245342A901572D.idx b/.cache/clangd/index/IModule.hpp.E1245342A901572D.idx new file mode 100644 index 0000000000000000000000000000000000000000..0cd620b4b98f7703747b40bbd019c8d09ed25964 GIT binary patch literal 482 zcmWIYbaT7K$iU#7;#rZKT9U}Zz`(!@#Kk2=nax1@01#KqN&fKVtiR@2&s2`{KA!%% zfdR=Lr_Xq9y>$Kh`4i`Tub%fmr=#a}h2MXTkC)D+^Jl!zY5ICzZGUy~w1!55w!W_0 ziRIH%ol@m^pH)F<5aV9Pf z24)T}4sI|3m;ap;z3b_mp4041jO+}|Y;0`2U;<`7BQs-BYFcq1&}f)T89Bi&gjvkU z2(}Pr4Anu~sx%xC0b=2GNRhuOl!1vZ_BnS+}{h@mJoCs7b+GEA1?VdQOz hpZ5&@GZYsk7mI_u1N9|{$^86&meSXmN7@)!7ywNGiB|vs literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/backlight.cpp.8F986B9BECE3CA9B.idx b/.cache/clangd/index/backlight.cpp.8F986B9BECE3CA9B.idx new file mode 100644 index 0000000000000000000000000000000000000000..99750d6c12bb86b1c93034b38e3bd765f6f71bb4 GIT binary patch literal 5394 zcmYLM2|U!>7oRi6jO90G!3=Px1YRT6F5UiCk}>6v^!zQ23Vx#!$-&pr2?Gl9N7K61)5nrDJ|NWnycvw=8e9~J6YfM4%^$jBpw$3;xtxNcD{*e!OFF)x^ZxmRdbKG zRCe{+$&rrddYba@@5p86E$Etg+~N5CNB<65U-OBx8F;6bbj*R zIzjrCjO@)%pD>@*rL%TwnSN_t`&Hoqx7zjf!*4TAzu)`b?#1HH&n{>7^FFt@*t>r0B7 zIr}YVRP8lQtn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*d(CauGqE0s0w`8E^cMTn|e1pe6TT_jg^dtmB{Gp4>*`jsoK-5I4U1*Qh!K z_#vSl9P7cQL)yXc8ZCYa+PhS7DLNs~GtZlu8 zWMVMxVP@SJuN#cKAWTlSrq*ETR1+T(K3GyGky-!e-2Y6Lm*An zZuK9nI`WH5N_s|SR%+TpT8e~AOZz#DPfJJ*#cA-IIWSdqf|`$$_askaHxqYjZBq|3 z`^kE?`XW0=1EYzW8oDm(I#V3Hw4BWiU9Bu_EL3I+e5d;bPE(dvq|37v2$qbL9Frld S#F-`Jb9n*z{y{Tl)BX>(deA!n literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/backlight.hpp.0EF1448C3968172E.idx b/.cache/clangd/index/backlight.hpp.0EF1448C3968172E.idx new file mode 100644 index 0000000000000000000000000000000000000000..70c3018bca32f25fb5a88850f9d31a0ed8d7205c GIT binary patch literal 2104 zcmYk52~ZPP9L6^5}dcFr>- z^(1ea=k+jSYFBHBJ#X;axTVhhyAQqBtC(0ac<)))nS}Z;ax$YUPfoZoC(gUSB`M>X zzVUHv=8L{Pkx!mC$8)EnAJ==2oCrH?G{oknl=Y3>FYfxp5>z~5yZCuA;eCWXIICo^ zsIq3C?8^}S+QV0-Sm?x;hNj%MQf5;1_1cgFb%wgC$}_9)4EVYoXqdVFsL!F>b4oVv ztx4w!b7GsT62CEh7uYlHWS_NeV3kvEg*oY2=uV&LGRb$77kTU zD9b4|XU3n)+A~;lHJ&Rf@6{<|3X2<8j@`aCt?Z}c%+#MrGA?I!*vPPA!A@n1_U@6A z;{6TP&pS2@9m-A3nmn`Q;OmwrrX3B#YyPYry*xH^t7`B;YVEbJ)&(zWlRf=mWn`w}1WK&GRxECDAv-j{8Lbe?hWZO4t}tard(2*Y zTs94SkRM@)m@J6sf6!$5H?U_Ql?ERE1T--wjUb|*Y=5%}JZ;jcfS+ajOfZlRl z&slP(QF5Llbf^P*R&NpnbpS{RnH+VXdgHd0O((1)4DiJ(_>=xnT%mU0iGSGMUJCN1FujqQGIEC|5$7GRNz_4R4Vr%nZ*^3?(-)FF2#cSaD0-`#eu^HIVq z8W>Oq!j0jR1rhzD+kEo5?~`g6puzilupUOyKUO8Zbj(GSOam=i-<$DP3nKbwt`9}` z!Pg%$z=-R0tjVvgu&pg{F@gWXRM(I1K~o7zT9uXQ23#y=kcDUwpX z!@!IG=(NAbqF%WWCj5qyR4U(j<7L8v_@>}p3L1E$JtDP{K7xpQHW={%+zz}x|hLhoN`C^s- zxwq*(-)0A*>^l8u{6x0XkZAfS6(ebRV zRt_bBv7t|9r|tTijrqxWiiXXW0GXBtbKoBa&(A_a)978w95UQd-e)UWF RKl@0=P32C}t_0;U{|91B|BL_t literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/bar.cpp.499C72A404C3B6E0.idx b/.cache/clangd/index/bar.cpp.499C72A404C3B6E0.idx new file mode 100644 index 0000000000000000000000000000000000000000..f9ba27979fa4b04752df346b68851a4f43c103f7 GIT binary patch literal 11056 zcmZ`8!N=9zPz^PFcrpT-Oc479Y7lk=N1WcA{?p|hx* zoSX{$TM@ckIv*Zvl;z}Br|g_CYe}`cpl#&jGojBt$D1F2S+T&T6$M$AZ8>H<>SE{b z`)|?H|HSH^+}rg{Lafk(S3`XUwA_0dzki-2a#_Y#<%g?}k14-nXD3({{gSuqbIVE7 z4>#YnC@o$0aCJ@8!+-M+{4n|*uG$u?v;(>vQM7v7`5MIiTX~1UCz4SRbS;gRX>~6I(g=6OHO}C8XbLI zvijgKpXzmPTbqLh>b(3O{`Pr4e*H`rqgO34Zv3k^(9Y7G9;6fHK{*tqfQy0fQ- zC(Ot{Gk;c6SNpD=7NlsK|7PE&5kaMCw+Z z_E`7uu)Jpf!ii^!L+X^qerj@gP@4NvA#;My4|lV=>is8A&Kz`k!p^EyaoNw*4*%=& zq#^3$aLtp8JnXlhNRJA+yJ-2UmBAnSkNj$ta=g_2ZRV%tW#cqw8eMLbkFc3GwClOn zt@o1Y7xL4D5v39$*KLTEDs#T^S6$Su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_KmS7h`yeMb|JTPwzdp|W^>N;>j|+Z%oV|F?qDk;LZv1#OSX)OD z=o#SPXYFI->tfhxn}>y!iN2nxx2~~Qe}97kc9sL3o%-2pjno)2bl8|6 gaUV6TtitDb3PeesDyplF(i91V!CTSru_H$R4-3hwlK=n! literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/bar.hpp.548C657FFF81C379.idx b/.cache/clangd/index/bar.hpp.548C657FFF81C379.idx new file mode 100644 index 0000000000000000000000000000000000000000..7a342570df838745336e39c6c675faebf767d826 GIT binary patch literal 3490 zcmYk9d0Z3M7RM(y2?Jp=cajhicA~6eAO<0#Yznf7AdmzXT+kJML(t}C;pPrPMfT78Q5Rct6uoBQV;S#af7 zr>6E8n>+RU)Xj#5j6Df+UVn1)>}Awey!(GCu~|L)E7nx~^6B0MTiFu_+WOU`NvpQK zK7F-?eiVr_A1u$EWi}YLCCrQM*Z2IrM9-3-vI0%w%91l(W|k=%KdB!cTo+j2vRXec z=i)2BzP5%Gp#93BT??aA~3JZ9>_mf&1E*Tst+#Q2ED!lAG6WZc_y(d#^oiKe+3LtMjHgYkx`4 zlv@vUgsu-eMpsuiTg>P5TZ?0I?q9o+vE|5$>G7i)?s&EDN{KbLOk^r_>e0Jq<=4A< z>@ubd+fbYI`*)4GQA4aH!-^-}E${ewaKW28OWxi=et5(nMeNg zqO8dMcF4n^r?umCud7d#UiA&1zW+z2;?%jTg@5T1hAlKuCDV$=40oU?#ccM8W_n2= zhXQ-SgN6?d!681BBmd~(!&IktlNo_rk+c_ugHRA7i0G?(|9CNG89vG(Hw(qBld0Fqym1U2qY+2wI(8lB zdbYO6DThc3yE(hL2tql%U!ep`48cz~?H?TW6^DYzJ#@$2bz+84my3yY(%n-z6hizk z9Of$e=6=EZE5A2$RaPOF~~G1 zLJ+Y=_Pw0Qb7jqUIi!bG*2>hiGEbaJr>eve!xpbOX1g)9jYXdDthzdMRR|*bxi{{X z&l&o87K{ABH#iua1rhy%d5!y;?sxz_z|c9OzOB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D*z1ZI$&CmCTEggm(J485g)*=%~p zpTGdC5l&!$4b&cBHxi0LA)Z~WCiycO>z2x4uV}3b&Oe{R67GfjW>fX(Ua)K^332W#NbM_>mbPddUj*ef1v1ZCjz z9DDPDToCfuqKfk;jP3%zcFC(s-JWC!l%zOb7QeW6{<9e#)^NX);(wHU&i^oW<>mbc wN7aoBv&I+BbyBG{E?QR|tE5UaC4THJz9L2dC+W3IG5A literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/battery.cpp.C1194A004F38A6C5.idx b/.cache/clangd/index/battery.cpp.C1194A004F38A6C5.idx new file mode 100644 index 0000000000000000000000000000000000000000..72b2fed76eb57fa05079941546c3c5f580a3af54 GIT binary patch literal 5698 zcmYLN2Ut|s65csnma=zQb{BSGcWJu|3(|{N=m;oa2jv2yKtK=$6;QAXq6VTM9jSul zMI@RRja_0OFB*-S7&~@jMU5?rHE)i2=J9>ZoO92dHZ$j+nVlFJ5iwlGN zPhogGo)G`@@^fcI=<#?#hCE(j^O8wPvo{Vm{c~LWpXq;edimUcJXz@^(yo)a78#D( zxzGJ*@@mf0!tyuYC40Yn-{>-n+k<#b7`JvaIjm>^y? zxGfjY^rZQZ_*v_9VB!m}+$!6so68>kRJb8^vsa0d*`+E@D1Lbg8NqAU)n+z$Y@WKZ{^8^mlhXtDK9MgvP#!quUq?Fc#y(rKCt^{=TQj4L#ACd{{?M=9PTsXRbWJLko@icsuw-29QNHKr z_Hy2IUe1FhPQMC%x9`*Y(qwN(?VzNezOo&4#i97jL9t~~L)p_APeyMYY>>74(TuZ_ zirT&3TaDk7?CKSB=#(NN%R78x(wB=g+Xf})EC?Ch`fGx1-n{WMw+PcMRGnLP`Aiae zEQki>v7<+Q=Eb+9oIEgVQvJBofs%8Z4?a&_X?dz**^jbWdmY!UnGq5?(Kg| zOzXZ2V))SS@FM8*(_j6Rw;(&!5O};?u2Di7_OqrWC7H*$*tpoosXf%bJVW~I@UQYx z%YtauW4DY<#&Jf$*u^P`!swszZ;GYwx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;04 zb13@(_#eRRQxT6bK}KYl+R!xhc6KxhSJEA4Lp^#*W!7(%AK?BmjL-Bm=eiYOm$ zjQ(QI+B>fh(5xA2oNv#!$0DN`42!|y(ZO9=6Pv7Jp7S>JLZY!+??N^nnD9v35ZKTHqh7``K@j|@UiwK0-VJ1 zSv;gzBgWj*+T0q`SX)C|1oR+X(2zHoW6X#8A9#tgbt0YFr=Ljh<^BEp2#eX1@EutF z^>$~;$+oc@DU@rKLlDZfQAo=`TLwdTx#_b~@Mj`kUhZdk8rq1XcYJa*dXm@yN0{{@e} B+xY+h literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/battery.hpp.A5CF2192CCD687A2.idx b/.cache/clangd/index/battery.hpp.A5CF2192CCD687A2.idx new file mode 100644 index 0000000000000000000000000000000000000000..b182c02d446b2968a4420d5a0d44d8587f8498a4 GIT binary patch literal 1704 zcmYL~4@?tR7{KpdOM5NXYXu8O0b6KGue7CQGP9{6E))hLZv0t-%9tQbWk3SO@y84u zRB$t(U_c=X!pIV2aYG$rAO^w6m;ss0gntg1LnJPd5jJ6)WA6^%@sfV|zWnZc_r1H{ zrEyUa5tl?57M2!Okd>a7BE&FE27ivc+`|lxVRHb(3NBPsw`ccj6lH~VR|1BfT7C&U zl3_}>A9Tbeo~7|qIa5rANEaPie9SQ1b^6E-XG)4DW%$JYPbB1>o+Rh%RnBPV z^mo65kV8!^``rj<$oKDgowCd&9W9@d2Z$aWOe`X%c9q7st;{Qnu2(e7sU`~R%n`*s z*E=j#?c4X>esfhZe_Zo?Z~Tq+{?Yck@?)VP15bKyRff{{uZWVXI_-U1x5hQJNQYYL z?x+@B#fvk3tv)%krGkv5FwN6^5=zcRtt2H* zmp-(2Zrf* z?4M`ljr7>P>=#y9vJiI^W~Da6XSMCXK!w9PzeoYWCX8Ub7%dktf_<=XZ66+a<|kkV z#Q^uk2wFtTxPVF4I8NZ9WpAsS798(Wz!UCZp)Fc2@H^NeA2vCEE2&lj5#(yMn&AS^ zBmJc360T)*P(TT}fi~#4!1J9&&p-XRO$fOcN`gWfgIPcP4@=R`!bd&pi#e{&2Is35n|wjeI>e7U|q>RZFRI0ZZ) zH_;}B3p{`M@?P>cgEucLfIGUs)}~#bZ}p#R&f&)0Ur;~@`^~i3#09=TH~mA09-8X9 zFyz&o>KTrc1S4jozSXJr{I25HU}+Yc$>5q_BL$65vjileR;f3^YvhbONf<>&DN-Dl za%v-^1yasrl3?E^Nq7sqrATFXCF?OV7nZEHNK{y|mLe}<$x0b73Gc~DS5&&d4V5Zy zlF-VuZ~z^n3nB@I5*dj|CF`0i#>XgAbt%Oxc5;npHV=xh{L?R0%oWSrP9%>pM z#Fdf3g8-utnT$&a)?g$q9Dud9eEIf#LhK7CfVX~28wqdiu2Ug-VGDcAvkgZ#f8N`B z0zNcVpvu~oxP=;Rz8`=K3AITb-uA4taL>$zN=S7wof{Gx_Oe1Fk73FBi?qdYg4GpS z3Ws48{jn`~UyitY0B%Kl(!R)1*vq+Y*st7?d%%&;CPcqSOmfUlW>n%TS4c@2C6-_k7OX82B^V}OPZjH_>v~G9 Rr_%M5{r7pb#3;eA{{b`Xq>}&u literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/clara.hpp.37039B002C851AB7.idx b/.cache/clangd/index/clara.hpp.37039B002C851AB7.idx new file mode 100644 index 0000000000000000000000000000000000000000..01026915693de5844b933966ad2224897c16e282 GIT binary patch literal 30604 zcmb_lhg(%g)938zz=exkdQrM!$KFefy&Jo+Mtu`wi6xd8BdCCaii(O@fS?H2u*8BL zK@kNNi3My}upk!HC@T8R?A~+m5BPkZ+!=P~?Afzrc6N4toBrK8cV0Z(!s5H1y3Lt9 ze&!g#!otD;|IL^={pY%}g+;ofg~gmr{|p&E)vcLh$(t{hj^|ycmk#;uzh2XXQL$qU zhr5mWd1KgEufC0ulSgF4;bwTu?y5n0e zaG7F!aj1c9{`x`ZmNe_y!Tm1>tCzPYWE^=t`c>u6E1Uk|y7Hg6Gn?b$4)q*!y~l<* z<9-|7{?{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^aL$5K?4_AXveR5g65yp0s$?w5KcWoW3*^H3k}+)CuoOZTF`}sX2WSQ z4i*}teUpXeJJ#x>OXvxjg`)Y~Ei^{k8dzvfN$qVG+GpztS`D?bEVOUY6SP7#Q@}!J zW=tP9gWk8l%Y6SE-dD5x8-C9>eA+jB>Not(Z}^mN_+-vv;N@|F@4^--JHfxSi`xTs P^$u<~I0-FwRLT7xaofoO literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/client.cpp.142786E5739C6086.idx b/.cache/clangd/index/client.cpp.142786E5739C6086.idx new file mode 100644 index 0000000000000000000000000000000000000000..37c6e6aab07f00cb8525460edeb8bcda4f102967 GIT binary patch literal 3324 zcmYLL2~?BU63z_?N&fs~fe;8`2>}!VWfe_8kgyY30;c&@77ZYZf+Qgd2twHeseo9l z;98&JLq*&bA5baOts?IFidC#u#ieezyjtW#i?#!K;Z%*PP!@@>z5-B(> zGA}DVcL9Y&BALKXm#bYYHzJWD=_FF#<_e`^*)LMwyV#~b4@EcLm#vs*Qca7J2`4)` zf9>_oR8nitKV56Rx-sDP-BmVW#?<4g((P}G9(^d3d|FB>?@-U%GZgml$PXvGjV~2h z`L7(#@sb+_ZXR8V-Y?kjO;^s1({)$v7JCqRnr8p}pi4jYhzdt~72hszX!Rrhsu*4U zs?Wx_+af0RfX8&kgu|j&F~2$Hjy`tW+HprGtnJe9-0!%2Gn(O^U6!_LX#m@5I#w1c zomIAII=%DL+MtGNVMyJuhgIxfr*xZa!*hMMw%i$LwOCy?R5c;C?8C;6h)TtD?dXZ( zinydneNH{ris=3L40)$d)RkfP_ut?3JgE5YgW}c?CpF!EW2drd`~Nt+vU&ZBZQW@Y zGrsW8&Ys4WCvR@H1lS0ai+!w|?)VhF+#Nag$2_AmTLo(WMaILM>aG@!`E$(5Z%U^2 zBww@-A$s?u9e8^CR@0Qeg0=fbtd{S4xiGcrKRWUKB^$PtQM{enhE}bsxz6}bpX}0+ zE>T{WY|7B5@15%s^>+WxU*)CgZW)hWx}@|r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JOi_ zv`$^PWLSYT)DLihbkQGvT z?!dOg!P+hkjR8Mo4LJo7{nZtZMq@zp`1pT+G_u>6En%@ntuf=~LO*xy_sRqqN;Mpd zwNfo;z!Au1anKp`vN$Xa!#_FF9FDR|A`=)z(F8++q{PER=W?6wU5#V0yTCn@#o2-E z@htXC_spe;f|&$Olt_|9fkau$Qf?i5Xz4~+Qdk{Mr#ynmghOF%Psv()nHF5FT5BkX zbWH1*q|?AKN1bD)aDr5XOq4|sOBh7a11{mtTv@@1>Iy}Jl*JaEB@Hyo;s-6V%x1B* z$O>wc+f<;FYy~WK1RN0-XL>V3^JXa>*LUW|!`4jLB!>w>+c*}xuuD$q1r-UkD6F6& zA=M)@TDCot_x?gytxl#>QB;9TI2B!X{>{4iB@sxQDoa(vxp~}>*7GCJBnmA^OJKDI z@Azs;^+gWyn9@uZiY#ymswko25(P4`SS3>>vjT%CnxG=#5+xA~35FF1VyDchfz1Y8c`S~oBI%8<{32L)^5kY%HXq{Q5xdl`R2GM% zAvq-#=Tl}uX~HUsC>RnnQ6eE3CM069UZyu5 z8rZbH^m0oB9D)T~*u%c>(~c~kGl<~21_Q8+U?`YNK?QjTpeUDMNO(js1ZfF=SZtIT zZInE)W`Z3G8VDhP>ACXlt;WVbUWK9&97&>>fysn1lqxWp(1bz+h6Emz88DdugCYW4 zf`%);_+gx^ttZb^WinAffJ?wIC~Z5J-uJsMa1Anpnc@Llf(1$g$V^Z`Uw#;pH-B|S zRT)80bai?3VbVz=a=($UyB}Ht?Jx{G+LeuVrK4T=Mx+g|xhpyOY2v{NSSm|QV&w_U F{{iVbf5-p; literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/clock.cpp.622BF041106573C2.idx b/.cache/clangd/index/clock.cpp.622BF041106573C2.idx new file mode 100644 index 0000000000000000000000000000000000000000..f3d91abde97b6acdf0c9b6eff3dc3fde49e659cb GIT binary patch literal 4824 zcmYKh2Ut@{GaDX>Brk;kc?1$jXwo~VxrqAro%{Pado$HB9$Je0`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E7EE81.idx b/.cache/clangd/index/common.cpp.8896DC31B9E7EE81.idx new file mode 100644 index 0000000000000000000000000000000000000000..979dd505d75ef2854733a6c0de076c76256455c7 GIT binary patch literal 2080 zcmX|B30M=?77mk@WU@>M84`j?AR&Y;1R^_vpeTw`5y%)<1gc^|Na%ZjY?Y#-$WuXm zD1u8x*=$9j8U!sGDGDwih_Z-a#Xc))0a>2ZUVKmI`{vH~fB!xI`R}>sOlVMGpcw^+ z3y2O%j*Cf(B;as3I(T(S+AUl>4mUu?;gXBf!y~snabmTF6iuHwX4{+-U%BTdd5OQd zgT&@L=l2FJ8_%__EB?W5X1x9@=g~}$H+>P{Jumphkm=ft1`FP9myGM(ncO7m`&20B^mC5 z$@q`_{mFxq&+xpRL%GBC%NuSX7W>ZLobmbg^o9Z9gULjeg$w%52@cFh#}!WJsrzz* z%db}jE3!%qj>b{WGef--UaV|=H!b@wLv8w|kA8g&O`rA8_DkP1rY%#ob&Mama=;_bG*3qyqUiJpXFl(dclz-yG z+8^73(FfY>ePg6=^WOf0cJtm!OT@h7_zwAR8vZZo1s6xk_lK8VN_)ZUFvyQd!y_v+ zvA1p?-`JX(jf6XVt z{gnA z?|$E-y3cKR%Ei<>z;0vcl{OdW?S9p(dCRd++Vd0eEZjY3SxfKoLp5(T z@w~%wg~~A6u%S3?O>|ddVv`Pzt2$XxB}J=tT_`{GZs}HJJH5|WKDD4@&!L}66p=q} z%iKg#=ITUpU*N*rxEGS8$W=5TN^myv7@7FP(jHPz@!qd6ybt!Qhv%r+78hv@} z1%v0gP{djs25}*t8i5cZjxsw&;EA3Xzw`XHV;2ir1$b15%GF$3uIdZ_pta`Dt_-i^ zENC_0speF%+JtOE|H5}AP^@+;YGPTC2Jk|6VSpO7MdyCuwJ~4o+QF341Wr52XSYg> z2$<4L$zvzSs&B8jI}Z@Mn$&}}uKc(B5l?pdxy{vo>oL_~-zG_5h-_u&mY z07+buaHa9WhPW73J}?YPAv>VM7m8p^N|w^Yma}Cq4|o&7P6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`d2uaqQ@H%SnqN%vhfZGQV-f_qP)1Bf7EHk9zwP~ZYWMQ66mcd|pu7;1 z5Hpy7%NM1l6AE*JRiF4iuCTR|@eHQhzbgh7~9%!7jlI zG>u(~H|2u1&c&D=yo@}|G8{6Zuy_C(4hnx*urqRjgM0G4YU8d02U>xO1=R$#VSx@* z3<~VkubV3)AI|Ax23p51&I7bXSV975i?EagEcltZz`+jG4vc&rW+7%Fwo|K%q6^t~ z9|xMrFU&6qiw2;Xpx}pvI*km|O@Z2ZG6bV;z%(#JY{9T--dYZ0sDITudwstO$8vu7&{s DsOkkm literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/custom.cpp.EA9CE9AF81C1E5D4.idx b/.cache/clangd/index/custom.cpp.EA9CE9AF81C1E5D4.idx new file mode 100644 index 0000000000000000000000000000000000000000..17765069753c33553cfbe832fa938bd6e49f04f0 GIT binary patch literal 4732 zcmYLM3s_S}7S0KmBqTRa@*s%>2pEI_;U%Dg5JjzEp`Zv{1eKQpq6>(n2tGitV2iYf zU0P5UR1^iV6+tMEA|kX{s9UXKUEf-)%Idl!N{r3kN9r=Eg$Lmh7Vr2cQ!8J*3_hy z=hWJryuvpNswH1aW}R5<^nv9puca?qu6Ku6&*!e6ZhiXxD3sX&&X|sch&GGB@?FK?03H5>vFqF?R0fAs?*YF92i!Zqd*;5W!Zk$x+w9%--DRyEmwAQXosXSZG+}W4 zsqmFee(#KzPwwts7O+>gvitF>=_e*%tf|?*q_xqmIwaxUk9>1?#rTKQ4XVCH)F z!1L_S~>3s*9wozvst(HI}dMdtNRfzCJc8zD+(XDd&c7 zvs1_iom!3vmh?sTD*d7YyxZ*#?(5i7)cekL9W!!832748|I><`#*1V5u~$1{Dg$ku zn}1t19@8SJYWi(NdbYCWNYK+*gFg5hmr21@U)#!U&l|;Q4W;iS&a61J<4P_!?LuOd za?QuCXCqo~#qTOAYMC3^@IU@Pa@Jlwq>M4da%P;|7W(w|-#+m8-o2kQKan$+qnuC@R?z~cfb&M4n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(-z_uFX)qvlVAU_Gy zYJX{85>0ykfL0ZQc`*&SQZO%t>4%RvKFY0=l%pY?Fa!BdlinVAeN`qv(A4 z5p`r#^kw5vawYPQ^)@Svq(m$cCR;I2jLee|5=4~~(+RVhvyC$<_nz&Ih!5ZdAj;<1 z&(k+8_xix^)5#Y!Di*{A)2NtT2bktMz^4OnX%G1Hz}yqRUa`*p*NJpA(^=t+$eU+5 z&*tP-!)-S(TN_Vd@1B%-^5yW5SBmzYmJGqH!OC`eU#msl&iJ zOs9xrz&b{M+kn{y7~}z94bbBu;0%G_$D8Zj&3~GE7X79m6<9*uNH_kq%hxC48_!(A zvkHM*2o^WAOY8&t)$`Di^&qOJ3rQykI%%@?0>2l;Q$H9mh0u_{`^$f3XJkJ%paO5H zx79r|&(18hq8f)-{VTwEJZD4U{?Fc~pUU_=CH3e*xc;we*?X?T>?dFp76J^j8N0R8~T>Dvg0z+&P*6L-xe%2y~T0$CCL z@G1dW3D`gBZn(7K=TFk{K#qtbdzy7-uzTy`&vCd&v`G3qN>^B&5qQxA)eAH6>>9AE zp*OdJT`SnXdg?bI&2#NVt$+MXA^-fD!pKZox0?P%nU$H4WlMLW>E@5Wn5hl}sFsoC zt;?lN|k!yoCU7)9Ru`6Piv=n&OUC_y>vF-v+W&hHI{aB zr)m9W1zP#K%<%VcpJ}iNl`jqo4u4B#YR=^G1tgne!etR=QsFxaiAWrhuw?1mVT}I+ Dixt6V literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/custom.hpp.36F2F4DF290D9AA1.idx b/.cache/clangd/index/custom.hpp.36F2F4DF290D9AA1.idx new file mode 100644 index 0000000000000000000000000000000000000000..577765f0cbcc915e74477c2a1cb397e5c0942530 GIT binary patch literal 1720 zcmYk74^R|U9LM+G9lQhf_7?6B+&}KPs_Pdy{hcWdhCGAggO-ZpkFZrszboeBjcWo^3=QP!HuAz!* z?N~6iJ8pSs&jJW{*T=Mc2k(knFfs;4MFTZ*Ljy_DbHr@3>Zd z_KB2}e{UT&)!UlyE^dyPNdNK0@xsTg(@k&IOw}Eoh(CMmfvfG{Ya8!n)lK-76kT>v z&J9IxjKawTSvpS0zF0QSBBc=y4H^!_foe+19V0Z2W%^9^w)=eyQX463)mhDa2wcm| zT6TRX-@qa{86Sj$0t6nGELm>&<~cWuG=%$Of5yYtrc_{iWetn`3D;t+Lg10HrM?B# zqliHa+~2G-2lL_K&Ckpk7}8#6kPf&_Z8Pv8@aXr7zDxJ5En!dqaJ^1%;zQsu<^S~L z6<5w-kRG^EXSDDk@Mqs?IONW68e&i&@DN={7#{*pq;RO?^VoC-A>hHfU?U#_FQn!c zT&=yE%^(HvP+h2*4-dan{iOb2cpr-lWdAH?WdeWe{I1Hc?4LHWNJ6*@s{#dH(bnA? z(>gnlMJ(YOtnr-RuED{$;U?_IA}_*~Sm}8_O^2SJ{7~dvgpnwi!n8L{^FjGMdj29T zYUyK7eA$~<%b+0GfkkIA@*%9?ob7G%pSR5S8Kebn&>2j82>g6|H|j6w#Vk^h6{xXV zCGdfSG~ETw`?-P0M7SKu#R4Cc?_5>i!){`b80I(WOd)&-{EGX=*w{5kof?VAc#uUZ zaECq5Y5bq*A|KvxBDTnv7n*nsl=Ih`aNwiN4OixgXl#{Q1Bk^yIeWuqq=k}`l{gAh zae_w9Cp`Yw}~Z*`re7Mp~uTOmqXvxkl`Ql2dD`&%E{`J6nTk z%qSTx%>g-<_EzB^`>QJze-tk@g=h!;|s= literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/disk.cpp.1F7580C201D672A2.idx b/.cache/clangd/index/disk.cpp.1F7580C201D672A2.idx new file mode 100644 index 0000000000000000000000000000000000000000..b5c499e9b9b886a69e4abecc68594fe3720035ca GIT binary patch literal 1998 zcmZvcc~n!^7KcN)2}!sYNEiczKp+BPNJ1DRWPlKXKp-;Y8m!6?Xi*e_=Yldgfhdnh zwaOC|Efr+82yH!xK{huJ8Ru1b6#(I8=o@R)1ls! zFY5c3FQm<1TK6YinMNHPADv(Sv&Fk2w2K*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E%T69|WP4C0(CP=77)3PeoOeQ52T2BDQ8MsTSsG;9-E;kV(V`enqR)}1RUxt+ytiOwVod5^;{iuvvHP_x zqM7eC)M4PPWGEdPbmH3E>4ye@CQ*{C8?UumDVF%45Nm`PQCs%d>Q>p7E*=swCZ@J+ zb9-%Lq2iJeTo=_fKyX9U5YQMk1~f%Y0nJb|Kr7S=kbyD)?NNI`C)5eh4Rr(LqFg{P z)Cq zVmkaYMNBb*vjSLw&rlgJ^P`(d}&s#jSER02c*D_bIb^YUEpgfF6{cUbs^r1fTDx=W{ zCSa9fQtJHMV^Zf|x-Y@SqHUrL_aTW(TAU*nC6}N|&PZImm({AZYASp+aAJSlVT;Wt zN;P5$v5S`fJ!>#IWp;1OZ_bw ze%`^>zOD`;u7{_anT!%D4U1lGx`a&B(>Fl1Nt(J^h>nTj3aYUY78xHN6A?xD6E(3h A=>Px# literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/factory.hpp.2AEC37A00908E370.idx b/.cache/clangd/index/factory.hpp.2AEC37A00908E370.idx new file mode 100644 index 0000000000000000000000000000000000000000..330bbbae66fa651d2529daf66b2f3090d4257bb9 GIT binary patch literal 904 zcmWIYbaQK9W?*nm@vO*AElFfyU|`?{;^LB`%-DbFCz$;nu^Ai+m~xwca@g7{S1q_FIR5|Gt9x@#3oExM@5{B^uN1paH*Tu?H{At1?AzI+wy$E(cHKLl`%RhYl-W|5 zL6%vX{)_zjY7Wf2zEa5#D0I4kc-?S){5O zyJ51+HnD)|!B#S64pGu;DmdlZvlEs-*%|NbuC3baTw17otcNvA`_+=_if_T+{!d?1Fq7hnF;{Kw3$$IlqQN!+{4P+Xatvbd(lOcx9c2l7hsZ> z1#*Fa)tcK{lz{^jP(Wa>yX=avet0B16Qc|Rs|A|{FPLE9gvc|pGG@xp@4q-pY!)9A zvn&Ivy{Nqmn1Gv5Y5eQ=Q>CdF_?Vc0@^+$jl3)TZzrg97kLbQxpTw9LVJ@&@vf_lx z7p0~Z&jh&y>QY8dunS=hW8wlkh=&!VDVWoBZ*HnUA0rQ|wW75;%xR2VU?-Kb_rGz< zz0Su3R4ia6%)@HOVaE+~9#9R)ZIkC!8+RQz&UD1r$}?@%BNV=yqVBbWjR brVxV3g<$d^n1TqV6oSc#V6q{Y{0Jrh89dNC literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/format.hpp.A472BFB350A64B30.idx b/.cache/clangd/index/format.hpp.A472BFB350A64B30.idx new file mode 100644 index 0000000000000000000000000000000000000000..c466d85fd1d2e778f6ae4d6593714c58bc24e7dd GIT binary patch literal 964 zcmYL{Z%9*77{>4Jx!rlsj(2}_bC_B=7s_gD2DZ_3St%~(GOeVjNY@liEw&X_WFNAE zL_d@bOwGVF38BC;DowF36;c!!)dwreD59i7L;7RyPTqClJoj>*m*?E~{hcCLZtfsr zn00$xbv3?VDaSBOG^{|-U)c=r30QUQ1x?wwVFk$v#3~n`9U{BDA>*?=G#e;u6aGkm_2dEfD8WDZB4$UCpEeWSKGas~=B9`Fah@nUQLaZCN( zjW}?qrfjW@VRk;>@$x(GO%d5>1%t2(YpF0%;opa+%2nChG1GNSWC_n8jY6ZO67f&= z{4DEwUDPMCO7LTFjFL*kZ>oGd9Wy*`SFr;4x;R||m56`l;=NymPJf!nig3Ol3K}XA zKXmlNcDAJ9osPxe^BgZy`R{j(>5e=RHj69^zCuu_s6_m+z|8U%^Wg(3Ru1QzqD?VW zBL1r{osAH)_68ygMKpRX_ zQ&&~;aMPnKmLR9y=_DxIp6#@b)C}k+DrPx?^0oPTg4|j+Xo0o>)T8z2i-nw_8lS2e z3U~vbMi3UTk|2lDp@rg9w^;%N1#-1qhbbO{?1}bd$T1Y8N`w%mWC)5U@hXBcHJQ4- zb=5EYv*lN1P;aoONvv2*84+Y8MzsV;hA9|{2ZG~xImVO*K^CJWttIY4MZG2HVL9Zs zy3;|k+|F}xr*zr%vGuU&&^Z!d)8JkzL4(XNvCupt9x{{UMobA2WY(J(5oAlWr9h|a z-T5#OtH(BMF78a9Y+NJbXulFahzi4#aB-Mof}ue^L29iUqD=9o6p0q}7)AvaDC754 emxgb1!0!#jg+I`ZMsL!m?u>L9$IRdK@b+JBxZpPc literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/host.cpp.0C1CF26FC798A71A.idx b/.cache/clangd/index/host.cpp.0C1CF26FC798A71A.idx new file mode 100644 index 0000000000000000000000000000000000000000..f29f9b635674a94d8aff6d76ac7ae5b91a940abe GIT binary patch literal 4080 zcmZ`5cUV*RHusW*jGIA#43e-Rgb_9b1OkXCC_zThTtGlT5J5CSMI%TRP$IPjwM#%n zaXl4V>Z%L}6!lfDR;`N)Esun2^ySy9CW z*+m&d0)fDQzqUxTu)v5wsG|@F#dRgB)WQdHvrDmpSJ?|x0$$*h8`dw_Gjew^sL?xS z^*dTztsnnWx7o&sbexm+rcT#_)x9yW-{AAFe(byAytS-S~jx z=67B%+S1?cGOByw)o}964=uyIH4g3Lk0PVq_l}hs|FwL{FzGjs!ESnY=@>)z@bH9xpb#b5cw;_HGJPmAAPEbR3d*)kBd7JVh>0wgX{u9?7Sz)h7BIYDJmVf5=`%#Cy`kT$o{c@-Lzy@#iu4C2P zW`19|di42g@%Gkz?ypc;*CE91@t!r`r#*Nzzb4w&zha>c-q>@5?&BAHn2E3=H9T_yS7IrxNt6{t-FN1Um^d`?o7wATlJ>ghJ@6t zX)U=QYfGXNn}3{5F-omj@K;hwi0K)rbBo*DAHE#;)+N>SvwgBH6<+j1|7yGbh-4l= zYb9+8c%G-Ps$IS+>x}+?=fd8=Na%EOcH=kI zk0)r49P;JmZ}?uCaeNk!c5FxQx)Uo@D?AHjM^iF;cZRJjTr|2b+F5_8kG|S())&v5 ztpi#d7{7I>_w+{;x-px?^ny!GiPJ;dc1MN&WYiAHKV8 zPvfK6aj3aN>a?~8z1||rfj$prYu^#774y)?J3b$c-fq2omY`i(Fn>NmAP`5&ziZ_# zw&bAmvk7$F3=QQ}*KQQ4Tr}=y~)!ftt_ci$2jqn$Dkz{(8nS zHaZ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fox&VS-goc*R|=&u zB#tAtfRu3p0Zyk(2mh3q(hQ1NkY)o#EJz2K;hPaWd{Iv8^TlgHLW!V6{BjmzcO$gt z795wEF5|!KJ;-s`sDfg`wK8qMyRfFG)*F@iaHRTDL&mCJZh9`e6AR(iGPEp!u3Fh& z{SDEsJ!gLcJE5OId#OvQ=lGM*&7{j0U&6%%G{N!Xk+IRyt}o+YIavEz!+eqWN#F~? z-_Jjkpvlh9FnpnFHJMs>!%MOOO#Bc$?=heAtgg+EHvj+t literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/host.hpp.D6E6FF9FFAF571DF.idx b/.cache/clangd/index/host.hpp.D6E6FF9FFAF571DF.idx new file mode 100644 index 0000000000000000000000000000000000000000..3d38ae58573fb8663b45953337bb66f04bcd3460 GIT binary patch literal 1978 zcmYL~3s4hR6oxl9Kv=T7#0_~Y2}yV)5iJ55d;kV0N(BXxM{PtI5kWeF%3}noL#>5& zph{t+I<1(hMaPa-9jh`7Dle(jQmGHLRUczqo0? z@0>Vg(~eV>#kW$^??nw)Y`mmd5ofF__b_H|nHd+J-Du4+ow?h(%|F`d{FT+V<=2wV zD;rAM+he7FmnTXOHzcp#F+!!*70+k3kLTanR`W{K$=uacyi_q1Kopkdt!alY zI*pcpb56NI$0D^CG#Cb{WRz;cm2Wu=*VL;M#|~~*GRVb?Abl;qk&Ym6S#8n8wz2jz zERx}THKW!FJf!hX_3?r?5fUWQ5~S2c>gEUp`SyGfDY72wYKz;m=&TGOe1g`johzIW zRS`Gveb@LB25F!IAB#_fBM3YuxSzW)yXppurr>;z;dBCDkuh$|8`{24hTJjNm^D^` zr)lZ+^zkRHG9<@b&d5Clp6+*hY3;2)K4uUL_v>NiJ^otYcUv53R@Dn>P# zzlIu_f3c&MV~`W%>n-~Ejv(Y`rX@W(Vtjf@hCFb-f>BK7SM~cR4G)iMRY-@qJ8~Bb z`TK^slYLF=hLuQ!IgMx+f!kZU{F@iG6w8npbCzK_fgf5QbosBMIXf8S4E1?iydxb! z;6IeVjOShrH8My6++Z<8I)cEPs`lFxJpajOkOa8VVhnQxfp_|BUH39aQ^z1BaFfLp z<_H4s{?RkIqxbSCgH*uH7PHk61U`~>r0>t&5eW?P1ny_?3wH#87i47@dW$EOEFv8W zmh62mm>Ftk#T3b!*mo#WZk7j7q{6HSz?v4hIkfCLHfU=~%qe!FNIINeK#>f~cv7T^ zHYq65Oq&&0<8U&s?Wv({wq`@7!5Q|ipwnT05M!Z8olfTiS<_8{kTu;Lh?OsXt9aN9 zZ-pY=#qN^Ob(i8oZVv226sZnWLoOH0&Bi`}TX_9r*+Y@M=CR6w^6HK`SMfM^B>P)< zI+~@`6zMJTrYX`#;zK8s3(x0e$*SQl4XXj9(QAwl<1~pBskLh10rj+APLT%MAWunP z&G&1=okdW;L`P$*ktH-ygY>>Jm2FdQ#ZQ| z4p+`phEk-;q6&u^=BOi}hIw2RwuneX^48cHF{4FnTh$EhRdPxL?ANG#cGq37x^;S6+n4QU=zTScL3HrEP28A{?uH(JIKR{FW6TJ`cWBG!Gl50&n51vFL;?P zrEMTHBLhe$*Li`=45n!yGlO{=wg()=d*k1eubw~etXam(elGhiyoh=7Xm|zl6wyRM zR&ECWn_gIuS(waE-1zWzxZ(*xP?J;AOZxD;pv>zHF0K^KNZkl#lJWn?{|_mi5X66^ CzWHhZ literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/idle_inhibitor.cpp.3D718BD05B870FA9.idx b/.cache/clangd/index/idle_inhibitor.cpp.3D718BD05B870FA9.idx new file mode 100644 index 0000000000000000000000000000000000000000..37ee31cc035a559a9c6e96c383fc26aa27433d0d GIT binary patch literal 2398 zcmYLJ2UJtp77fWuNO>tFBqSj~NGK8#385w+B?J&qP-=LVNJpe7;GleD93AX}f`~AJ z%KV`z$QNb!qbPoLunpqEf-(pUf~XV=qeydZSPTDK>+N;--RItO?mg$+U_T$9Z~_YD z73;SxB`z}xLZMJ(@MmPEZ}i8YP&IfIYTL=fVSQBWRHCEo8(UqP0$9{+Rv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&>~Q%6{Y4Rg3?EEQF5_0hyhJuASOGAfB?3{aO?2n*H!+rursr;GO)tL85n>$4h8@| CN$E-e literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/ipc.hpp.804BDBBDF260032D.idx b/.cache/clangd/index/ipc.hpp.804BDBBDF260032D.idx new file mode 100644 index 0000000000000000000000000000000000000000..b15922d2a14892ab203b9d98ea7b3b522bc87507 GIT binary patch literal 1498 zcmYk6e@xV69LGQRcz4_#cRY8;_uzozqy;H0H)1qutmtMUV2*_F7s)TZzzkh?SiqJ* z<-VIT6gi9YlmKABkGt5lH(3F&odA?HJJUB;4@XFgX)|3nPS?E~pLVDI z;L)r?-T4PEJpNOCTaIV`TKVOkr`9dlBStReP1jUaEq$`2k9pJY!+jZw<=VvO@4}Ax z!ER;R2G0)`uTG`&?OHolS!-W9xQTvMsVS6JB5k+46`J6zMD5y@D+!)!t>1XEh9j@; z`8CF5*rnK9+U%;zZHcCPlWgzb%e{YPq-=B~s<6A@-0BYo6XGJxyW1K=YxTZ~tAj^k z&gK2`+Rs_{w8ys;jMUtZIDMw~UqzHYBX%ZwrnBJ4d&_6H_c3lc_Rq&#G21fEzkcJt4vXDFzVuoA18hwO|; zzW>-!1$R3s1R`M|1``k28Bqm|O(D-dIz%A|2@TOu9x~#I1CIHADIu8x{yeLV*aCUT zo)Y)4V!oj{=WPnBkO(7THXbs)plEA3I!b!!6ewi zLq=qTec`>CnQ)#0MZ%x>Qy!f7|JJvv=}^k5u}u{GkDQJ-h zC81^>vZplm1)W%3lQ2gi0Es{nXyn0(FuqIciuY`G_{Mq)CL|;xQ64g)cV9D1F87sE zFe0HPS`!c1_vqgi??|@$KTQE&TWbgjG4haoj~j*C{=RrUGM2J8*-8mD@{pY|(y>46 zR@3h$6@((8R4FYyIDs!eS~xM+LDF3Rcqo{W&=Fk#57`;B7hBUGbdDdVAR*yL{3ISS z!sUF`y#xP4g!2j=cU=gMmDw$9#>!L{>SATy3Qw^zNrjYHnUTUktV}9;a0@FF zONfM(StP8%%9Ig`U}b&?AFwhR#Q0d*@?vSMY-TYlR<^0w5Gxx{42G4hH4xrj@Z!nm zrmzwXF^jRVvZcf_SlKLM2CQrYapzdsg@eoadLHftZr5%%dW$=}QLb$1S$ud1;6E}e BgHr$i literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/item.cpp.BDF1AC58410539C1.idx b/.cache/clangd/index/item.cpp.BDF1AC58410539C1.idx new file mode 100644 index 0000000000000000000000000000000000000000..cc3ededd68a1ae68fd692b777a7332dfadf756e5 GIT binary patch literal 7280 zcmZ{I30RHW7x&rA=~U;uoz6L(PIXFing`93N)xFoR|C4f*IK`|*WOe8e0^gzSS+tO zeyQ;>i)XW0ES3WPrz}pMPq6bup2bQnTp2Pu@rk40W8mRX=hwR{#$@)#m-ilG>z}@r z$ri?*{d7H9G)gjA!->xu`shHW8YP)#u1iboOWUK?CHK_(twNCFHu+cP$BzroXblGP z)h0iyP8s_5xb%eV`$c{KyuY`qV95W%@Fp9B?gLNL?D{?q$#!bV6pwD|8*WhV(R6?s9F#Kx08;Rf|)Z*Q2EwHp>%S0?VD2)?E4USJlOI3eYl5c-)XrMHX9Hi}(|WL3^TWN!jEWY8FAulxy4`&H(YdyohRWU?gSX8` z-1U6QQkQ(RJD555<*Qj8sn!spubS;S&zIA0);IJ|#FZe~t&Xp!Wi9TWA9Cqh!;>(x z`gLngZcni_FHOo#xj+9w!47`OvUs%@b_wd;wlYs@4TM>CffiQ^k`1ySui9GEck;KG zt)}O@<%6yp?DCG8EiIq2`32qN{L|VAuHD<;Scg3=OgxZ0yPkJKyZ^SwqO69^iP;&c z<@+bUTAm?rwdS+FWC(vt4f-%D?zM8y#(DR8bb9$q7oUvsRE>RK5gKg1|J}!rBH7H4 znxOn`sh2kID!KEE+p?8|YXVIgN+K@XBrWuKA9pw5!}ip8+o_Yw4%*sP@455KbT6uX z+(EU3Sx;nU)pT|~-v&B=BwV^5p`3QRc1%TosM4p~(Y~kp4fN9b{@8LZ(D!9v)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-3OI*|NZDgCMO<1bf`k;X}retGfaBJawVrKkbkHckVg6K@&kLFdcgJI3&it~13C zwZy)bc@lX@sE0%}B#Cb=JhJT^ZlajD6_Y7LZI*&Z4k-*ybtdUd9`yxZ6)iT@N6$qGyy={R(X8Z{xY^7Ld`fb3iVO22f+7F? zMgI7~B6N=BOsyf4oR{qIS&*+Z Xm&2A9D^5`n351hV0)l?}ne~4FBYGur literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/item.hpp.CF2C10DA19A462FB.idx b/.cache/clangd/index/item.hpp.CF2C10DA19A462FB.idx new file mode 100644 index 0000000000000000000000000000000000000000..561786e2714d5bd34cb93de1f1ea5eadb1321955 GIT binary patch literal 3008 zcmYL~2~<;88pmHQ;0uzxyu<{^LLOO20>?|wHoH~0K9 zEpx(zFMS9ieL?2ZMY$zTPl6!C@N$(Dzw?8DAX4Ftr5o#~PhN95kiOkLbeF#Wv?1rx zt5o*xuXetFFmhF6-$Q46g8Es{PyK@Pr|+MeVf1NJ_KOCFmnF~%j~gpr=z8#gYHZ`YqQpGIS_U8YZ4o+AdHKnKh+?BS>Z6CdvOg|OwPwhW7 z@LOB>-9wF{48N`gy0f>Y{L!;n`EO);n%QNBlTkSGfOq_LR-5 zde+D<+%1{^^yb@h*M)ZM3tw{nKy!&F`Rs9{>cQ=SO<$yaFu8rbGq)+esq|ccs^ICx z{H)cLe=AnD3}q(Vl}O4eX7}9JH}u79&mXr(Q$@9OR#cpO_txFZc^6jx}KM zPPb}5iT6#;>NOWxm!=xt*r+=7%{DJZso%Z;MSz!T>Na_wE$ofP2ff~{^0g~_j(`5k zSjTT0{}6pV|I_xxBh|}i&HT_he%HV$XO8QgjKTkDYkzL7j&{}T&Pcg1oYlKEPUsr z1z)vMDAG!Z({<^QT)279+(oXClSMT0!TmOk&E2nmA)2y$_H{XhNa$D7YJV>He)BZn zHl;_zLJExqo~lbVbHQ^{$^!p-=h8B zuA|T>=ugw7g>k|29KY+w-}U_UpA_-{9>fGibHVex&!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..6e8fac2aacf1fb7814ad2670445d32155d035b25 GIT binary patch literal 750 zcmWIYbaQ*g#K7R3;#rZKT9U}Zz`(!@#Kk2=nfX9^5fE3*iS0Yc=U^b<^1b^_t^L81 zX9K%LwXd2*_wM*nrqyKOmv--rgXG@TJ#JwclW)x1+UTewtkhSR_GPY%X~gWcrd^M$ zW>+2C(sA@d`ZC7_kS3Y)SV`5}uU}j@y69f|soDg|NW=7}V z?G_VsFLH`8F#=6sXJY386L1syCe-@mR+_#QXW{_Li!zBag9*6&SrN`}duJt05MW{j z%5#cvN`eWvd{JszaWf;(DQng?1imlOX5?WOuorNKIh=`yna`NdnhWe~dA>%=PL4AV zfocRL1=V1VXXXMs8sab>W>IEQUfYU@=mgQ{CmC6oxdgaGV4h&)0z2OQ-L0Uz;a9SO z=5X_J3wc~wEtUJ@ax_q}popM&FsJL@+*E-+pw*nJoZ39h{G9y!l^Nw>`;$7h0@d*8 z@EO5;&Bz4y?c{mY#$5*vw1TwoaSHP=b8&I;PZe($bF34o18U*d;n$y5rL7kt_$UEr zDVH>t+U(pdM<1|nI11$Q+30_s50K)@6hc0gx?0`B?)#x-1O z7v2E12#5>FJT+kb!p<+=4Kjg~PxxhofyArJB6=XM6ral1+?!F!o2SfXVqxat3I z7UCA-|JC`a@15Q)f1r~DLk!ECJfTkFbFaUCG!fXHl literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/language.cpp.7CFC0E2AB711785B.idx b/.cache/clangd/index/language.cpp.7CFC0E2AB711785B.idx new file mode 100644 index 0000000000000000000000000000000000000000..6d439f1fe050c8b1c0e51815fc17816cbaffeec3 GIT binary patch literal 2412 zcmX|B2{@Gd8Xsf6S-;sC%ot;a!I%w`7-MW@Y?DecUn$9w(jrUuNLQ#-Ze^*?J(1+N zm8g_+RVZaCI&KaU&81FGt|KWOJ(i^9{-@`u?|J5Z=6&D)_j{M$@Bf7bX*6*J6lzIa zQ2O@xw2c@P3PlFL)U=c>HpVEF6&{63FU<_^-7)B7(p9O=9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{d25&+0-Q1}O#r9nTnoUdkZ*@Uq*N&lgUAFjn`j5py`_>vVc{~}wF{fV+YihndW=Yn$3Vn_ueY$BTqxTA2GCwI;+ z_z$Eu81^rf$ch_T`Mg5aIOvl|C2~vJa?f--4R?a9*jj8`%F}rW3Ki=?R!k5x&k@$# zxMB6r9so-5f_#V?_!nXn~VxZA$U>6QdwN;PO+}ZKGI@<#Stl2cjf&fFt4qRfLO?SZ0Z^J8FDC!hxWsFnGj~1N@5B@(41oqxR7up*8PjuT)Ce3E)l%wNA#ohFQKOo zw*F9z18YP!5!=zVu8*@kO){e$c;RZq;zh+KNDqu6`F%PA`wa? zLr13N8M_*?4IJ6C6yUr_4DAOd1&1llCZxU((g09#z$~ zVy;nY!kzLfn{S>~+;U-SzU$PBZ;G^Y{|4}=`-DdYuz&Txlk{pn}o20IGAAI0C^DzY|l^fxDyn! zNPvl75F*0H&(6;amk-OIpZ@sgAyYmkKA?UvVKFH%0hdqt!+1PM%<+i;6Aw(kFuO1h zTt0K_?2XUQ_LqqyAU5-eoKmgQOK;&?R-pJK>eb^q7q;NE`RKF#lLlHcWCo5aRcSWg~cVo1YG{A zvtY%oL*+BsnHU8a*tpra`M?ANCnS6r*%*sb(~6CdLXwdS9D=fwl3dDn)fqAJu!*ya z^QhXc?vAc}>K|ytDby0L7`|jf) z7fNu;!NQ7}3mis36M!z^VdG=wR literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/linux.cpp.AA11E43948BF7636.idx b/.cache/clangd/index/linux.cpp.AA11E43948BF7636.idx new file mode 100644 index 0000000000000000000000000000000000000000..0d5bb13a714a3438af20f06f58ac7e2065252eda GIT binary patch literal 1320 zcmV+@1=spgNk&E>1poj;WJ!2!WprT#0000D0001UbaH760{{Tm2LJ$goPAZ>ZsIT$ z%%@a+>8>irh3>X05)YJwHriZJ0;TMW$v+aZdcZP#sKci=xc z{wP45XkrcKAF%W2jjf^U*#6`Q^WCFjJar@csE&Ng36AQiWxuqgXL~_7|LibyUhJ?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1Vl0~Z$(Po*|Q4Ia>oj_+@7yV~O*E*p45us$FRoxp|s6ig`_E>2LG zO(%xwdJVhwQsZ<_(f>d&qqQZaab6eWh!$JM2 zy_O|HQ4`WQ`&NC9d`_=rDp^Dk4TiitV>-#Pdf8VWe0N8{aE%4a>~vzBNU}-LQmcBN zTP=t-?SaCB_eJM;Cnr$y91Q0JP8AnNgl~~liM(xU_3~?mnGf~f&F}fyf?G44s^rhW zKm8_`AMt}E`(w6ig3idTSugLE2@Mc9AP7QXd)Pz7HR4)A#HH2&LmU|;VZ#sv#~I0S z$FV1rs3>BF2r!@h#*K#Ri(xEECXo>=itrFVpMJ#pN8%F&(BK((bql*ja?k!C7Lkg= z99RRae0Vt(C8`qnVAUe(Q&9%OU;~3Bgh54_SSFc@val?&#guPTx7J@Szz#>iv2nGz zUi41;g%W^R0+!*{b)6S8_dHk$i{i<6njdNXpD~fhDVU04Xc#6HB@sw8e{W^|u}oVW z1~|pR6yT0Pqycv%218QTS(9~q+aX|0g|4EU__jQcMe2ABpej|Bn~}LsZRe&PGyo|) zidII^xq;Y&72v zy4s=%z|u){mH+FjMEoGZ%PQH!aCt2;;Q>hJ(lxG6rtS|^Je}EIhpP2)wMp8pQJu}j$ zP9bz~7e~c0KaXDaFd1m52EkBh6i`^Y4&Cs}j9oM9;L7_zv-Ixb$lYN}zeFMqmvF$Y zgcgoVD?4`V)KL;aq9x|P5grq<8wE#yp-^dqDo@STX8lTMqjkoP7MdnbD+H^STk2_9 zt<^Ww`A$REUR~SH+J$dxYT#hLdW{*^hwbj+x!Fwx$Al>~I+Z}gknva&i{Z;rMwWR8 KZuIlo1pNacCRURG literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/main.cpp.9D6EE073CE3F67E9.idx b/.cache/clangd/index/main.cpp.9D6EE073CE3F67E9.idx new file mode 100644 index 0000000000000000000000000000000000000000..986d6c37ddc99c10c7655b0e407765630e8d5417 GIT binary patch literal 2136 zcmYL~2Uru?7RQH>NJ1v0fguSgfK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}Q!`CeN0x8zTCJqEjND|ue_wg#*PwxoKpG^mr&$dG&93jUkr724%_+Vx*$YVe?prxv+ zUWZ~M)&X=yx#IUS?5YfWYBT2h$nfEUK60ccppS5VIw&0ijM$=V3DtgXOu?3o1t3I5kWm|I%Slgv z+{pvzhIL!oI-;H|D!Tm^AP$4WbzFfgj{d|s3yLRFi3}K_O6vUqkNSKl1e2Fy;z)=!AB{!iXo@6FX?+Yvz56xe8RJuvPGfT+*`H{nWeQ z6^>X(+S|#d!R;xT)&SY2>=omk*Ihn%H;Vu=DNNez%hrmin&?E3kboj+!w3(>(^en) zaBRZ*`5F`&k>Os580{nN=V>7^60BImk7#-*T ztXHqs3JDF1hzwr`h0g2$yF&i&Kv3AC8@}j9EV_}4?z%-cHYIK&0&s0`u!awv!4x}- zcwUws%RTM6R;yO5v^5c!8ag_eSs1ff%iIi%T!r2o7i)8OJHCUB{+gvy+3G-v9)^m- b6LerLtfux7G)|Z3Pot2?@>t&>zX0gJ#?bcP literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/memory.hpp.220BFCF008454788.idx b/.cache/clangd/index/memory.hpp.220BFCF008454788.idx new file mode 100644 index 0000000000000000000000000000000000000000..a16e087593e14b38a14b55d1c49be96500af30d7 GIT binary patch literal 740 zcmWIYbaT7I#K7R3;#rZKT9U}Zz`(!@#Kk2=nOlH#Eh7U%#hl&=8~F|^@VNY(xz6J4 ziEHQ1-Z3m{67&$5z!)0&>#eKjl2uvl9&tJQH`l0FaZMCYoTJXlV8+&DvGWWEe~ep7 z!RIHd)ppz~RMF4%a(^LE`gMxpn(zIqvI^xkse2u9-srPp{}R*s8!tr&`I7rvdWtJ^lO6%xZt-fO`RlJnGXqFC*AsB*4TC)6d5aR0`8ycVzyyzD52A#h4gj@;ppD z9B}yyp$Yyuyqo0sn7DxEi;9WLf(f|%<>IjQaz-!Z*qIo47?`=(xOl(>11H3NjLeMp zp8LzkNeb`aW8wgsAZ#dX2`1ns6s4vW9|QUX=2J#aun%D#V`Kt*D45fAZ*HnU9}^EV zj|h(x53{h8uma3;KrJ9orCiX~xfrv9myw5AltWY$<~5)!$V-#wRU3C5IM51|<Ms0C;O4>K<_FDJ}DK$RfRJZ{fk*%`Q& z8EB3$yRb-6YEB|3UW$v7i`_vCXgq~({U%t<8 literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/mode.cpp.DEC43BA6A32D0056.idx b/.cache/clangd/index/mode.cpp.DEC43BA6A32D0056.idx new file mode 100644 index 0000000000000000000000000000000000000000..e7e0326f79eb056af44246c53a79b5ba56c0a454 GIT binary patch literal 2090 zcmX|B2~<;88V(^Zc?mBYgsd+K2_S?=K*C}GK}1AZB%%#@vWWs|1<@j?fC3c<*%X0s zBVy|U3aDtUbzzKRL90wbs-n0c3d2N&GFng>6zz@Y*n7_V&;9QA-~ayWTM`x;Du)S# zc`0Ez8L8PTNCX0b4!*4Hb*sddU<0_Ex_oWI+Cep^OCxxbxZrS?l&AZZK zi*h{==OmKuYZu{CRUoyk=TdH6AksqZFTSf5x@VT-q zx!v(`(V|;R|1re5^>JKE2@t2RU&UImb-(|+lK0H#@7ktho07afy&gUlSuG#f{Qp*a zZP(rVR~7|G(zR;I&ZS=MJFmKmH-FMUCB2Z%nCE#Ts4#wfdfGC#x?-D3j1JcYFHBp! z8=dI)_rF7_e-extp#bdCqg8|Ny{pTV$L=RZU8sq9)mMKffOqClL(QhB+UAyJ2JhV` z(;E24nT{hHso!UIo_glpUsQ8N-__~E>q^Uf$1RHJ;e6-|?lN8&$ zSLb>Q+g~*v{OVF;hM)+Y*wNw>30q|h+~3xyy?4o&Fcf>JcCylzu3j_Lg1t?MG8#YG zeeJZrC2YvWhn^=4*)BJoKfl+hp}4NU zAm51OK1&w$xAtD2e!Xw^YGaC{reLb{ef^n_DP0w151x-_yW#no^xBBzv&;We#U9?n zD1EcVtu%9>h_^|uhEgy89xbyvZE9XqN;tcx)8e9KOz)w_n^;w`S{)?)_GUzX>xo(A z>}jv)6E!&c8*-t~q z_`7^hakf+(N!;fhzu43_YY4iVP*>KyF(!T{GdM16Wbc?2EXC3*o;>)mKDb3w zICi}ndgz&7Y^bR*`2KNek#6(L@)-3A5^kMKpZN9J3&rVam~t*jjaVLaEmM8N+g2nlfIP>RPYd+$OgA$BpF$* zJ&=DedeYZ|g!9Gx8TJ!8x6EBZYrz$m1B)DI8h?n9H|dBZT*weINjS*#vW`C$D3b)*uWDRMP}vt_)&*9x#TzSD1}HN1LH&(NE(p_ zBtk}Lo*3c`!4XN|T~vZ9eBM+}cxUU)t}+-58;}#ko*mq9J@?T?X*ke9tPt*kv4>0g zb$8PNbVi)n5f5#ToY)rA1)zedu!-zp4TJ@2N&&>=m|`h)zA+<}RS6)(h0ui4eJLL4 zOZrG4Y9^mW!Ub%BHHeWXa5+~lZ8-f+ z_3a~>iRM}h`RJFf26Z&|Ph*qIA9;tZt3a($7u17 z_o!mRJ#YQR?*QaDay%YCTcfgh9(WDJLSxgc`}+naS2nlb1FS3T%6%%2bPDMZ1p^jk zp`79QDeUNElMp}{h3#JCzf?2&OOFC&t|J#4ol9K)_7R>6ppvc>zfFFuUTCL@0G%m> zg>+Cp7zI*FmRf;MBRd0$Vc1Nd47&Zx literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/mode.hpp.6A926FBEE534F2A9.idx b/.cache/clangd/index/mode.hpp.6A926FBEE534F2A9.idx new file mode 100644 index 0000000000000000000000000000000000000000..cf2c74c8b009180a3859096d38aff9992ed720cf GIT binary patch literal 888 zcmWIYbaN|UW?*nm@vO*AElFfyU|`?{;^LB`%vC^o4-G;Bo!yTJinZ z0XF00r)uk@rcD2|pyc6gPi>VW4I-UKKRu57?a}6afobwarw$8tb%`k_J3pR!eS)($ zd|TGR$1~kGwp$*PD?MGk^pw=crQvUz)`b~8YYjIE{F|KL`b8?+P%Pi_hraV!`J+#` z{1h$o3@)5tyYX#%M7Iqa$G?*N1p=0-p3GNP?Bvk-ExE{C;-Z_|m(}}gSNqQYeLXI% zd0tv^Wp0uZ(6!Reg11&i8~d{}G4eC8akFuAfe8jqkk=R(7}*##mQ`x;AJC5wVB!-1 zi!reAv-9&Za6nWr=-jz|#FVZ53?CDx00W!2u(&vwfXlZ}G<}*TfABsZ6E9F+R9I9B zOu*%r?_Vz)%4)?U#>5CSpO=Z34K9D~?iL-(FTS_MnFN9Q`Iz{a!313XW$h~qzPlaE z_?WnX@?yebl3)TZ|1J5Bg@=N_Hy;xhP+mk>L;_5}<^P(WF8vkvUq*n52WGzzyAU5- zz9==VSR5&&m?0s=!v=CC4;vpdAG_?NB$x7Cbw-RlY+~$UJgT;LiXLq zK?aI&OTogFkqI1@x4XaSSC#H;0Lls}3hBZ^6lfhNIAH+@Z*YAehiJ1QK8~kTt(^Uu$O>8wV3J3oAPV6G9mPPzTnx literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/mpd.cpp.7FCBEF52ABE61287.idx b/.cache/clangd/index/mpd.cpp.7FCBEF52ABE61287.idx new file mode 100644 index 0000000000000000000000000000000000000000..7d6d83705a258ce42ef152a027165062f9050ef8 GIT binary patch literal 6492 zcmYLN3tWuZ8}2>6W~%vSnwe@clcq6hQqx`2Md^l0x+qckLZWi%q6-R(qITuFTTuzc zvL)q`CDOXCtm`7gx-4xhmaulUKeYe%>@NR)znc`0~(wp~K z{^BRvdUS^SWa~mJrzHoLEjspv?UdG;-Jk#U)_P#`(FCdg!oVL-o^VF(tUiV?2 z#1ADO-u=*NssEk%rKr6wUWPkYss4<7=#}^3SL-RQ_r_a99v$P(wNLQ+ee2N#i__=3 zAD*u*-0l)@v)%fO;8Vvf?&wLQ?y44s249)+l)vSt-Pxl$$_gHSs9e-Cci^Baec4_< zsm%|gP1jCd>d|_#wb@-(DlM$4iwkg0c3$~#M*pEj{=WvXPm}$P_;H?_vo;?aw`Y~d zf+v>ee?4TpH73IPqW@xt(3HylzQYYsXKL+Np6Tw|Wc#+?SGoAZ)#JmAOS~*RmcMy$ zZPs_kmbh$;?UXN1a(*mMP98TQr}NpJt}3NEbyd?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`B8Jqmci`AiUF&kC`Mh=YO4+x!JQV`BGXsg{r%LyizZlVfmVWq6o@$yk$Lu>uOx82_MMA})D&!QT ztWZcHcpz4tyy3o)k+Odp;AWG;q;<80>7Mu0pM<47(VmQaf}7bpQat$mG}qD(2O*8~ zkJBQX;AB=MBoExoN>i1(?OI{$g$_UxzA9gaBxGWl9})=eVa2I!D2dsA?p!4ts5j^% zkv@>J+8|rtd{z}C2P|1LkPC1#>p<5L*Rp*4>rOa|@~6~Sx7kWt3G%v^kgyqTQ-p-w zXou-AI4r$B32)UJ(tm_IZHcyID9@+9o~78cBt1*qv-}tK2>+n~ literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/network.cpp.109ECEBB28F3CA1E.idx b/.cache/clangd/index/network.cpp.109ECEBB28F3CA1E.idx new file mode 100644 index 0000000000000000000000000000000000000000..5f659f91839340819147bc27ba2dcb52d4f6e1b1 GIT binary patch literal 12826 zcmbt)d036x7jS#Od%tz2&N-br&GW3eNHU~r$ef~F(k zwkU+Csi{fef8nA9zw5!v7@?Zl(xfdx0rMVt$!h$^W-hwZGsq_O{@q#Imugt$+?EI| zQf9xfcF#g0)r>g@omS@8|E(Alr+u|}$eO7o^D0d)ugG&+A2DU?=#)&WoYGVI$G3$x z-wSQ|(|suCll1uzTH?Ct+;3hPZFd_(4ZNgvUAMd_GCTCJOfc{BpW3PSz2@%@pLESmx_0@?txo^6kYTb9E`cYW) zv!~%cy24GfKR>*t{G;EEgQXWgEFxo5|Cy;BI@tSVO#au$3kCkY?H*mX7qwJevtJeN zlelrS?)tS^{s-OX%-&X`f2wstp2rxC#4Y!S%o}-9r*7_=4-1AkehAw>%C%zHh2TGZ z&fk8bA5SmDu9&*M%gT$<15)npi;E1*u4=i_qg=W9_^71=Jnd#&-ZbTQu#riJE zvTYak9Lj$xIg1zj&#w-?eRe?hsBPy1+78~$url#J)CcJpYce(aNx*2ndMr6d;QXe zt?6Mgu#0G#a$M_f*AM!G%a*qbslfk2li?gl%0@rJWtc0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@O5n)V8-!$951g`i%<-|D_Z~!oz=bCU@vvKw&NOD#6cuF$kM5Bn>mZYMx<;+=C?}2 z!zyY8t?qr>js zs{b(MaK%k%IEDFBSo{9nH;GS)?HefaPcfQeOjI)sX2KB+$2#Gx_#APMW@i6_542J-7T<8_>E{d4i*d1-D5 z|KEP~1B+p{{m&Tw0!!?SMOlqm`j{#n41RIzU-Kxipmsv-P- zQ?5z8!b&hJCJ6{ZeJKe${J1O!cr{d9L!q42d1J2m(GaDNJcKFp&RuBnjj()FC=q`< z0Fpv#Ay)lMh5xcd`xk2dg?hHk+|_+d@~IR+XeaLN#EX?4Tyt0|G@2Jg^U~J-iOao` z&-Mn9`GojStUhxX>mO$M=Spl`$#U?GoJJ!DVe3my<0XUj1lO~xM_-8O3(kB1csOIy9(L?fL_V)(DoflbNv=sEOeU~s78amIxtCE8^Cp?Xx z^GzlKj^bbzYYjh!16iy!>^KHZnS}>s;o&US>RW{euvjbL62q&;Bdc)`i?xQ;;DFZ) zE6$g!8hipMw<4`pq${wgbQ1i=*fQ!1JA?CoVQ`F=X+nqvcRmc*$MbxZ_ zUB4=(U5Y6BcZR+$XYTriaL{QC{Ivehjs*Mf`LVo%Nh68&JaP8NnuY+$_Gsj27+du*vgqBTziBULJ0B1CZZ3NM%E3d11`g7p3M`Uniq$nZAx{L_ S(viAaGWm$5!$u7cQ2RfNKn(Q& literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/network.hpp.959179E628BFA829.idx b/.cache/clangd/index/network.hpp.959179E628BFA829.idx new file mode 100644 index 0000000000000000000000000000000000000000..87fa996cefd4a53e6dc1c454aac85f53cd8b0e89 GIT binary patch literal 3296 zcmYM02~<;88pp#034xc#llNW%2?-EL*q1=q!WI^h#RbJytzxSPb@z}cF0ERpE(I4T zt_L{7P!~qgQ^(F&go;>ZP;^jwY8|(6FI8NMB5HAL=etkuOU}vv+%La-zqjP&cQY|J zJNq&vkz~%!UB0kn$xJ7SL?VZ`ZHaa6H3x|#7d}{Czh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i9}-`df105`%q~gD(pi~`_Rii fSS18rqo?a@A2PgSI^xQJo literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/pulseaudio.cpp.33560C8DDD3A5AD3.idx b/.cache/clangd/index/pulseaudio.cpp.33560C8DDD3A5AD3.idx new file mode 100644 index 0000000000000000000000000000000000000000..a0d951ab1d34d5ca8ce517492c946b6e919fd9bd GIT binary patch literal 5832 zcmYLN2|Scr8~2RY7~>tw%rIt*F~+`*bu1-IMTA6{w~|y^X|dc&N_EqsqFqIsq~&(q zbdeVAQ%wmsYke8*{QKe7-F_z476G`)iL<9a(nI5&zR>sVB~#uh{g)HRHFf z^{IP5Omh6z#JF{3=-$dp=l(RF@y+7v{LX-&&mI3R)BJShNxf!G{GE+6Zq5J5T%x`8 zsLO!2`_4U+S7b(nyjb>XZ{va|i`s&`7e0DXQBb+nas2rhgT-}o8}(m5t^9ELuQtd2 zynn1-U#Y*nP~Cm`)yQkw##_gF>`Fi1-8e^F|9aYv$_vxy^2slzA|KAd_S%G@?B7e< zNB(ZxToRm+vMYXWh?*?bY?~cc}TAH+AZ#%{`yJp5>BAQP6N&yQ|}L{U45;_`Rg{s ztn#m~_1vbod&JJ5D{bzL5bgM?@{Mox(>BiEtGZxeSW(7*YCU(x7Z>R!TAbeL-F{M* zwPi@a5t}+{OZ1_ma}HTGeOmd>L1TyWXS6*XP&&^#gSz3c0^&gRmj4WY+d z#{Tu@%gQHqZVHvJe(DDE#($9~y0h8Us}vibEYfyA^Cw;{yTXW@U{-?PcT3VJlTI4kynsia^g4_Nq}Rar^f2S)RpTKBqTz1m%RL=1241?{G4GF#VrVl7Y9n?}HA1opzIVE#z(e z9-e;h(H*;v|Nc(BFY>roR+hiVZMBkyQhFuum09yAOwMj_>5yeF=JDx$@q)F^BF*YELMXI$`Z0K_@Cy%F2R|J?ZIL zx1C5b=QY2Z*RGr}Zq}|#ktgoP=@E)4J!XF;du?9z=ey+ zU%t;(41T(sX<7V5yL$Vna+Q?DNmFtF<1K6L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!dEdGeE z6#=`5t{T-~Rt=5~@o~}l(_eSvzTiMh7Wgf? zX7dKFq|!9d#L>jR+qb+Fw>a5wE*>yRyKhxT|Q*3VEdd~-gI4>_YC!T9G>CN9~yxD<5z|knVKy; zuTHv7Mj1t!zw%?my=zt`ARGkEK``u*kx8-#Y5$@?m!WIedtq?Lvh=j)2(!UA8v^>S zd$8Nw#&5xiYr&?LPHPR|(g5zS4?G?){ffuSySJ)5r9{qQ|E>6QyrBG@3ZTdUg zwVUrez$~uDRO8`>Fu0hgcw(M4UX~aZ_-vtXfzBgm%aI+(WpX)QoY>y@>@D+_CnqGv z)4x`wBu`Bd&<{$w`Thr#_&;~aj0~?zP^wH#nwA)Y;&D+?5GWKG1`HYLINZk9*3VUH z=Wp-fWUjC U(BNx_3%EMEVN*jQL&vK87hG7Kh5!Hn literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/pulseaudio.hpp.C6D74738A7A6B198.idx b/.cache/clangd/index/pulseaudio.hpp.C6D74738A7A6B198.idx new file mode 100644 index 0000000000000000000000000000000000000000..40bf5907d709a90dfc20cedeb8f98395162dbfd0 GIT binary patch literal 2202 zcmYM04Nw$i7{~YCQ+7G_Ue4vXPwu!oj&Be26eWceNc>0>WXz95M-&;+69iJkPfSw* z5h2A93e8Hb{9uf+2m{nc63Hl2kRg+hAuU2CKm)O77vJS(_|HE3+vnL`xZg7@m>nHm z$WT<&>e-o&#Eg}rD2kH9PkKh$+Q|}%szMZ%S$eQAJVk0|-+w+K{?Nof9FEho&MEz) zX0}U;; zt{yDz{yo(kdw>g0DBQhvRr#aR{`P{RiT>#2o;dojKG+dkx8k>xQ7!+P!y>0H_&%ZS zq5aQ>`oi;Pwk@r`d#!9yL*!06rFv)e9kVZT|Xu zB~e}XXe6;xjEj?tLI}!vc)o;@*ts&#FpHxaBX^i!!4{1W;)Kw*j6)qw)<%pxfCu0J ztq>v)-!`CbL`hW`8G+ld%~J@GNA2A|*mI(}Pk~&$hu?|ODRrJApRczxD*aL{7>$Ph zU>s}_LgXfc_9T`2VB`ec z2m81QA@YQ|ZN)nk;cjZ=L*`?Ir6Nz95+C!#SP+VlC-ev6Ko22AzP)Z5AD?U5YPkbWgrYD9i4CNdzScFqor#z4P^#=|Ux$iHf~=g#QOzl4z& za5FZ$3nB7KsZUN>(hsk3NKNLeuu3QLD-TK=j!%u9${`)$?$~{V*Cd5hCHLo^#7GMB zjT)m#2(ka_zWZy-v(7A2AO-2yDzzq&-%fjyAGT=AbNHh`zc=>Q2_f=dKF)XU+Up;L zksEMd?5h$&R{jqqiP`?r)TBq3am6~dq55YIbSY{cn=rzzQ;MwxZ+4uZ~45EV|gXv&7*%fd{eo>Is042W{ z$R?0T7=8l~@qzNz6VIXKB_~?LQT`!o|F;#7`)BIf;(Y%WFvNgOaz7$OaelrV+P*@=o3SBJG`x z^tU(QMlL!R6EO=e=CvXsLCIV6tL1d}vGymQz{T!C?qNhD7{%*DtbvmMIuS{rmp3FW zas5hu*QckgN{{0Yn6Pto6+3NbQ=ME`xwDL>Wc=CTj|({%{?Fo7#g3eH9yz2(4*v%d Cs1;-Y literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/sleeper_thread.hpp.B273FAC75439EB17.idx b/.cache/clangd/index/sleeper_thread.hpp.B273FAC75439EB17.idx new file mode 100644 index 0000000000000000000000000000000000000000..ee3351c34d12016680e3261376da49be2729a29e GIT binary patch literal 1672 zcmYL~3s4hR6oxl9H}9Ke6G%1*C~*@c5=ukEK%hh!jEN{uEme!v8c>UG30AR;#aCyn zW$L3^YjLdN6SXtgQAAs7u``H{qjoH`q7l^k>S(PU#bR4~cI}3p$)CIX-#z!-bH6h? zF3<0;lT*~lio7Lrr&mwI6h&#_7pktRyaNB1B^0%!p?>|jS*LTzs3-1U-m2XE;kKESld7a0<`y}wUG`)G-m{85!AVL(C zaW1;9Y~eo_jYwjoFpcOaK`13(3b+CX5A1uoJtvk%2>b#|0VhbrAN%{i`5J4glYHFtyF6=JZ%^(84QD-y@ z67e^bY`023DtkyHE%?Qj;vs@W{EZXObZ^WV0Xw9@=M)?xNW|Z>Y*Nd{OGPCtV!`(z zpHz^D-*oiZt0wkl{mTjyM4~V+5x@OR!pe~iX)QF;!25-kLaQJV|FQM!`;C8{TtFi! z_(hhYA%YC}q0?thevo&VK@9lmigb-25&ub}q3MzG@z z$K*j9g1*Jam%Sz>*cI!t66}fffEFqWNqp+&mg1D$AjI@qyoubSrlb0&yH>%iJ;olF zOqN{eQHHljFlGs>6;YI^1q8F@w?fY;dl9T{j`tsY)x*0tQ^sfK_YQ7wLlsXP78_vtpPr(UluY(GT7om>nUDZaxX3hAfCqZ(>DAjVxO&ba zj9r{70b>v6Noa_lkj1TYzYSTrG%f=itHxsxVTa6l()T?Yy<^JC{a0WP8_mK_^A-78 z5qJpBgMMh~?n-}o#sUbgXY@LZEySWdv}tOI*4NPs5BYKd05q#>{%lx@x9#j&*q5L2 zo5aR|v$mORg8=|j5~ypaD;bg*>Pc1$jnduT(|+ej;}HmDGuT*+lMG30&ji`^y0&s3 zgmT6>2a7!fC1P}piC~k~1VmXm>o6!(u00Q?jdhMAI7^-dCE}ax@&9dw)IvKEJPMCe xR!yHXjqjmQRe31D53ub<*AMFxA7YtIu28Bd_?C#5LL5+(a$u+$7|I5Q{{f$nonQa} literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/sndio.cpp.1174277772D16F52.idx b/.cache/clangd/index/sndio.cpp.1174277772D16F52.idx new file mode 100644 index 0000000000000000000000000000000000000000..dcbcf66a93e0bc7fd46a9b8fac102640380ab6aa GIT binary patch literal 3834 zcmYLL30PCd7S4nuKytGO5<=Js`wjsj$S$%dD2sAIP+644hz1l0B5I4;qM?dd73u;A zr6ROtsiM{Zu4qMgQmqS?;{HG_uUKrK_|D}O&G+TZ{4;0foSAdxKQ|^kG<1SRA_b?1 z7b-IHS5inM5)=M;`O2&uEfVRj4vAD)vparZ?Qhk@l3F!yQ7-;bs&6G$tj?zfk# zTO^Gw^}QjV9|(?99e=)ItlMV$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}4iN5P9(#lq8Jin!J^;dAh>2AS6&>#os&rjp(YqBi}^HdLomHKVQw31ux2i^EuKS2}*a#_QLQrv^CJr_spM*;ad@9 zD?#r&5M>9^9zpygNK9Deoks?j6obJp9$kbaz^jmc6*9l#e$5w8=z9tSDt(o>?}RdG zz4n>Qa6bfbVfaS!MxBASfYmAfubH3|#0X*!dEzHKvL~_uZlrJI+|@rnt@1ZjL2CNh z`ZveeD4 zB%s1nVf*A^h`Oxz@piCCJfzvrC^(KlN5H24^CdO=?F4U-pqM}WUQ$my+(m{xI+36g znNAIOzaE?}+5iLf$ezU@~zDi5Vzgn?qiVpCeBazGf-FxcGQ9-#}~_>NC$J*e<|6 z(8JUr$kE$X>S<->HOJc4!q~{tPhvh-9%AC_WaIDdCUX`=>xV}~#)Ron`D6x@g=y<( W(Pt0 literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx b/.cache/clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx new file mode 100644 index 0000000000000000000000000000000000000000..a6d18d34376287f1e1ad737d131bb841036f3a23 GIT binary patch literal 1304 zcmWIYbaNA6Wngel@vO*AElFfyU|`?{;^LB`%o{*@4kH6Y#hl)W*7=7WI2wK$$NJ8? z7;Rndy|k}GMrB(||7F`dX(#j7zuvKGRar-i!vXe3jO`kWnY&Y(9vEh=2$_3I%C2{r ztrDM|W|f3@TFv9r6OH=}BZQAG7q?qg>g@IX!enn_-5uNZZ(nis;)WSnmwZZ3ocgqS z%T#$Yn>X{t4<3)*{=UpY|8>Q`>37^38W+!yb1K_>w({%en<8w6O`Y~>|2C~%C9s3@ zY+i0qQ^}-FFTyev7i6ej6nbE$=;(bY^x^Ef`01~Hzh$ZYZ@%eYl4nf5|4)_!|0Z55 zuFOqRVq#!W_{`%ZUA{(BfJsmc=v^RSVOHjd`kfHtvUA`o(nK>!ORzA7Zire_t`J$`)U!r zh@FX1l!29#jguQpFmOWbXJlpU-)wzu-a}Cy0VZac2_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7VJP-P?!gEy6(+Q73c%X@(J-tg!l=mznEyl3gk+$OYy?O7^oN&z@_Z{Z=7Kr6@uTRtaPurqRUf`S_s%0MnCbYX!CG!PV`urOp~Ix4aSCUIJHl=9E_W*WqFi>ikO`$dwY7l4K}K z%}E5Mm*S%2;$RSi3q(Kw2aLhMz>Z*YBbaOmCZ|z1II7Ju2exY;>a*%(+6asXqK B9!mfK literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/taskbar.cpp.3B871EDA6D279756.idx b/.cache/clangd/index/taskbar.cpp.3B871EDA6D279756.idx new file mode 100644 index 0000000000000000000000000000000000000000..da30b7b2c157c04d7033cd7cef0ad65e3ca015fc GIT binary patch literal 12886 zcmYjX2VBkF8}BUc?f$CUyp{H*rJ{_I8IkbXFZpHXjf}i_?a|O8QF==m*-A!2L`Ft7 z$w-l;5-B5kjsDLm<=^Mi?|Yx~d+r&}InO-z4{t9oUuPwye$%{{%$dG$GF4JiQi1>A zg$rig0-`$*OSZ*~88P=|H+jRbClji(79Z?8_{_;e175D_n=>G}?*RWNrBM|YR!8T} zzA-{o4X%KQ1^UUJ!s+aG`EH?-gUzWn+-t;Opa1L{tNUv>MUmbTNg z!RjNK{nA*XCiARQedX`0KTPda{SlIBj$HgaK_qiPk^?x$^+$VeYl&>3? ztp8Cx@5QnoLwc_b-{kpYL->Pl;YZ)cyfso;y3F%xY36CSWZ`=|mD+a4y*@hW`dXh% zt50vb_jlC9GZVc+&J^}HUNearrM6r0^L^Fc=S**x?8*c0rt;~P6Do}>57tA4~mQPlFO6p-K$nL&My16z4tbi*=ASksvn;( z*?Ob@<*3B9!^1{KI5_zpP7Ho{diKo222+ZHY;zaoWXwxI^%aSd#-#kK{{0gZGW@Gw zU0!y1y1K2so88_Xo-@jiTq{l=lk~^&(VyOI@i&cn;?wqA&hl}Ii?zdsygUV(ny0S9g z*}J`bL$-}Rryb_r^N%|F1v~O0JI>4SIoNT{tX;DlWQHTGXXHG$NbQ#uq*xGmC_ed= z+J(Q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gLE5O7lz`&}fqG!Y`ASR#!mzTfaVYpgHPE>%23n*`+Y@^F8C?==? zm)HDoE9)JV5hB#6)Dl1YABy)aK{ba}IuDOpHMN%yP_{%-l@eym0xb{kH#G z9xf~rVB!VJiz|z3GV`+YBIMhdQ#n!^)l4V&dk5_?ekqh+Pt90z*-1TJcq&1T3T&xxgU= z3m8UDaDc$V0mudUALebKVvwJmewo!gnS9%kk%w7OQBV`+X`o_|XM;Ii_vWSw^Z}j5 zEy*pZ0gE_T9&UTuy0DMWF9;5<$K$E=n%81~H)V4q`G_c7Bk3 anU}Dhg`JIwg@Fwu1_A6a1_J{Vf(Zbi#?Pbx literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/tray.cpp.02A8D890AD31BCCD.idx b/.cache/clangd/index/tray.cpp.02A8D890AD31BCCD.idx new file mode 100644 index 0000000000000000000000000000000000000000..d907a6a2994853609beddb733ee264a4e73b4236 GIT binary patch literal 2114 zcmX|B4LDTk9v{cdIdjgO`8a0GFf+^yGa8K~bSFeo2qhn7hNQ&oh`2J^lyY^^E|%33 zd)NB7MITnN2$fbB)vX@Vx?8foLaUbAv3*dfbl>qjb)IMb&-~us|NWoe|Np+f6XNIN z<4Prw*2VgzC2CTm$s`hq4t~1Sl-&|z5(xraTKVCveMw~woXOBLS5reZ!>5L7C6hNaU#3mNFYPlnW>`IpY9sRg9r_Gnf!vT`4JS1YJx z{$BQuJ(9W$3h%oyyqp#O8E(w#BY7ol1GKEZ`*m-xy@!t)H(cF3V|zQ}(0sXnWNg{y z2QKyTOMm)L^K4wzmXpbjxg%uvG{4pJ3oSX;D*B41p|uC6V_F~ngLy0O8)bIwnD~jA zS7cUg?9RB+=~79@EH{2?nOWTUYSs1E0alaSeC#`MC)?(+lYT#?|JQq+zwMXb1ch&J zk|r+Qe&0VNVkW@#8QV^iy}c`;i6Tq)D=SH|&)YhocP6t>*bd~ke%<26|6xZuS^HzF z=lIN)n$D+TACYTW{|srW>enRytWvfO2KBCN&e$QaQ|*2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pO#6an8esU2DoMGRwG|?zQD)L+hN^OPsLhiv7OhlRV!qF zvymuWm)KfcT1Y*FR_-qAMXT-QYn&WcE;rlE_45x1*i_@% literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/tray.hpp.469C1AF36DEA64C2.idx b/.cache/clangd/index/tray.hpp.469C1AF36DEA64C2.idx new file mode 100644 index 0000000000000000000000000000000000000000..3a9e9b296bf8acb6781cba51d2593c36d1bd5568 GIT binary patch literal 988 zcmWIYbaT7H%)sEB;#rZKT9U}Zz`(!@#Kk2=nVW$0X+{QyiaB!wcXJ&!;JG3mx_f(% z?5%~mB_@7r1jKK1)h#)DDSy2z(^6-}6v6fq^}C8YSWTTz>vQhis3K69;C^Cmr{lxe zvun9BYSK5W<@l}Hy!5a^U-S#s{H4263y-|;U3heh`*g1w^4V@iB1$B=Om&C`!50n>|5mx~daQR&uAFkre z-m!t5iBW)ojhl^|3rsL@Lfp^D#&~G0(rJwuMrQ<=cwjCRVi)3pn{d`Qcl+Fr?T^Hm z7-90fOuTGx`Cqnb&sugdNeVFW!Q}bb`FY{;MX71U!AK#=$OR5T4XcBZyA_fZn0VNP zWQ7!Y*n|~?RrG&L3x2)+RgIB{OAE*JRiF>ZQBEF^(kkec(V(F^lbS9k!86=N6UdKh_I;^#es|3EIc2)Fc81J*C>{Nml9 z@DUP{0fvvLuskfRfhK^%xF|Iz5tOQmi;|0jK@4cB1Tlfx5e7J53P-qqJXT56=5}^0(J!>D2NTP zE32!=g2Jw@QtYCl{^;84{_|MTvz)`d@6ODvbvi?t$pFWt=f z`lz4Zn6aV#@~aIA1Nx+M?LTdAl_R~D>oy%;u(+q|R`-^?h6nQb z75#4)ee5XNlsM#LlhK>|H7~q!?_I7`z4z%v>$Sqn)}hN|&tHj4RAZlPF0Fr2`{g~x0K&sGsSdI zw60ZH&7RKDzI_QnOCK}Ctam9hmo{&!z8Z9}{q3mz!QF?KZX=vGd8d`6<_G${?lL%& zy2EbF2ewY#tD`*=C%43n3BH(?!1D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m;cflKWufJ_x0a^F0b-pJRmChuLXPn>%guKoM|9ZtEc7a!Kt2>YXG$ddffmH4fO3B z!LAXUzr3roRNGr@gQ=K9Cuk^ehnEL?{@HjA!({n2j zt-$%ZM$|cdrd}hK#m~3-pTT#k*2fj|R8qX5rQ_I@%Sn~}~ETVFdj2MbqAlVKiK zQZup0+oE%-``VqQ8!68wjbyT$oHFZA8=BV&kOs=-Z7(JmtGki*D IbXX+g|A~rsG5`Po literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/watcher.hpp.F4849F54352399E5.idx b/.cache/clangd/index/watcher.hpp.F4849F54352399E5.idx new file mode 100644 index 0000000000000000000000000000000000000000..8ee37cc490750e62eca5bf907dd91e1d632a4f71 GIT binary patch literal 2232 zcmYjS2~ZPf7~O1E$Zj^tW^+I|5{^Iu2?hv=RV)aIq5`7`ii!*%bp)vzP^lJd9T{&& zDa8YHP^s1f#8#_LovJw01C^o{(6NdZv?3lO;#sxduKr7RCNI15{`dXg|7G9H#Dw_x z1__46&P*sS$SukuFbtEyr?AK|d#nh<7T_3GTwOM?Iq6I=^L)>|<+1tX{0nt4C0)@Y z!*<@C`PmEq^sbK6GgA5+kN$l)v1Ux!)wRD5|8;-*&)qR|W;MMVt3H@qcxdrWb?@{G zYhH_|rAk;eYsL!)Kd0+(Au~f?SUAv?*57SLG$(m7oR`s$Q;|! zyfVJ;@^HrmUHx}+*)bFGhY|}Bb=}iBvFfDTj#U4=&bq6u(VeG#4C^u?rslk=uWLQ> zsB7WkMKhzEs#A5=6+el)_50SpDaot3xqCq!o@UsUUh}8#%ix~;jzjTN3p#aqG*Q}( zzbkhvs|-(2EX%q}zF{(JoBpUR&Uo##I?l8=OZ2bv?&G3@f^VvGuVwlzoO-2$DY_ln z5X(N$_Nvc+k#CD|4$BY|nM+x_bV@(vy{K*GnE|AEUZ`J~{4bz^E`;n1%;T!i^p-r+d%#*4lSR%W)O(p|VgF4+5{x zJzjIGs^_pAmjE9k3(@f)@W!0-*a=1EFey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$4iQCFpT;zhdHyY O{`49#DWx%bfcOukpfkAu literal 0 HcmV?d00001 diff --git a/.cache/clangd/index/window.cpp.8AB8664D31F55915.idx b/.cache/clangd/index/window.cpp.8AB8664D31F55915.idx new file mode 100644 index 0000000000000000000000000000000000000000..d84db141d9d657d794a181c0dee61d88f723af36 GIT binary patch literal 3582 zcmYLLd0bP+77p=dx#R}2k%TO4A%P^2gapXKzKbYAG-d*bvMGX~f<{mTt76sSZWk#o zb*qYCYu(UN_o}?Q?@OyxE7tmIwLqyBeJ8%BFMoW$nR8~&ocqmp&cvFYn%d7Kk&=qj zYbr{n7hoh338tj#=~a`44Iz;x(n+M6mN~Xdl|Nfp=f2$a^73q(x8Ts>YXQ&W(@Qst zImsJC{*qS}azmP=W;}H8<+?4!Nypl-#gAINU)9t-MfB`*e+}QfZqwuyKix%V>P4|p zmr4&UioP-KpGwlJ0(PdP;nK~NF8$N+s^DUy@M>e_eb4sFs3VrRtlb}7el@WE(!(1E z8VW}g@A=!=DXTr!+jqn^C!A`_*7fSf4Q$WUp#s1tFkSOBbj{-4dXT3 zY%4V(v`1KI-5C8~`;CqWLrn6L(8$ZVS0j!ema^h5EJl;fF*NS+efoKQeuB+Gi64hw zDZ8M&^0ztTf!=6qizqtfU(}f~?{v$HYSY%-HP3Gx%=`Q$Ib_jc11s+f>kE4kd-s^D zzttV_!gO&o5az0juPmtFk>=;NR7^vEp0OzJrX;Hm6$qm~?W+v(ST->UHA> z)_*+j7Zc4k(3r6^-;(}`qh_;{XkF0Le7~ekcv>#Fx-)HA$4T9?eY@1VA_TjZf4yV- z^QK9gn8SNhezm`B-s8FdhwWLvKEHMgDb?Srl+~$o2FmQ+5>1?X?7!sN$c(KAYEwBA z@YL(J)Ze@KqpS9A{$qMSky*4h+p255b!b@5^fi3jz8Mn3f)rRh8 zBe2(=H%1E zOfq z_qUWwR~07DJXEiTEh2A`kB|4tHuJJT9Hu^)57qaD+d1yE)<~Q{6cU9B2)9Hax}I(# z5U#@`3B;%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0RsPs`H`0`$ waybar::modules::Battery::getInfos if (!adapter_.empty() && status == "Discharging") { bool online; std::ifstream(adapter_ / "online") >> online; - if (online) { + if (online) { status = "Plugged"; } } From 336cc9f3368a2badc78131df3fbf0d270d8c25be Mon Sep 17 00:00:00 2001 From: ocisra Date: Mon, 18 Jan 2021 12:39:41 +0100 Subject: [PATCH 130/303] . --- .../index/ALabel.cpp.09E9F4748A3CBF6C.idx | Bin 3224 -> 0 bytes .../index/ALabel.hpp.81F9065828AA88EC.idx | Bin 1438 -> 0 bytes .../index/AModule.cpp.8C79E6793B0ABDDC.idx | Bin 3206 -> 0 bytes .../index/AModule.hpp.D8753B04060BBA88.idx | Bin 1730 -> 0 bytes .../index/IModule.hpp.E1245342A901572D.idx | Bin 482 -> 0 bytes .../index/backlight.cpp.8F986B9BECE3CA9B.idx | Bin 5394 -> 0 bytes .../index/backlight.hpp.0EF1448C3968172E.idx | Bin 2104 -> 0 bytes .../clangd/index/bar.cpp.499C72A404C3B6E0.idx | Bin 11056 -> 0 bytes .../clangd/index/bar.hpp.548C657FFF81C379.idx | Bin 3490 -> 0 bytes .../index/battery.cpp.C1194A004F38A6C5.idx | Bin 5698 -> 0 bytes .../index/battery.hpp.A5CF2192CCD687A2.idx | Bin 1704 -> 0 bytes .../clangd/index/clara.hpp.37039B002C851AB7.idx | Bin 30604 -> 0 bytes .../index/client.cpp.142786E5739C6086.idx | Bin 3324 -> 0 bytes .../index/client.cpp.90DC0642EC0F3846.idx | Bin 7640 -> 0 bytes .../index/client.hpp.B4D0F538B28EFA9A.idx | Bin 1852 -> 0 bytes .../index/client.hpp.F7B62724EF944420.idx | Bin 2630 -> 0 bytes .../clangd/index/clock.cpp.622BF041106573C2.idx | Bin 4824 -> 0 bytes .../clangd/index/clock.hpp.6C252B8E1A974E1B.idx | Bin 1528 -> 0 bytes .../index/command.hpp.11D8330C13D77545.idx | Bin 2266 -> 0 bytes .../index/common.cpp.8896DC31B9E7EE81.idx | Bin 2080 -> 0 bytes .../index/common.cpp.FA1CA1F6B4D16C67.idx | Bin 1866 -> 0 bytes .../clangd/index/cpu.hpp.A6F11840DCF8A513.idx | Bin 1026 -> 0 bytes .../index/custom.cpp.EA9CE9AF81C1E5D4.idx | Bin 4732 -> 0 bytes .../index/custom.hpp.36F2F4DF290D9AA1.idx | Bin 1720 -> 0 bytes .../clangd/index/disk.cpp.1F7580C201D672A2.idx | Bin 1998 -> 0 bytes .../clangd/index/disk.hpp.E57994872D8447F8.idx | Bin 728 -> 0 bytes .../index/factory.cpp.CEDE1C1627112064.idx | Bin 2394 -> 0 bytes .../index/factory.hpp.2AEC37A00908E370.idx | Bin 904 -> 0 bytes .../index/format.hpp.A472BFB350A64B30.idx | Bin 964 -> 0 bytes .../clangd/index/host.cpp.0C1CF26FC798A71A.idx | Bin 4080 -> 0 bytes .../clangd/index/host.hpp.D6E6FF9FFAF571DF.idx | Bin 1978 -> 0 bytes .../idle_inhibitor.cpp.3D718BD05B870FA9.idx | Bin 2398 -> 0 bytes .../idle_inhibitor.hpp.A4AFAA5C5DDDE471.idx | Bin 898 -> 0 bytes .../clangd/index/ipc.hpp.804BDBBDF260032D.idx | Bin 1498 -> 0 bytes .../clangd/index/item.cpp.BDF1AC58410539C1.idx | Bin 7280 -> 0 bytes .../clangd/index/item.hpp.CF2C10DA19A462FB.idx | Bin 3008 -> 0 bytes .../clangd/index/json.hpp.6C08A0DAD19BC4D8.idx | Bin 750 -> 0 bytes .../index/language.cpp.7CFC0E2AB711785B.idx | Bin 2412 -> 0 bytes .../index/language.hpp.045E99AD59170347.idx | Bin 954 -> 0 bytes .../clangd/index/linux.cpp.AA11E43948BF7636.idx | Bin 1320 -> 0 bytes .../clangd/index/linux.cpp.EBDA54C079A9D2C4.idx | Bin 1528 -> 0 bytes .../clangd/index/main.cpp.9D6EE073CE3F67E9.idx | Bin 2136 -> 0 bytes .../index/memory.hpp.220BFCF008454788.idx | Bin 740 -> 0 bytes .../clangd/index/mode.cpp.DEC43BA6A32D0056.idx | Bin 2090 -> 0 bytes .../clangd/index/mode.hpp.6A926FBEE534F2A9.idx | Bin 888 -> 0 bytes .../clangd/index/mpd.cpp.7FCBEF52ABE61287.idx | Bin 6492 -> 0 bytes .../clangd/index/mpd.hpp.F92558038735ED47.idx | Bin 2124 -> 0 bytes .../index/network.cpp.109ECEBB28F3CA1E.idx | Bin 12826 -> 0 bytes .../index/network.hpp.959179E628BFA829.idx | Bin 3296 -> 0 bytes .../index/pulseaudio.cpp.33560C8DDD3A5AD3.idx | Bin 5832 -> 0 bytes .../index/pulseaudio.hpp.C6D74738A7A6B198.idx | Bin 2202 -> 0 bytes .../sleeper_thread.hpp.B273FAC75439EB17.idx | Bin 1672 -> 0 bytes .../clangd/index/sndio.cpp.1174277772D16F52.idx | Bin 3834 -> 0 bytes .../clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx | Bin 1304 -> 0 bytes .../clangd/index/state.cpp.E5F8B9AFD9E7ED3F.idx | Bin 7084 -> 0 bytes .../clangd/index/state.hpp.210A97315D520642.idx | Bin 7032 -> 0 bytes .../index/state.inl.hpp.07C5BE693644AFA7.idx | Bin 1336 -> 0 bytes .../clangd/index/tags.cpp.901229A9EA5F0AD7.idx | Bin 3004 -> 0 bytes .../clangd/index/tags.hpp.38EBC6B49867D962.idx | Bin 1076 -> 0 bytes .../index/taskbar.cpp.3B871EDA6D279756.idx | Bin 12886 -> 0 bytes .../index/taskbar.hpp.3F1105A3E0CB852D.idx | Bin 5366 -> 0 bytes .../index/temperature.cpp.BB5C0ED5BD80EEFE.idx | Bin 2538 -> 0 bytes .../index/temperature.hpp.58F6012FF8EB97C4.idx | Bin 818 -> 0 bytes .../clangd/index/tray.cpp.02A8D890AD31BCCD.idx | Bin 2114 -> 0 bytes .../clangd/index/tray.hpp.469C1AF36DEA64C2.idx | Bin 988 -> 0 bytes .../index/watcher.cpp.793479CFFB135BF1.idx | Bin 4334 -> 0 bytes .../index/watcher.hpp.F4849F54352399E5.idx | Bin 2232 -> 0 bytes .../index/window.cpp.8AB8664D31F55915.idx | Bin 3582 -> 0 bytes .../index/window.hpp.E69A5ADAD0A0E8F9.idx | Bin 1456 -> 0 bytes .../index/workspaces.cpp.EC0CB7DF82BEDBA3.idx | Bin 7454 -> 0 bytes .../index/workspaces.hpp.0FDE443B68162423.idx | Bin 2044 -> 0 bytes 71 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .cache/clangd/index/ALabel.cpp.09E9F4748A3CBF6C.idx delete mode 100644 .cache/clangd/index/ALabel.hpp.81F9065828AA88EC.idx delete mode 100644 .cache/clangd/index/AModule.cpp.8C79E6793B0ABDDC.idx delete mode 100644 .cache/clangd/index/AModule.hpp.D8753B04060BBA88.idx delete mode 100644 .cache/clangd/index/IModule.hpp.E1245342A901572D.idx delete mode 100644 .cache/clangd/index/backlight.cpp.8F986B9BECE3CA9B.idx delete mode 100644 .cache/clangd/index/backlight.hpp.0EF1448C3968172E.idx delete mode 100644 .cache/clangd/index/bar.cpp.499C72A404C3B6E0.idx delete mode 100644 .cache/clangd/index/bar.hpp.548C657FFF81C379.idx delete mode 100644 .cache/clangd/index/battery.cpp.C1194A004F38A6C5.idx delete mode 100644 .cache/clangd/index/battery.hpp.A5CF2192CCD687A2.idx delete mode 100644 .cache/clangd/index/clara.hpp.37039B002C851AB7.idx delete mode 100644 .cache/clangd/index/client.cpp.142786E5739C6086.idx delete mode 100644 .cache/clangd/index/client.cpp.90DC0642EC0F3846.idx delete mode 100644 .cache/clangd/index/client.hpp.B4D0F538B28EFA9A.idx delete mode 100644 .cache/clangd/index/client.hpp.F7B62724EF944420.idx delete mode 100644 .cache/clangd/index/clock.cpp.622BF041106573C2.idx delete mode 100644 .cache/clangd/index/clock.hpp.6C252B8E1A974E1B.idx delete mode 100644 .cache/clangd/index/command.hpp.11D8330C13D77545.idx delete mode 100644 .cache/clangd/index/common.cpp.8896DC31B9E7EE81.idx delete mode 100644 .cache/clangd/index/common.cpp.FA1CA1F6B4D16C67.idx delete mode 100644 .cache/clangd/index/cpu.hpp.A6F11840DCF8A513.idx delete mode 100644 .cache/clangd/index/custom.cpp.EA9CE9AF81C1E5D4.idx delete mode 100644 .cache/clangd/index/custom.hpp.36F2F4DF290D9AA1.idx delete mode 100644 .cache/clangd/index/disk.cpp.1F7580C201D672A2.idx delete mode 100644 .cache/clangd/index/disk.hpp.E57994872D8447F8.idx delete mode 100644 .cache/clangd/index/factory.cpp.CEDE1C1627112064.idx delete mode 100644 .cache/clangd/index/factory.hpp.2AEC37A00908E370.idx delete mode 100644 .cache/clangd/index/format.hpp.A472BFB350A64B30.idx delete mode 100644 .cache/clangd/index/host.cpp.0C1CF26FC798A71A.idx delete mode 100644 .cache/clangd/index/host.hpp.D6E6FF9FFAF571DF.idx delete mode 100644 .cache/clangd/index/idle_inhibitor.cpp.3D718BD05B870FA9.idx delete mode 100644 .cache/clangd/index/idle_inhibitor.hpp.A4AFAA5C5DDDE471.idx delete mode 100644 .cache/clangd/index/ipc.hpp.804BDBBDF260032D.idx delete mode 100644 .cache/clangd/index/item.cpp.BDF1AC58410539C1.idx delete mode 100644 .cache/clangd/index/item.hpp.CF2C10DA19A462FB.idx delete mode 100644 .cache/clangd/index/json.hpp.6C08A0DAD19BC4D8.idx delete mode 100644 .cache/clangd/index/language.cpp.7CFC0E2AB711785B.idx delete mode 100644 .cache/clangd/index/language.hpp.045E99AD59170347.idx delete mode 100644 .cache/clangd/index/linux.cpp.AA11E43948BF7636.idx delete mode 100644 .cache/clangd/index/linux.cpp.EBDA54C079A9D2C4.idx delete mode 100644 .cache/clangd/index/main.cpp.9D6EE073CE3F67E9.idx delete mode 100644 .cache/clangd/index/memory.hpp.220BFCF008454788.idx delete mode 100644 .cache/clangd/index/mode.cpp.DEC43BA6A32D0056.idx delete mode 100644 .cache/clangd/index/mode.hpp.6A926FBEE534F2A9.idx delete mode 100644 .cache/clangd/index/mpd.cpp.7FCBEF52ABE61287.idx delete mode 100644 .cache/clangd/index/mpd.hpp.F92558038735ED47.idx delete mode 100644 .cache/clangd/index/network.cpp.109ECEBB28F3CA1E.idx delete mode 100644 .cache/clangd/index/network.hpp.959179E628BFA829.idx delete mode 100644 .cache/clangd/index/pulseaudio.cpp.33560C8DDD3A5AD3.idx delete mode 100644 .cache/clangd/index/pulseaudio.hpp.C6D74738A7A6B198.idx delete mode 100644 .cache/clangd/index/sleeper_thread.hpp.B273FAC75439EB17.idx delete mode 100644 .cache/clangd/index/sndio.cpp.1174277772D16F52.idx delete mode 100644 .cache/clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx delete mode 100644 .cache/clangd/index/state.cpp.E5F8B9AFD9E7ED3F.idx delete mode 100644 .cache/clangd/index/state.hpp.210A97315D520642.idx delete mode 100644 .cache/clangd/index/state.inl.hpp.07C5BE693644AFA7.idx delete mode 100644 .cache/clangd/index/tags.cpp.901229A9EA5F0AD7.idx delete mode 100644 .cache/clangd/index/tags.hpp.38EBC6B49867D962.idx delete mode 100644 .cache/clangd/index/taskbar.cpp.3B871EDA6D279756.idx delete mode 100644 .cache/clangd/index/taskbar.hpp.3F1105A3E0CB852D.idx delete mode 100644 .cache/clangd/index/temperature.cpp.BB5C0ED5BD80EEFE.idx delete mode 100644 .cache/clangd/index/temperature.hpp.58F6012FF8EB97C4.idx delete mode 100644 .cache/clangd/index/tray.cpp.02A8D890AD31BCCD.idx delete mode 100644 .cache/clangd/index/tray.hpp.469C1AF36DEA64C2.idx delete mode 100644 .cache/clangd/index/watcher.cpp.793479CFFB135BF1.idx delete mode 100644 .cache/clangd/index/watcher.hpp.F4849F54352399E5.idx delete mode 100644 .cache/clangd/index/window.cpp.8AB8664D31F55915.idx delete mode 100644 .cache/clangd/index/window.hpp.E69A5ADAD0A0E8F9.idx delete mode 100644 .cache/clangd/index/workspaces.cpp.EC0CB7DF82BEDBA3.idx delete mode 100644 .cache/clangd/index/workspaces.hpp.0FDE443B68162423.idx diff --git a/.cache/clangd/index/ALabel.cpp.09E9F4748A3CBF6C.idx b/.cache/clangd/index/ALabel.cpp.09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79E6793B0ABDDC.idx deleted file mode 100644 index c782cda4988b99322fe60e0a6a72ab6213ae373f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3206 zcmYM030M=?7RQH>3|VGE5(6Yb2#G-U4I)ceLI7E05l~1Nl*b}f%p$V*;sSm8tou^; zwSu^7MSUtoTu`jFRX;73D%Pcpc^yS8KT5=Lr*-@ZW;1%g zKX}>H=yA%@YtPph4X0WQ=2qP(nEJf7FJ`L58a4ln$Bmk(uCJVLmWIE)XX53rd?oBU zx>57>?#Eq))w8GdrXH}gZmH$W+uYMHd4A=8!ebSV%YPO9l~;Tx`WKVWoV}&bSKnwq z`Jm}u`5$k8T3}ta-;1MGUTa&n^Zm^3mgb+YMl>Fp#=T(_M?DMfW#hu&(^Gm3o8I2O zSULN7(3}iaz&%;Xm*4m0bX@px>0jEV?~n9;=kBGb*>Z2jy$jZt8wV(uN5HWR2Q9O0 z+{|>c{HJ$!6J||H{dV3cdtLPCJtd!qF`h_IRy9_(G;X8e|U-g)L~7 z2sYHuAa7j|X6k-Ae%E)8_q4TF>~G*4Ue)S_J?UK1RMoz2?$vrla>+`)M)RO0r)%o* zfHL>j=URFf)gDT6Oun5z`q_^C=I)?l9Synb@#*hNG%>?+cU^3`#F|m^^uT7`@HeE@ zMHNf0>C^T%WlFZs8G5U(?ga7T+jEB2s=Z79yr)xLpO%{D|E|yf&D!*VwHqXUKXshz z-E`p5=8>CUT%Bm_P@CGn#_sH$)s*%4q?f9mwUsxfys2@;+B*yA*8|W4_uG-(Zeg#Q zR{hR@w&DrafR61LX&?8)Sk|_}A*M;U=dVK2&-QmYcXYPTdSs8E{{7QvG84~O*(8CwdUbh zrL7@H+vC5L^TB*+K-Ri_^6lpMcHD=u;xmV|qgWnM>g|=(B-g$W2xrfq zu->rw{-#vodeBJT>7>!cfeSkD{VL!3Rl^5n36?N_pV*n~96`=`dAwz9!PyUwhyma8 z*26oIs%iET#0^2%|LysHTB30)k7O=I2q(?Swy-_fJ_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1)53VjKm0U#2cP_ z)4kakA*2W~xV0$3Km%fc=LW6;uKIFHIXtPRR0Exe)1!MJgK;RbeG%;9O8fysC~F+3 zu7{!1$LaT^>R9t$r=;7JGEK~ZlxcdPjb;NnXb#R`hjpnphgnGf*ks?7U4C}{?QR7u zk|;`)4t81S9j+GJ-x2Zb%KK?Gux7L(S_L1VARYQ(9zW03iTGCE$}(HA>%WVt%F-$g z{B)$0E0gc{+>P|<= TG_Gfs4~NChEKVPtk&XNfhRExb diff --git a/.cache/clangd/index/AModule.hpp.D8753B04060BBA88.idx b/.cache/clangd/index/AModule.hpp.D8753B04060BBA88.idx deleted file mode 100644 index 89805e901843f756a5e62f3548a9bbe530f5a76b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1730 zcmYL}drVVT9LH}Dl+xa3TYB5l7t$6GVlc6ok*G`%6kl_lk8Mmhz+#wo3oUF`w?C%U zB@>9q#$+gtiLyXcHVrbye3T7e_`n(Gbi5LnhKvrK#5Nk-IakkZlYVp0`JCVRo!)-# zb>`>gb;S@w&c^($ZdZ9>G(iwF{Cdkhr78(QaDX7T9;n*4@HPKzZrA;me=arL`ab!C zyxU(zpKsSyuPEKr?9NQgSXcY%kCmE=+Z%SYq=g*QPYUb}g`H=rg4+DR{yN`a z)1EH!1l2cHJOA^i3vPVee>K0xH_$$zfA*vIs%MqFV?*q~mhWXx5DLED;SkAIIy2i14OW9rKrL zRxm&gxlv;@3L$dk&asQWMOlY+AlCF^M@GpiwIVm`YmQ}B+vE(OV7*$c)(9c;v|;zD zAjefQKnJ;1ZPf}P@+NcLvJeq|XDC$E+H;!&dR(uk^^xB{^42|F zcyRV}8ITwVhKwO;Aqe>kKO~G~B)oz=nHku_04?lb&=}%{5Ia0x5R|qJRRRw1xPyhY zL^_1d+PBYWt6HuFX3SXyON#ZO{#Pb%PWviYLWb@@JZ}_2f&s z$XfEHr*McQ#ac=vf{t-vwsF_t?!P4zW0ILzEG1lwjKmJYArf%zhnq60Tys{!#TKI_ z6&r{eLH*v4=leVY%$q#DgNnxQ?W~H&3s1SOIO_azP zWFQs~Qe++W48X-uGK$dw9kqi8<0A*ZT?XJVUY9~K3C4uf+NANGdjC)BU>9|)T2&h3J0Xr4Au417S<*h<(7*@z{CLnI$|4jl{%cY1B>W%Ig5CEURVY;uaR1G^l1 z2TPD|STk6H92p0{=Cn2sQ(q6Ke5vOF`Gzfyyhemei7Fk84Ze8u&=#=0s88OmE>I(^he!>xYq6 z`R2}capH2Dr=U#s^96C@R!+~m^OiCpabhC;z%%(Uu%7UGioJ``3q$qdt$~vH^3Ud} ZgsCf(lvAqIETN1bb>xzbTyl}i{{aqF*CPM` diff --git a/.cache/clangd/index/IModule.hpp.E1245342A901572D.idx b/.cache/clangd/index/IModule.hpp.E1245342A901572D.idx deleted file mode 100644 index 0cd620b4b98f7703747b40bbd019c8d09ed25964..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 482 zcmWIYbaT7K$iU#7;#rZKT9U}Zz`(!@#Kk2=nax1@01#KqN&fKVtiR@2&s2`{KA!%% zfdR=Lr_Xq9y>$Kh`4i`Tub%fmr=#a}h2MXTkC)D+^Jl!zY5ICzZGUy~w1!55w!W_0 ziRIH%ol@m^pH)F<5aV9Pf z24)T}4sI|3m;ap;z3b_mp4041jO+}|Y;0`2U;<`7BQs-BYFcq1&}f)T89Bi&gjvkU z2(}Pr4Anu~sx%xC0b=2GNRhuOl!1vZ_BnS+}{h@mJoCs7b+GEA1?VdQOz hpZ5&@GZYsk7mI_u1N9|{$^86&meSXmN7@)!7ywNGiB|vs diff --git a/.cache/clangd/index/backlight.cpp.8F986B9BECE3CA9B.idx b/.cache/clangd/index/backlight.cpp.8F986B9BECE3CA9B.idx deleted file mode 100644 index 99750d6c12bb86b1c93034b38e3bd765f6f71bb4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5394 zcmYLM2|U!>7oRi6jO90G!3=Px1YRT6F5UiCk}>6v^!zQ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NRm&z9W7 zZvQ;Mzz$aq$A}2m54Xe{501d9)&�sGWL1y9XvRP())8M5it?s8&pBSuTmIRdtTf5G~gWBl%; z9Gn({dm+pi@51opR14M~d0%Dam`MThb0+3YYXAKE0S&)QA$3=p{#e{+O`kOz8-Qtn zGq1^f9XsQnqallVP2CTR^p67um<2fCGVNKWxJ(pihS#edjN=ed2#(u8rwz=<-Egfj zD>9RHx*d(CauGqE0s0w`8E^cMTn|e1pe6TT_jg^dtmB{Gp4>*`jsoK-5I4U1*Qh!K z_#vSl9P7cQL)yXc8ZCYa+PhS7DLNs~GtZlu8 zWMVMxVP@SJuN#cKAWTlSrq*ETR1+T(K3GyGky-!e-2Y6Lm*An zZuK9nI`WH5N_s|SR%+TpT8e~AOZz#DPfJJ*#cA-IIWSdqf|`$$_askaHxqYjZBq|3 z`^kE?`XW0=1EYzW8oDm(I#V3Hw4BWiU9Bu_EL3I+e5d;bPE(dvq|37v2$qbL9Frld S#F-`Jb9n*z{y{Tl)BX>(deA!n diff --git a/.cache/clangd/index/backlight.hpp.0EF1448C3968172E.idx b/.cache/clangd/index/backlight.hpp.0EF1448C3968172E.idx deleted file mode 100644 index 70c3018bca32f25fb5a88850f9d31a0ed8d7205c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2104 zcmYk52~ZPP9L6^5}dcFr>- z^(1ea=k+jSYFBHBJ#X;axTVhhyAQqBtC(0ac<)))nS}Z;ax$YUPfoZoC(gUSB`M>X zzVUHv=8L{Pkx!mC$8)EnAJ==2oCrH?G{oknl=Y3>FYfxp5>z~5yZCuA;eCWXIICo^ zsIq3C?8^}S+QV0-Sm?x;hNj%MQf5;1_1cgFb%wgC$}_9)4EVYoXqdVFsL!F>b4oVv ztx4w!b7GsT62CEh7uYlHWS_NeV3kvEg*oY2=uV&LGRb$77kTU zD9b4|XU3n)+A~;lHJ&Rf@6{<|3X2<8j@`aCt?Z}c%+#MrGA?I!*vPPA!A@n1_U@6A z;{6TP&pS2@9m-A3nmn`Q;OmwrrX3B#YyPYry*xH^t7`B;YVEbJ)&(zWlRf=mWn`w}1WK&GRxECDAv-j{8Lbe?hWZO4t}tard(2*Y zTs94SkRM@)m@J6sf6!$5H?U_Ql?ERE1T--wjUb|*Y=5%}JZ;jcfS+ajOfZlRl z&slP(QF5Llbf^P*R&NpnbpS{RnH+VXdgHd0O((1)4DiJ(_>=xnT%mU0iGSGMUJCN1FujqQGIEC|5$7GRNz_4R4Vr%nZ*^3?(-)FF2#cSaD0-`#eu^HIVq z8W>Oq!j0jR1rhzD+kEo5?~`g6puzilupUOyKUO8Zbj(GSOam=i-<$DP3nKbwt`9}` z!Pg%$z=-R0tjVvgu&pg{F@gWXRM(I1K~o7zT9uXQ23#y=kcDUwpX z!@!IG=(NAbqF%WWCj5qyR4U(j<7L8v_@>}p3L1E$JtDP{K7xpQHW={%+zz}x|hLhoN`C^s- zxwq*(-)0A*>^l8u{6x0XkZAfS6(ebRV zRt_bBv7t|9r|tTijrqxWiiXXW0GXBtbKoBa&(A_a)978w95UQd-e)UWF RKl@0=P32C}t_0;U{|91B|BL_t diff --git a/.cache/clangd/index/bar.cpp.499C72A404C3B6E0.idx b/.cache/clangd/index/bar.cpp.499C72A404C3B6E0.idx deleted file mode 100644 index f9ba27979fa4b04752df346b68851a4f43c103f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11056 zcmZ`8!N=9zPz^PFcrpT-Oc479Y7lk=N1WcA{?p|hx* zoSX{$TM@ckIv*Zvl;z}Br|g_CYe}`cpl#&jGojBt$D1F2S+T&T6$M$AZ8>H<>SE{b z`)|?H|HSH^+}rg{Lafk(S3`XUwA_0dzki-2a#_Y#<%g?}k14-nXD3({{gSuqbIVE7 z4>#YnC@o$0aCJ@8!+-M+{4n|*uG$u?v;(>vQM7v7`5MIiTX~1UCz4SRbS;gRX>~6I(g=6OHO}C8XbLI zvijgKpXzmPTbqLh>b(3O{`Pr4e*H`rqgO34Zv3k^(9Y7G9;6f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&^J@KELVm5auA#d;q3st${|8{ zI{+t5RN=K9oHS8|y5!r1Ne>47Gd-;*ZUrZikv|rCx#mBJw*biwA=N{u?~nHV=E{FX z+5q7Rp-+fX=ZLiW(DEt&Kv%XOdGANQtPS%#!79;o40>Sg9|k?Jn*$7b;6Mo&^uVed3VLA03k5wetzysv ztIROyq4TQc`pD2HyC7fueBs3cCk#*Fdf zEnKu9WZwL_atqn_KmS7h`yeMb|JTPwzdp|W^>N;>j|+Z%oV|F?qDk;LZv1#OSX)OD z=o#SPXYFI->tfhxn}>y!iN2nxx2~~Qe}97kc9sL3o%-2pjno)2bl8|6 gaUV6TtitDb3PeesDyplF(i91V!CTSru_H$R4-3hwlK=n! diff --git a/.cache/clangd/index/bar.hpp.548C657FFF81C379.idx b/.cache/clangd/index/bar.hpp.548C657FFF81C379.idx deleted file mode 100644 index 7a342570df838745336e39c6c675faebf767d826..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3490 zcmYk9d0Z3M7RM(y2?Jp=cajhicA~6eAO<0#Yznf7AdmzXT+kJML(t}C;pPrPMfT78Q5Rct6uoBQV;S#af7 zr>6E8n>+RU)Xj#5j6Df+UVn1)>}Awey!(GCu~|L)E7nx~^6B0MTiFu_+WOU`NvpQK zK7F-?eiVr_A1u$EWi}YLCCrQM*Z2IrM9-3-vI0%w%91l(W|k=%KdB!cTo+j2vRXec z=i)2BzP5%Gp#93BT??aA~3JZ9>_mf&1E*Tst+#Q2ED!lAG6WZc_y(d#^oiKe+3LtMjHgYkx`4 zlv@vUgsu-eMpsuiTg>P5TZ?0I?q9o+vE|5$>G7i)?s&EDN{KbLOk^r_>e0Jq<=4A< z>@ubd+fbYI`*)4GQA4aH!-^-}E${ewaKW28OWxi=et5(nMeNg zqO8dMcF4n^r?umCud7d#UiA&1zW+z2;?%jTg@5T1hAlKuCDV$=40oU?#ccM8W_n2= zhXQ-SgN6?d!681BBmd~(!&IktlNo_rk+c_ugHRA7i0G?(|9CNG89vG(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DxJIqa1ChG}z z!R4V#Fbg5iSVC0@d887E!U^FC3aeFG+!-9_6z95X!;J7HM~}{j(`YeUEDVl!j8_t* z!gQXegrE@e_^kSFX4>fI^24wat(!KG@Dp4fo*O>k5<;GpgpLsMXxwuB;GlpFi?+ht z(16e$J52AqYsO?fhEV0A@*t>$9pC{;xF|sa4+#b#70*CIJqUT^5y-(@9&LnZ5b_)& z_=1p!)gsx&8D*z1ZI$&CmCTEggm(J485g)*=%~p zpTGdC5l&!$4b&cBHxi0LA)Z~WCiycO>z2x4uV}3b&Oe{R67GfjW>fX(Ua)K^332W#NbM_>mbPddUj*ef1v1ZCjz z9DDPDToCfuqKfk;jP3%zcFC(s-JWC!l%zOb7QeW6{<9e#)^NX);(wHU&i^oW<>mbc wN7aoBv&I+BbyBG{E?QR|tE5UaC4THJz9L2dC+W3IG5A diff --git a/.cache/clangd/index/battery.cpp.C1194A004F38A6C5.idx b/.cache/clangd/index/battery.cpp.C1194A004F38A6C5.idx deleted file mode 100644 index 72b2fed76eb57fa05079941546c3c5f580a3af54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5698 zcmYLN2Ut|s65csnma=zQb{BSGcWJu|3(|{N=m;oa2jv2yKtK=$6;QAXq6VTM9jSul zMI@RRja_0OFB*-S7&~@jMU5?rHE)i2=J9>ZoO92dHZ$j+nVlFJ5iwlGN zPhogGo)G`@@^fcI=<#?#hCE(j^O8wPvo{Vm{c~LWpXq;edimUcJXz@^(yo)a78#D( zxzGJ*@@mf0!tyuYC40Yn-{>-n+k<#b7`JvaIjm>^y? zxGfjY^rZQZ_*v_9VB!m}+$!6so68>kRJb8^vsa0d*`+E@D1Lbg8NqAU)n+z$Y@WKZ{^8^mlhXtDK9MgvP#!quUq?Fc#y(rKCt^{=TQj4L#ACd{{?M=9PTsXRbWJLko@icsuw-29QNHKr z_Hy2IUe1FhPQMC%x9`*Y(qwN(?VzNezOo&4#i97jL9t~~L)p_APeyMYY>>74(TuZ_ zirT&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qQao`O~bwgw~jN6g>uaN1lFW<%w zYL#03@0_5CFTa`dfld;O)i_C(uKQGM=^6j8(qi%1I24m%G;{LqAQ8Kkx!g1+cBB4{J#pNd6d zjLM^xBFnu2mp9<^om)(s*X=KY^_c$!ZHg4Ztps!bRx+xUj5(aYW}zZ*_(XEywX0qBfuKFoZ>Zk2M6{O3 zPcBXx;jt*}3VxU`o-aEcm}myuf&;OeZ+gffz;04 zb13@(_#eRRQxT6bK}KYl+R!xhc6KxhSJEA4Lp^#*W!7(%AK?BmjL-Bm=eiYOm$ zjQ(QI+B>fh(5xA2oNv#!$0DN`42!|y(ZO9=6Pv7Jp7S>JLZY!+??N^nnD9v35ZKTHqh7``K@j|@UiwK0-VJ1 zSv;gzBgWj*+T0q`SX)C|1oR+X(2zHoW6X#8A9#tgbt0YFr=Ljh<^BEp2#eX1@EutF z^>$~;$+oc@DU@rKLlDZfQAo=`TLwdTx#_b~@Mj`kUhZdk8rq1XcYJa*dXm@yN0{{@e} B+xY+h diff --git a/.cache/clangd/index/battery.hpp.A5CF2192CCD687A2.idx b/.cache/clangd/index/battery.hpp.A5CF2192CCD687A2.idx deleted file mode 100644 index b182c02d446b2968a4420d5a0d44d8587f8498a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1704 zcmYL~4@?tR7{KpdOM5NXYXu8O0b6KGue7CQGP9{6E))hLZv0t-%9tQbWk3SO@y84u zRB$t(U_c=X!pIV2aYG$rAO^w6m;ss0gntg1LnJPd5jJ6)WA6^%@sfV|zWnZc_r1H{ zrEyUa5tl?57M2!Okd>a7BE&FE27ivc+`|lxVRHb(3NBPsw`ccj6lH~VR|1BfT7C&U zl3_}>A9Tbeo~7|qIa5rANEaPie9SQ1b^6E-XG)4DW%$JYPbB1>o+Rh%RnBPV z^mo65kV8!^``rj<$oKDgowCd&9W9@d2Z$aWOe`X%c9q7st;{Qnu2(e7sU`~R%n`*s z*E=j#?c4X>esfhZe_Zo?Z~Tq+{?Yck@?)VP15bKyRff{{uZWVXI_-U1x5hQJNQYYL z?x+@B#fvk3tv)%krGkv5FwN6^5=zcRtt2H* zmp-(2Zrf* z?4M`ljr7>P>=#y9vJiI^W~Da6XSMCXK!w9PzeoYWCX8Ub7%dktf_<=XZ66+a<|kkV z#Q^uk2wFtTxPVF4I8NZ9WpAsS798(Wz!UCZp)Fc2@H^NeA2vCEE2&lj5#(yMn&AS^ zBmJc360T)*P(TT}fi~#4!1J9&&p-XRO$fOcN`gWfgIPcP4@=R`!bd&pi#e{&2Is35n|wjeI>e7U|q>RZFRI0ZZ) zH_;}B3p{`M@?P>cgEucLfIGUs)}~#bZ}p#R&f&)0Ur;~@`^~i3#09=TH~mA09-8X9 zFyz&o>KTrc1S4jozSXJr{I25HU}+Yc$>5q_BL$65vjileR;f3^YvhbONf<>&DN-Dl za%v-^1yasrl3?E^Nq7sqrATFXCF?OV7nZEHNK{y|mLe}<$x0b73Gc~DS5&&d4V5Zy zlF-VuZ~z^n3nB@I5*dj|CF`0i#>XgAbt%Oxc5;npHV=xh{L?R0%oWSrP9%>pM z#Fdf3g8-utnT$&a)?g$q9Dud9eEIf#LhK7CfVX~28wqdiu2Ug-VGDcAvkgZ#f8N`B z0zNcVpvu~oxP=;Rz8`=K3AITb-uA4taL>$zN=S7wof{Gx_Oe1Fk73FBi?qdYg4GpS z3Ws48{jn`~UyitY0B%Kl(!R)1*vq+Y*st7?d%%&;CPcqSOmfUlW>n%TS4c@2C6-_k7OX82B^V}OPZjH_>v~G9 Rr_%M5{r7pb#3;eA{{b`Xq>}&u diff --git a/.cache/clangd/index/clara.hpp.37039B002C851AB7.idx b/.cache/clangd/index/clara.hpp.37039B002C851AB7.idx deleted file mode 100644 index 01026915693de5844b933966ad2224897c16e282..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30604 zcmb_lhg(%g)938zz=exkdQrM!$KFefy&Jo+Mtu`wi6xd8BdCCaii(O@fS?H2u*8BL zK@kNNi3My}upk!HC@T8R?A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HU)tegLFI z$(~WNuXZ^G4ghu`24p2m9g^t|I7W4gQ9VAJZ^ppJWVc~xmta`Kiu%3f_vj=p;Tn~2 zEuj>469%MIa`u(f3S3Ma7ZYrqwWRu5syA~;P!7RCoJShw5p=9wBG#9PJun5NQvpH0 z<`dHP3HctFr$l*5Y_;n&u>aT<8ehyeXJED1Vrwyd{I6s1|6-%v{9vJ-Y3m7^(WK#R zEi|0Go}ht}^aL$5K?4_AXveR5g65yp0s$?w5KcWoW3*^H3k}+)CuoOZTF`}sX2WSQ z4i*}teUpXeJJ#x>OXvxjg`)Y~Ei^{k8dzvfN$qVG+GpztS`D?bEVOUY6SP7#Q@}!J zW=tP9gWk8l%Y6SE-dD5x8-C9>eA+jB>Not(Z}^mN_+-vv;N@|F@4^--JHfxSi`xTs P^$u<~I0-FwRLT7xaofoO diff --git a/.cache/clangd/index/client.cpp.142786E5739C6086.idx b/.cache/clangd/index/client.cpp.142786E5739C6086.idx deleted file mode 100644 index 37c6e6aab07f00cb8525460edeb8bcda4f102967..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3324 zcmYLL2~?BU63z_?N&fs~fe;8`2>}!VWfe_8kgyY30;c&@77ZYZf+Qgd2twHeseo9l z;98&JLq*&bA5baOts?IFidC#u#ieezyjtW#i?#!K;Z%*PP!@@>z5-B(> zGA}DVcL9Y&BALKXm#bYYHzJWD=_FF#<_e`^*)LMwyV#~b4@EcLm#vs*Qca7J2`4)` zf9>_oR8nitKV56Rx-sDP-BmVW#?<4g((P}G9(^d3d|FB>?@-U%GZgml$PXvGjV~2h z`L7(#@sb+_ZXR8V-Y?kjO;^s1({)$v7JCqRnr8p}pi4jYhzdt~72hszX!Rrhsu*4U zs?Wx_+af0RfX8&kgu|j&F~2$Hjy`tW+HprGtnJe9-0!%2Gn(O^U6!_LX#m@5I#w1c zomIAII=%DL+MtGNVMyJuhgIxfr*xZa!*hMMw%i$LwOCy?R5c;C?8C;6h)TtD?dXZ( zinydneNH{ris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Y2v{NSSm|QV&w_U F{{iVbf5-p; diff --git a/.cache/clangd/index/clock.cpp.622BF041106573C2.idx b/.cache/clangd/index/clock.cpp.622BF041106573C2.idx deleted file mode 100644 index f3d91abde97b6acdf0c9b6eff3dc3fde49e659cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4824 zcmYKh2Ut@{GaDX>Brk;kc?1$jXwo~VxrqAro%{Pado$HB9$Je0`Z=8C6;J7$yZ0Z7xR@(Ofagw>LkLw1H zV|q1s{xd$O?#%$_MD4CcTT0K`jD4=oy56Eac6FlJ?cSEv#q=NtjgQxdyPw}IPc85* zN#5mud0ovptKY3uAtJLi6P!AckzwQ8@=XFW;jJNsF z_I>`(uU$&#UQHPEITAF)cX+E#l2j}7zBO2wOj2dhr7OYiF3FGI<<`SPSR1W;Q!KvxU)b$Ta?9l6# z)_dP{-0o}{GBi}PIGVIxtm$y|w+%|swJ)B}S1#B8>+M@BHpA~+TIh{~;b$K=+_GQv z?&IigtM0~tzo=2gCd~Q#i{mAy2Huuz^O<8>|0|bu)nUvNAItV<+;BZ>(&KAk&R)q_ zKXxy7^$9%d!6MC*X@@sw|FyIHZq@~#o{15cm-)V*Pgm1LZC58>3R{x>+kNY;?pU;X z7sr>gH!Pe%40NqHy>XU~!_3%Yc?Y*Du6pD%=qWx_pBgy2xABf@rBo7Lyg7eizAVaP zWX=&)-Q+66&6mvkEYWs940Ui6yHYq(MHD%@;dta(}bJ)eu$ zQo^j4Hv4AP7aw1C^qBXriW!xaN*3h72cJ$xdUa0DsU5mUo%go-b29BfjY6l?)ti_%Ga{>scTW!cM6G+o**=zVSN}w}zgx!g z2Ps24%-S+S>T8=myu$4Ujc#s8jtnoV5-Px1ZZv7pqC{rjhdUrK0g(@|72^)JT; zZ|dt;Iy$>mMg6hk&_w&7*+}&-w{|N0to_TF`suwV`%EltetGAHpC_UzX<11z>4-vc zd1SHBtW-LUNu5ujkd27ehy-6J3PoPx@QbqOoiuKG@`y`a5=$Zb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ipa4^gp+j;GtMXu z?kdSBi8B?n^*z}G;dS^JL&reTs^}_=g;;DEOy=cNQwTk)c$kB|qKFzU$Xdz}HVrU$u z#8fYwz|pGa^M`$1ix)BrfD=VULCTd>B_cFAMVVTeE!F&~be-0aXklfT>kasmd-?LG Z_O1^;T4g8_TS&|a@#`tkYt!Pj`9ELwhj9P^ diff --git a/.cache/clangd/index/common.cpp.8896DC31B9E7EE81.idx b/.cache/clangd/index/common.cpp.8896DC31B9E7EE81.idx deleted file mode 100644 index 979dd505d75ef2854733a6c0de076c76256455c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2080 zcmX|B30M=?77mk@WU@>M84`j?AR&Y;1R^_vpeTw`5y%)<1gc^|Na%ZjY?Y#-$WuXm zD1u8x*=$9j8U!sGDGDwih_Z-a#Xc))0a>2ZUVKmI`{vH~fB!xI`R}>sOlVMGpcw^+ z3y2O%j*Cf(B;as3I(T(S+AUl>4mUu?;gXBf!y~snabmTF6iuHwX4{+-U%BTdd5OQd zgT&@L=l2FJ8_%__EB?W5X1x9@=g~}$H+>P{Jumphkm=ft1`FP9myGM(ncO7m`&20B^mC5 z$@q`_{mFxq&+xpRL%GBC%NuSX7W>ZLobmbg^o9Z9gULjeg$w%52@cFh#}!WJsrzz* z%db}jE3!%qj>b{WGef--UaV|=H!b@wLv8w|kA8g&O`rA8_DkP1rY%#ob&Mama=;_bG*3qyqUiJpXFl(dclz-yG z+8^73(FfY>ePg6=^WOf0cJtm!OT@h7_zwAR8vZZo1s6xk_lK8VN_)ZUFvyQd!y_v+ zvA1p?-`JX(jf6XVt z{gnA z?|$E-y3cKR%Ei<>z;0vcl{OdW?S9p(dCRd++Vd0eEZjY3SxfKoLp5(T z@w~%wg~~A6u%S3?O>|ddVv`Pzt2$XxB}J=tT_`{GZs}HJJH5|WKDD4@&!L}66p=q} z%iKg#=ITUpU*N*rxEGS8$W=5TN^myv7@7FP(jHPz@!qd6ybt!Qhv%r+78hv@} z1%v0gP{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x77Vu`SrhF_{+ER zZ%h7Vn$vK^sJJpWNr{nx!DOGkq>#&_bz)46B0z5g0ka^JAS(k0C_sQ9<@?vuPu}WX z6JX+n$%|=;nZV^cdKPzXWu2GL$0Q)az$~RDWeO(X@^kjMKDc==R6~G?AEsYIOTr8; ze>AE!ZkF4%mF!H6!VJv(Z2X*Hf`JoaKO-~a#WR~eU8}R6E5IZKGeMYLm=|uswE_<1 zHvLUm0!(}`d2uaqQ@H%SnqN%vhfZGQV-f_qP)1Bf7EHk9zwP~ZYWMQ66mcd|pu7;1 z5Hpy7%NM1l6AE*JRiF4iuCTR|@eHQhzbgh7~9%!7jlI zG>u(~H|2u1&c&D=yo@}|G8{6Zuy_C(4hnx*urqRjgM0G4YU8d02U>xO1=R$#VSx@* z3<~VkubV3)AI|Ax23p51&I7bXSV975i?EagEcltZz`+jG4vc&rW+7%Fwo|K%q6^t~ z9|xMrFU&6qiw2;Xpx}pvI*km|O@Z2ZG6bV;z%(#JY{9T--dYZ0sDITudwstO$8vu7&{s DsOkkm diff --git a/.cache/clangd/index/custom.cpp.EA9CE9AF81C1E5D4.idx b/.cache/clangd/index/custom.cpp.EA9CE9AF81C1E5D4.idx deleted file mode 100644 index 17765069753c33553cfbe832fa938bd6e49f04f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4732 zcmYLM3s_S}7S0KmBqTRa@*s%>2pEI_;U%Dg5JjzEp`Zv{1eKQpq6>(n2tGitV2iYf zU0P5UR1^iV6+tMEA|kX{s9UXKUEf-)%Idl!N{r3kN9r=Eg$Lmh7Vr2cQ!8J*3_hy z=hWJryuvpNswH1aW}R5<^nv9puca?qu6Ku6&*!e6ZhiXxD3sX&&X|sch&GGB@?FK?03H5>vFqF?R0fAs?*YF92i!Zqd*;5W!Zk$x+w9%--DRyEmwAQXosXSZG+}W4 zsqmFee(#KzPwwts7O+>gvitF>=_e*%tf|?*q_xqmIwaxUk9>1?#rTKQ4XVCH)F z!1L_S~>3s*9wozv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2F4DF290D9AA1.idx deleted file mode 100644 index 577765f0cbcc915e74477c2a1cb397e5c0942530..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1720 zcmYk74^R|U9LM+G9lQhf_7?6B+&}KPs_Pdy{hcWdhCGAggO-ZpkFZrszboeBjcWo^3=QP!HuAz!* z?N~6iJ8pSs&jJW{*T=Mc2k(knFfs;4MFTZ*Ljy_DbHr@3>Zd z_KB2}e{UT&)!UlyE^dyPNdNK0@xsTg(@k&IOw}Eoh(CMmfvfG{Ya8!n)lK-76kT>v z&J9IxjKawTSvpS0zF0QSBBc=y4H^!_foe+19V0Z2W%^9^w)=eyQX463)mhDa2wcm| zT6TRX-@qa{86Sj$0t6nGELm>&<~cWuG=%$Of5yYtrc_{iWetn`3D;t+Lg10HrM?B# zqliHa+~2G-2lL_K&Ckpk7}8#6kPf&_Z8Pv8@aXr7zDxJ5En!dqaJ^1%;zQsu<^S~L z6<5w-kRG^EXSDDk@Mqs?IONW68e&i&@DN={7#{*pq;RO?^VoC-A>hHfU?U#_FQn!c zT&=yE%^(HvP+h2*4-dan{iOb2cpr-lWdAH?WdeWe{I1Hc?4LHWNJ6*@s{#dH(bnA? z(>gnlMJ(YOtnr-RuED{$;U?_IA}_*~Sm}8_O^2SJ{7~dvgpnwi!n8L{^FjGMdj29T zYUyK7eA$~<%b+0GfkkIA@*%9?ob7G%pSR5S8Kebn&>2j82>g6|H|j6w#Vk^h6{xXV zCGdfSG~ETw`?-P0M7SKu#R4Cc?_5>i!){`b80I(WOd)&-{EGX=*w{5kof?VAc#uUZ zaECq5Y5bq*A|KvxBDTnv7n*nsl=Ih`aNwiN4OixgXl#{Q1Bk^yIeWuqq=k}`l{gAh zae_w9Cp`Yw}~Z*`re7Mp~uTOmqXvxkl`Ql2dD`&%E{`J6nTk z%qSTx%>g-<_EzB^`>QJze-tk@g=h!;|s= diff --git a/.cache/clangd/index/disk.cpp.1F7580C201D672A2.idx b/.cache/clangd/index/disk.cpp.1F7580C201D672A2.idx deleted file mode 100644 index b5c499e9b9b886a69e4abecc68594fe3720035ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1998 zcmZvcc~n!^7KcN)2}!sYNEiczKp+BPNJ1DRWPlKXKp-;Y8m!6?Xi*e_=Yldgfhdnh zwaOC|Efr+82yH!xK{huJ8Ru1b6#(I8=o@R)1ls! zFY5c3FQm<1TK6YinMNHPADv(Sv&Fk2w2K*(KGOMi_06i02j*&34nuU4OWn(-A?4w> zzBevS{^w}x+@K68uMXt=I2%Y44sR5cwzhrXWVKn=9i#Q<{V;dJ^jY7mdkp=m-?`y? ztqHNOt{?7{+m^dj_NELR-aWm;c1QVS22FmYVW~yn^yX#qP|ML>**kKVqpmLTo6;=# z^HXWfap8=4k52%D$-#``VZKEjG>> zTGX$|M{AC^Fnb8iqq;ZW@62!?S36JO+L!cNa^{L&?Hm11-xEQXy?6e#H8Szct(m6t z&?1iPC2U$tV?-CuCsNQq(h^6GF3h!%R$Y7~59{$?4AsScoZoq}mg~el)u$MCEU3q1 zOT|CUMDp?u71N>~Y_4)zusby{$0WDX2G8y)secsmda7o^FX{R~#iN|!6L;9#EXz6@ zQ(Op+der3(qPZfJy@1RgF1aCHRC$>G9J0TIbR<2Z_D%FQNfYhQ?w?dp^{F<|Z#$#z z^fkpCELu>AH+`N{?tnT?zDHntuZf-h0QLzhlh}Sx<9Ub z8J*aFo7Huosd)W$`Pa=oHFn|oYsKreZSRtPxit{=CYz7M%#R(pecf$Zn0fr<(Ka3@*Pt_kr|;acpIyInl1D{7LuTO11gyN`c5~ zY`gU}-;hE@FmX(@$A-L&*uDnXZNN{qBr}xyI{L`p{&aOx#ss)e+DRinymM(JV_}p9vGib6hLyp( z-$u0i1??t*MFBye52Hd;p%o=7MR`{-EC7ogoNlqsL)tw;$Y@zT0(ig0rC*A1R{)*Ad;?=vO-mL znYLZCQHQ9@?M-brn@@fZ!>9-1VF06^h$o;I;sxl9cmw(%K7f3L4;X+107?)E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$C{Fex2SXjaDPk0-@oA8s z?oEe(rhqAe#`&-UP@L_;=Ak&piQ|sqJZByk7G?82P+aIG^aIVVV#p@pNchkfcPZqQ zImy6N?kopS+ynPUaiy;^DD6V!`M14g8$l$EOrxdG@}@3lR>uJ)V`QqTa}dedZqfl% zhRLWKw9DQHW{w!Z7KqkFMgjNh{21flfHu$&q7-EF$wH9LrNE+eE*+5R!Sn*bJQfHL za)i9^{#nyrS|_^!3E3E%T69|WP4C0(CP=77)3PeoOeQ52T2BDQ8MsTSsG;9-E;kV(V`enqR)}1RUxt+ytiOwVod5^;{iuvvHP_x zqM7eC)M4PPWGEdPbmH3E>4ye@CQ*{C8?UumDVF%45Nm`PQCs%d>Q>p7E*=swCZ@J+ zb9-%Lq2iJeTo=_fKyX9U5YQMk1~f%Y0nJb|Kr7S=kbyD)?NNI`C)5eh4Rr(LqFg{P z)Cq zVmkaYMNBb*vjSLw&rlgJ^P`(d}&s#jSER02c*D_bIb^YUEpgfF6{cUbs^r1fTDx=W{ zCSa9fQtJHMV^Zf|x-Y@SqHUrL_aTW(TAU*nC6}N|&PZImm({AZYASp+aAJSlVT;Wt zN;P5$v5S`fJ!>#IWp;1OZ_bw ze%`^>zOD`;u7{_anT!%D4U1lGx`a&B(>Fl1Nt(J^h>nTj3aYUY78xHN6A?xD6E(3h A=>Px# diff --git a/.cache/clangd/index/factory.hpp.2AEC37A00908E370.idx b/.cache/clangd/index/factory.hpp.2AEC37A00908E370.idx deleted file mode 100644 index 330bbbae66fa651d2529daf66b2f3090d4257bb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 904 zcmWIYbaQK9W?*nm@vO*AElFfyU|`?{;^LB`%-DbFCz$;nu^Ai+m~xwca@g7{S1q_FIR5|Gt9x@#3oExM@5{B^uN1paH*Tu?H{At1?AzI+wy$E(cHKLl`%RhYl-W|5 zL6%vX{)_zjY7Wf2zEa5#D0I4kc-?S){5O zyJ51+HnD)|!B#S64pGu;DmdlZvlEs-*%|NbuC3baTw17otcNvA`_+=_if_T+{!d?1Fq7hnF;{Kw3$$IlqQN!+{4P+Xatvbd(lOcx9c2l7hsZ> z1#*Fa)tcK{lz{^jP(Wa>yX=avet0B16Qc|Rs|A|{FPLE9gvc|pGG@xp@4q-pY!)9A zvn&Ivy{Nqmn1Gv5Y5eQ=Q>CdF_?Vc0@^+$jl3)TZzrg97kLbQxpTw9LVJ@&@vf_lx z7p0~Z&jh&y>QY8dunS=hW8wlkh=&!VDVWoBZ*HnUA0rQ|wW75;%xR2VU?-Kb_rGz< zz0Su3R4ia6%)@HOVaE+~9#9R)ZIkC!8+RQz&UD1r$}?@%BNV=yqVBbWjR brVxV3g<$d^n1TqV6oSc#V6q{Y{0Jrh89dNC diff --git a/.cache/clangd/index/format.hpp.A472BFB350A64B30.idx b/.cache/clangd/index/format.hpp.A472BFB350A64B30.idx deleted file mode 100644 index c466d85fd1d2e778f6ae4d6593714c58bc24e7dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 964 zcmYL{Z%9*77{>4Jx!rlsj(2}_bC_B=7s_gD2DZ_3St%~(GOeVjNY@liEw&X_WFNAE zL_d@bOwGVF38BC;DowF36;c!!)dwreD59i7L;7RyPTqClJoj>*m*?E~{hcCLZtfsr zn00$xbv3?VDaSBOG^{|-U)c=r30QUQ1x?wwVFk$v#3~n`9U{BDA>*?=G#e;u6aGkm_2dEfD8WDZB4$UCpEeWSKGas~=B9`Fah@nUQLaZCN( zjW}?qrfjW@VRk;>@$x(GO%d5>1%t2(YpF0%;opa+%2nChG1GNSWC_n8jY6ZO67f&= z{4DEwUDPMCO7LTFjFL*kZ>oGd9Wy*`SFr;4x;R||m56`l;=NymPJf!nig3Ol3K}XA zKXmlNcDAJ9osPxe^BgZy`R{j(>5e=RHj69^zCuu_s6_m+z|8U%^Wg(3Ru1QzqD?VW zBL1r{osAH)_68ygMKpRX_ zQ&&~;aMPnKmLR9y=_DxIp6#@b)C}k+DrPx?^0oPTg4|j+Xo0o>)T8z2i-nw_8lS2e z3U~vbMi3UTk|2lDp@rg9w^;%N1#-1qhbbO{?1}bd$T1Y8N`w%mWC)5U@hXBcHJQ4- zb=5EYv*lN1P;aoONvv2*84+Y8MzsV;hA9|{2ZG~xImVO*K^CJWttIY4MZG2HVL9Zs zy3;|k+|F}xr*zr%vGuU&&^Z!d)8JkzL4(XNvCupt9x{{UMobA2WY(J(5oAlWr9h|a z-T5#OtH(BMF78a9Y+NJbXulFahzi4#aB-Mof}ue^L29iUqD=9o6p0q}7)AvaDC754 emxgb1!0!#jg+I`ZMsL!m?u>L9$IRdK@b+JBxZpPc diff --git a/.cache/clangd/index/host.cpp.0C1CF26FC798A71A.idx b/.cache/clangd/index/host.cpp.0C1CF26FC798A71A.idx deleted file mode 100644 index f29f9b635674a94d8aff6d76ac7ae5b91a940abe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4080 zcmZ`5cUV*RHusW*jGIA#43e-Rgb_9b1OkXCC_zThTtGlT5J5CSMI%TRP$IPjwM#%n zaXl4V>Z%L}6!lfDR;`N)Esun2^ySy9CW z*+m&d0)fDQzqUxTu)v5wsG|@F#dRgB)WQdHvrDmpSJ?|x0$$*h8`dw_Gjew^sL?xS z^*dTztsnnWx7o&sbexm+rcT#_)x9yW-{AAFe(byAytS-S~jx z=67B%+S1?cGOByw)o}964=uyIH4g3Lk0PVq_l}hs|FwL{FzGjs!ESnY=@>)z@bH9xpb#b5cw;_HGJPmAAPEbR3d*)kBd7JVh>0wgX{u9?7Sz)h7BIYDJmVf5=`%#Cy`kT$o{c@-Lzy@#iu4C2P zW`19|di42g@%Gkz?ypc;*CE91@t!r`r#*Nzzb4w&zha>c-q>@5?&BAHn2E3=H9T_yS7IrxNt6{t-FN1Um^d`?o7wATlJ>ghJ@6t zX)U=QYfGXNn}3{5F-omj@K;hwi0K)rbBo*DAHE#;)+N>SvwgBH6<+j1|7yGbh-4l= zYb9+8c%G-Ps$IS+>x}+?=fd8=Na%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Sx z4q3u>ug4ohL3afbRDn!A%?xb0=h2h}^a{kd0-<&8P79hZP*s5x7MaB$;%qXT-DSHv z=WVWV3urVT4Us28fPQJQ@H}_p;s~G(To_)26>+a{bK_g;6T1{XZJ`-}#9PGx=r#5}%VMYWQA@(62 zP_2$}UUvuQlspStd=GfADcH>WFCK3#sBLV4qf9Kb>0^FY(|vw?8;G=Zw4L^_tF~{o zq@xrh80r_+H`MQA57MYHi?93Kc_Uq_708)Fox&VS-goc*R|=&u zB#tAtfRu3p0Zyk(2mh3q(hQ1NkY)o#EJz2K;hPaWd{Iv8^TlgHLW!V6{BjmzcO$gt z795wEF5|!KJ;-s`sDfg`wK8qMyRfFG)*F@iaHRTDL&mCJZh9`e6AR(iGPEp!u3Fh& z{SDEsJ!gLcJE5OId#OvQ=lGM*&7{j0U&6%%G{N!Xk+IRyt}o+YIavEz!+eqWN#F~? z-_Jjkpvlh9FnpnFHJMs>!%MOOO#Bc$?=heAtgg+EHvj+t diff --git a/.cache/clangd/index/host.hpp.D6E6FF9FFAF571DF.idx b/.cache/clangd/index/host.hpp.D6E6FF9FFAF571DF.idx deleted file mode 100644 index 3d38ae58573fb8663b45953337bb66f04bcd3460..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1978 zcmYL~3s4hR6oxl9Kv=T7#0_~Y2}yV)5iJ55d;kV0N(BXxM{PtI5kWeF%3}noL#>5& zph{t+I<1(hMaPa-9jh`7Dle(jQmGHLRUczqo0? z@0>Vg(~eV>#kW$^??nw)Y`mmd5ofF__b_H|nHd+J-Du4+ow?h(%|F`d{FT+V<=2wV zD;rAM+he7FmnTXOHzcp#F+!!*70+k3kLTanR`W{K$=uacyi_q1Kopkdt!alY zI*pcpb56NI$0D^CG#Cb{WRz;cm2Wu=*VL;M#|~~*GRVb?Abl;qk&Ym6S#8n8wz2jz zERx}THKW!FJf!hX_3?r?5fUWQ5~S2c>gEUp`SyGfDY72wYKz;m=&TGOe1g`johzIW zRS`Gveb@LB25F!IAB#_fBM3YuxSzW)yXppurr>;z;dBCDkuh$|8`{24hTJjNm^D^` zr)lZ+^zkRHG9<@b&d5Clp6+*hY3;2)K4uUL_v>NiJ^otYcUv53R@Dn>P# zzlIu_f3c&MV~`W%>n-~Ejv(Y`rX@W(Vtjf@hCFb-f>BK7SM~cR4G)iMRY-@qJ8~Bb z`TK^slYLF=hLuQ!IgMx+f!kZU{F@iG6w8npbCzK_fgf5QbosBMIXf8S4E1?iydxb! z;6IeVjOShrH8My6++Z<8I)cEPs`lFxJpajOkOa8VVhnQxfp_|BUH39aQ^z1BaFfLp z<_H4s{?RkIqxbSCgH*uH7PHk61U`~>r0>t&5eW?P1ny_?3wH#87i47@dW$EOEFv8W zmh62mm>Ftk#T3b!*mo#WZk7j7q{6HSz?v4hIkfCLHfU=~%qe!FNIINeK#>f~cv7T^ zHYq65Oq&&0<8U&s?Wv({wq`@7!5Q|ipwnT05M!Z8olfTiS<_8{kTu;Lh?OsXt9aN9 zZ-pY=#qN^Ob(i8oZVv226sZnWLoOH0&Bi`}TX_9r*+Y@M=CR6w^6HK`SMfM^B>P)< zI+~@`6zMJTrYX`#;zK8s3(x0e$*SQl4XXj9(QAwl<1~pBskLh10rj+APLT%MAWunP z&G&1=okdW;L`P$*ktH-ygY>>Jm2FdQ#ZQ| z4p+`phEk-;q6&u^=BOi}hIw2RwuneX^48cHF{4FnTh$EhRdPxL?ANG#cGq37x^;S6+n4QU=zTScL3HrEP28A{?uH(JIKR{FW6TJ`cWBG!Gl50&n51vFL;?P zrEMTHBLhe$*Li`=45n!yGlO{=wg()=d*k1eubw~etXam(elGhiyoh=7Xm|zl6wyRM zR&ECWn_gIuS(waE-1zWzxZ(*xP?J;AOZxD;pv>zHF0K^KNZkl#lJWn?{|_mi5X66^ CzWHhZ diff --git a/.cache/clangd/index/idle_inhibitor.cpp.3D718BD05B870FA9.idx b/.cache/clangd/index/idle_inhibitor.cpp.3D718BD05B870FA9.idx deleted file mode 100644 index 37ee31cc035a559a9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zeo+NceJ}x+FG@`-RzM0#MlNs&!UB$&3mjlPY#>8<*m#(E1UT2c-;tzt$&rzVO_Wnq z&MZIOv^Uk*56Be~5mJJMCnF~~9D_Ms_vWSw^Z{kLrMVShp$U`)g(58QfLu_Zm9qE0 zamu~U#{^Vt#BIvMCc+`YJ$YWWao2$ZtsoOzxIJOv33MkYFk!(5GyxQBd!GLKIC=8X zXF$b#e0)NuRu@GVvhO|)cN@E@dDnokK9l0c(Co`nS* z&>~Q%6{Y4Rg3?EEQF5_0hyhJuASOGAfB?3{aO?2n*H!+rursr;GO)tL85n>$4h8@| CN$E-e diff --git a/.cache/clangd/index/ipc.hpp.804BDBBDF260032D.idx b/.cache/clangd/index/ipc.hpp.804BDBBDF260032D.idx deleted file mode 100644 index b15922d2a14892ab203b9d98ea7b3b522bc87507..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1498 zcmYk6e@xV69LGQRcz4_#cRY8;_uzozqy;H0H)1qutmtMUV2*_F7s)TZzzkh?SiqJ* z<-VIT6gi9YlmKABkGt5lH(3F&odA?HJJUB;4@XFgX)|3nPS?E~pLVDI z;L)r?-T4PEJpNOCTaIV`TKVOkr`9dlBStReP1jUaEq$`2k9pJY!+jZw<=VvO@4}Ax z!ER;R2G0)`uTG`&?OHolS!-W9xQTvMsVS6JB5k+46`J6zMD5y@D+!)!t>1XEh9j@; z`8CF5*rnK9+U%;zZHcCPlWgzb%e{YPq-=B~s<6A@-0BYo6XGJxyW1K=YxTZ~tAj^k z&gK2`+Rs_{w8ys;jMUtZIDMw~UqzHYBX%ZwrnBJ4d&_6H_c3lc_Rq&#G21fEzkcJt4vXDFzVuoA18hwO|; zzW>-!1$R3s1R`M|1``k28Bqm|O(D-dIz%A|2@TOu9x~#I1CIHADIu8x{yeLV*aCUT zo)Y)4V!oj{=WPnBkO(7THXbs)plEA3I!b!!6ewi zLq=qTec`>CnQ)#0MZ%x>Qy!f7|JJvv=}^k5u}u{GkDQJ-h zC81^>vZplm1)W%3lQ2gi0Es{nXyn0(FuqIciuY`G_{Mq)CL|;xQ64g)cV9D1F87sE zFe0HPS`!c1_vqgi??|@$KTQE&TWbgjG4haoj~j*C{=RrUGM2J8*-8mD@{pY|(y>46 zR@3h$6@((8R4FYyIDs!eS~xM+LDF3Rcqo{W&=Fk#57`;B7hBUGbdDdVAR*yL{3ISS z!sUF`y#xP4g!2j=cU=gMmDw$9#>!L{>SATy3Qw^zNrjYHnUTUktV}9;a0@FF zONfM(StP8%%9Ig`U}b&?AFwhR#Q0d*@?vSMY-TYlR<^0w5Gxx{42G4hH4xrj@Z!nm zrmzwXF^jRVvZcf_SlKLM2CQrYapzdsg@eoadLHftZr5%%dW$=}QLb$1S$ud1;6E}e BgHr$i diff --git a/.cache/clangd/index/item.cpp.BDF1AC58410539C1.idx b/.cache/clangd/index/item.cpp.BDF1AC58410539C1.idx deleted file mode 100644 index cc3ededd68a1ae68fd692b777a7332dfadf756e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7280 zcmZ{I30RHW7x&rA=~U;uoz6L(PIXFing`93N)xFoR|C4f*IK`|*WOe8e0^gzSS+tO zeyQ;>i)XW0ES3WPrz}pMPq6bup2bQnTp2Pu@rk40W8mRX=hwR{#$@)#m-ilG>z}@r z$ri?*{d7H9G)gjA!->xu`shHW8YP)#u1iboOWUK?CHK_(twNCFHu+cP$BzroXblGP z)h0iyP8s_5xb%eV`$c{KyuY`qV95W%@Fp9B?gLNL?D{?q$#!bV6pwD|8*WhV(R6?s9F#Kx08;Rf|)Z*Q2EwHp>%S0?VD2)?E4USJlOI3eYl5c-)XrMHX9Hi}(|WL3^TWN!jEWY8FAulxy4`&H(YdyohRWU?gSX8` z-1U6QQkQ(RJD555<*Qj8sn!spubS;S&zIA0);IJ|#FZe~t&Xp!Wi9TWA9Cqh!;>(x z`gLngZcni_FHOo#xj+9w!47`OvUs%@b_wd;wlYs@4TM>CffiQ^k`1ySui9GEck;KG zt)}O@<%6yp?DC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5IiR3(7*V_snzg6{B(Z@`aBRW2%Vx%UicrWV@b?M#e(U zLd92N+r0yaSWJ}?Nkt-}FA(kpqWEf-+FgCaV<%8*Co$MbOkW2+3@DXT>_vvPp0#oR zoY1g1_v-a%!2fdSJGYAB5~YLVaUQ$_>}9UGSnHnyop+CqiVQY|Y{KNsfSdYuf5ijd zH{fSH;QfMv@qqUW3I3$(HsR^4%WrZ1$Hee4vHWEH*BYftn28L$gd8P$pIS@|sW$>X zGS-3OI*|NZDgCMO<1bf`k;X}retGfaBJawVrKkbkHckVg6K@&kLFdcgJI3&it~13C zwZy)bc@lX@sE0%}B#Cb=JhJT^ZlajD6_Y7LZI*&Z4k-*ybtdUd9`yxZ6)iT@N6$qGyy={R(X8Z{xY^7Ld`fb3iVO22f+7F? zMgI7~B6N=BOsyf4oR{qIS&*+Z Xm&2A9D^5`n351hV0)l?}ne~4FBYGur diff --git a/.cache/clangd/index/item.hpp.CF2C10DA19A462FB.idx b/.cache/clangd/index/item.hpp.CF2C10DA19A462FB.idx deleted file mode 100644 index 561786e2714d5bd34cb93de1f1ea5eadb1321955..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3008 zcmYL~2~<;88pmHQ;0uzxyu<{^LLOO20>?|wHoH~0K9 zEpx(zFMS9ieL?2ZMY$zTPl6!C@N$(Dzw?8DAX4Ftr5o#~PhN95kiOkLbeF#Wv?1rx zt5o*xuXetFFmhF6-$Q46g8Es{PyK@Pr|+MeVf1NJ_KOCFmnF~%j~gpr=z8#gYHZ`YqQpGIS_U8YZ4o+AdHKnKh+?BS>Z6CdvOg|OwPwhW7 z@LOB>-9wF{48N`gy0f>Y{L!;n`EO);n%QNBlTkSGfOq_LR-5 zde+D<+%1{^^yb@h*M)ZM3tw{nKy!&F`Rs9{>cQ=SO<$yaFu8rbGq)+esq|ccs^ICx z{H)cLe=AnD3}q(Vl}O4eX7}9JH}u79&mXr(Q$@9OR#cpO_txFZc^6jx}KM zPPb}5iT6#;>NOW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^=d6seexYRDn|mo@Y}3f&*|2P?DwVOlH-B zWdbE@66_8rS#c1>x%p1^Kf+a<<66!RXf|FxQam6Ck$X7CJ(RhJ3ipt54<+uQ+&vVp a%)Q!|y)|doXb~l$rLr+{g)iaj=KlxF3+n3t diff --git a/.cache/clangd/index/json.hpp.6C08A0DAD19BC4D8.idx b/.cache/clangd/index/json.hpp.6C08A0DAD19BC4D8.idx deleted file mode 100644 index 6e8fac2aacf1fb7814ad2670445d32155d035b25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 750 zcmWIYbaQ*g#K7R3;#rZKT9U}Zz`(!@#Kk2=nfX9^5fE3*iS0Yc=U^b<^1b^_t^L81 zX9K%LwXd2*_wM*nrqyKOmv--rgXG@TJ#JwclW)x1+UTewtkhSR_GPY%X~gWcrd^M$ zW>+2C(sA@d`ZC7_kS3Y)SV`5}uU}j@y69f|soDg|NW=7}V z?G_VsFLH`8F#=6sXJY386L1syCe-@mR+_#QXW{_Li!zBag9*6&SrN`}duJt05MW{j z%5#cvN`eWvd{JszaWf;(DQng?1imlOX5?WOuorNKIh=`yna`NdnhWe~dA>%=PL4AV zfocRL1=V1VXXXMs8sab>W>IEQUfYU@=mgQ{CmC6oxdgaGV4h&)0z2OQ-L0Uz;a9SO z=5X_J3wc~wEtUJ@ax_q}popM&FsJL@+*E-+pw*nJoZ39h{G9y!l^Nw>`;$7h0@d*8 z@EO5;&Bz4y?c{mY#$5*vw1TwoaSHP=b8&I;PZe($bF34o18U*d;n$y5rL7kt_$UEr zDVH>t+U(pdM<1|nI11$Q+30_s50K)@6hc0gx?0`B?)#x-1O z7v2E12#5>FJT+kb!p<+=4Kjg~PxxhofyArJB6=XM6ral1+?!F!o2SfXVqxat3I z7UCA-|JC`a@15Q)f1r~DLk!ECJfTkFbFaUCG!fXHl diff --git a/.cache/clangd/index/language.cpp.7CFC0E2AB711785B.idx b/.cache/clangd/index/language.cpp.7CFC0E2AB711785B.idx deleted file mode 100644 index 6d439f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636.idx deleted file mode 100644 index 0d5bb13a714a3438af20f06f58ac7e2065252eda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1320 zcmV+@1=spgNk&E>1poj;WJ!2!WprT#0000D0001UbaH760{{Tm2LJ$goPAZ>ZsIT$ z%%@a+>8>irh3>X05)YJwHriZJ0;TMW$v+aZdcZP#sKci=xc z{wP45XkrcKAF%W2jjf^U*#6`Q^WCFjJar@csE&Ng36AQiWxuqgXL~_7|LibyUhJ?f zqS;~dnOnnw@6OQ>xxsMY+Wi}aL}SYhp3pGx#*S-S^&SUwSNa5_a8`k z!m5<0qOr3tAud6YQ_wYU^h_7vat*cg8g#U9mMP-yl!)1yrl(+nsT5kUS>$Z>go!H6 zrP$Dv$l{bu}hbCxgmb{3=@^QF)Qq9K}uotaVRo?#9;r+7h^ z$@TT|Nhu?Tw4YwDnmo#}j&9Sc<32K`CEF}%$$g%_;=WOq-|TrbF&%xF&JnBbX( z2kjr;#aNoT0RnZPGhC-{M)?Lanu0u8sfr5@HdK}sW*{wvG(cj2MX}>0-U7kd&H(Cw zbDFEA^KvB#R&NtY3Q@^~fRxJqVem}3g&j59`m~BN?JIMgdqcei3zH)< z?v#R8TQkXX1Fl3yph##TF`PA)VO&v`8qLx%eM_(BH9fta@gEl0hu;8md2M1K0000u>XA3= z^)i_d0$5rAR{|aaDpnC95iS4-1ONa40001TWoC0k0RR94`%~#EXA3=^)i_O z3ReOi0xCv3tEBHD)d2wvR|E$H4@lIj8g2N~TLA=D1_}lZQwc@AZDkOS1PoUL4FeMl zR|p3P4GdQc84Di_R}Tpf4{+G3+@92vY5@dS5eyLxg{e zeiVKI1XlWzBu874%-BpSilp6iAYDr~M3lBI z*;q^Ds3ehun4KZ_Rw#v1``Uf>eV+IDJ-^@kzux!1+1=H33I{>X5$@8M$oMcU1VJ<~ zCGp~&Bn$*SBtVcf_mD6wc2Iz{`2^0k%1Xr{V=~c+MuLZv+7>roII_y@TsHUC%F1Eg zfzHrmW~E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ww`A$REUR~SH+J$dxYT#hLdW{*^hwbj+x!Fwx$Al>~I+Z}gknva&i{Z;rMwWR8 KZuIlo1pNacCRURG diff --git a/.cache/clangd/index/main.cpp.9D6EE073CE3F67E9.idx b/.cache/clangd/index/main.cpp.9D6EE073CE3F67E9.idx deleted file mode 100644 index 986d6c37ddc99c10c7655b0e407765630e8d5417..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2136 zcmYL~2Uru?7RQH>NJ1v0fguSgfK(AefMDnd2}y)V5r-OSL5eI0ieh<+C>B%@WcR6v zyQ~DkMMaQ~f)#iDD0V~zL1cxMeTc9U72k#TJ(=&D^PS)P?>TesoO|yCO2uM-EChMQ zNw=jaH%Fr(2qJ(xV{>|;XlS&`Cy>lY<$;I2C*wKem`vh8UumvY)_cK@xe<<^uvV_*8#J`s2Aaz*L* zr%lAEHpS(T?Z+SH84qOUC|c{z+_f%op5jJa57uwamp{Ywj@8Zno;=w8&y#!hlY8Gi z%Mfes_r~|*CyEkz>l;gB9e0%U^ts4O&el-Xv48Iq6NmqEqUo3_+r9Q>+Gb32BuBiyu|m#O2)3Xl);_=)7;@Z62vurYDbpm4Sv{Y2&TH^Dai;|Rk-ID zVUL~Ho;U2IcdnP~(gMtf#)ZcpxZdmTfXN+Kqgpy|kI_fAD75Fi)2*s91Z&1+$W^lb zAF+oH{DhWDJ+qGo7gJD3H?6Ljy^7E z6F%vESvS_`Zl^M734Ks_Y3d{UAJ6hHQQf7nPU<)E{NRDgH}upc?;V{~l7E+LpdR<= zC8<(H&!}a~w3PKhe9Y!$=;LpTa$W;R|Yn|8fj~KHAj~}(yY$z3pr^KPA}VCB$Jwa zGre@)#4Uk(fnTxnvwFkCN8w#<0WEP_;~SH#+}B(3(BIFp9|`QtnM^nwg{1QB6!9dXbHUrl|`syEE zndyNYw;t#?GEQ&7Eb84BS0(1f9WbN-x(F@8E|~9n{@1|H+>E$Z7>WV9HO6}Bg88lw zG*li)dU#nxfTDno#bc=p=DVJ*jL*mhyBu}K?lHPAsz?Jy7$k-s>Y~4I();5309kC7 zv34-g&GPhe96&i$&cqA%eaL1$T7iNQB8rHI5k88KC-ny%XcU~v*Mt!tBOg;3k(x=D z!-&6y{|fSM=ObOGJe)yzI3t`*acb>$Jwj{;7(fhQ(gd@V7g@J60dn=ZET$KaNlB9| z0Z7rNkeTW$EqS5tTLDJWBDt)>81Jpk|KbD0VzAomf`ZoHBdmxTXoMwXIUC00M?_VH zbb}gnEp_=YA`}VzV8p}Q!`CeN0x8zTCJqEjND|ue_wg#*PwxoKpG^mr&$dG&93jUkr724%_+Vx*$YVe?prxv+ zUWZ~M)&X=yx#IUS?5YfWYBT2h$nfEUK60ccppS5VIw&0ijM$=V3DtgXOu?3o1t3I5kWm|I%Slgv z+{pvzhIL!oI-;H|D!Tm^AP$4WbzFfgj{d|s3yLRFi3}K_O6vUqkNSKl1e2Fy;z)=!AB{!iXo@6FX?+Yvz56xe8RJuvPGfT+*`H{nWeQ z6^>X(+S|#d!R;xT)&SY2>=omk*Ihn%H;Vu=DNNez%hrmin&?E3kboj+!w3(>(^en) zaBRZ*`5F`&k>Os580{nN=V>7^60BImk7#-*T ztXHqs3JDF1hzwr`h0g2$yF&i&Kv3AC8@}j9EV_}4?z%-cHYIK&0&s0`u!awv!4x}- zcwUws%RTM6R;yO5v^5c!8ag_eSs1ff%iIi%T!r2o7i)8OJHCUB{+gvy+3G-v9)^m- b6LerLtfux7G)|Z3Pot2?@>t&>zX0gJ#?bcP diff --git a/.cache/clangd/index/memory.hpp.220BFCF008454788.idx b/.cache/clangd/index/memory.hpp.220BFCF008454788.idx deleted file mode 100644 index a16e087593e14b38a14b55d1c49be96500af30d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 740 zcmWIYbaT7I#K7R3;#rZKT9U}Zz`(!@#Kk2=nOlH#Eh7U%#hl&=8~F|^@VNY(xz6J4 ziEHQ1-Z3m{67&$5z!)0&>#eKjl2uvl9&tJQH`l0FaZMCYoTJXlV8+&DvGWWEe~ep7 z!RIHd)ppz~RMF4%a(^LE`gMxpn(zIqvI^xkse2u9-srPp{}R*s8!tr&`I7rvdWtJ^lO6%xZt-fO`RlJnGXqFC*AsB*4TC)6d5aR0`8ycVzyyzD52A#h4gj@;ppD z9B}yyp$Yyuyqo0sn7DxEi;9WLf(f|%<>IjQaz-!Z*qIo47?`=(xOl(>11H3NjLeMp zp8LzkNeb`aW8wgsAZ#dX2`1ns6s4vW9|QUX=2J#aun%D#V`Kt*D45fAZ*HnU9}^EV zj|h(x53{h8uma3;KrJ9orCiX~xfrv9myw5AltWY$<~5)!$V-#wRU3C5IM51|<Ms0C;O4>K<_FDJ}DK$RfRJZ{fk*%`Q& z8EB3$yRb-6YEB|3UW$v7i`_vCXgq~({U%t<8 diff --git a/.cache/clangd/index/mode.cpp.DEC43BA6A32D0056.idx b/.cache/clangd/index/mode.cpp.DEC43BA6A32D0056.idx deleted file mode 100644 index e7e0326f79eb056af44246c53a79b5ba56c0a454..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2090 zcmX|B2~<;88V(^Zc?mBYgsd+K2_S?=K*C}GK}1AZB%%#@vWWs|1<@j?fC3c<*%X0s zBVy|U3aDtUbzzKRL90wbs-n0c3d2N&GFng>6zz@Y*n7_V&;9QA-~ayWTM`x;Du)S# zc`0Ez8L8PTNCX0b4!*4Hb*sddU<0_Ex_oWI+Cep^OCxxbxZrS?l&AZZK zi*h{==OmKuYZu{CRUoyk=TdH6AksqZFTSf5x@VT-q zx!v(`(V|;R|1re5^>JKE2@t2RU&UImb-(|+lK0H#@7ktho07afy&gUlSuG#f{Qp*a zZP(rVR~7|G(zR;I&ZS=MJFmKmH-FMUCB2Z%nCE#Ts4#wfdfGC#x?-D3j1JcYFHBp! z8=dI)_rF7_e-extp#bdCqg8|Ny{pTV$L=RZU8sq9)mMKffOqClL(QhB+UAyJ2JhV` z(;E24nT{hHso!UIo_glpUsQ8N-__~E>q^Uf$1RHJ;e6-|?lN8&$ zSLb>Q+g~*v{OVF;hM)+Y*wNw>30q|h+~3xyy?4o&Fcf>JcCylzu3j_Lg1t?MG8#YG zeeJZrC2YvWhn^=4*)BJoKfl+hp}4NU zAm51OK1&w$xAtD2e!Xw^YGaC{reLb{ef^n_DP0w151x-_yW#no^xBBzv&;We#U9?n zD1EcVtu%9>h_^|uhEgy89xbyvZE9XqN;tcx)8e9KOz)w_n^;w`S{)?)_GUzX>xo(A z>}jv)6E!&c8*-t~q z_`7^hakf+(N!;fhzu43_YY4iVP*>KyF(!T{GdM16Wbc?2EXC3*o;>)mKDb3w zICi}ndgz&7Y^bR*`2KNek#6(L@)-3A5^kMKpZN9J3&rVam~t*jjaVLaEmM8N+g2nlfIP>RPYd+$OgA$BpF$* zJ&=DedeYZ|g!9Gx8TJ!8x6EBZYrz$m1B)DI8h?n9H|dBZT*weINjS*#vW`C$D3b)*uWDRMP}vt_)&*9x#TzSD1}HN1LH&(NE(p_ zBtk}Lo*3c`!4XN|T~vZ9eBM+}cxUU)t}+-58;}#ko*mq9J@?T?X*ke9tPt*kv4>0g zb$8PNbVi)n5f5#ToY)rA1)zedu!-zp4TJ@2N&&>=m|`h)zA+<}RS6)(h0ui4eJLL4 zOZrG4Y9^mW!Ub%BHHeWXa5+~lZ8-f+ z_3a~>iRM}h`RJFf26Z&|Ph*qIA9;tZt3a($7u17 z_o!mRJ#YQR?*QaDay%YCTcfgh9(WDJLSxgc`}+naS2nlb1FS3T%6%%2bPDMZ1p^jk zp`79QDeUNElMp}{h3#JCzf?2&OOFC&t|J#4ol9K)_7R>6ppvc>zfFFuUTCL@0G%m> zg>+Cp7zI*FmRf;MBRd0$Vc1Nd47&Zx diff --git a/.cache/clangd/index/mode.hpp.6A926FBEE534F2A9.idx b/.cache/clangd/index/mode.hpp.6A926FBEE534F2A9.idx deleted file mode 100644 index cf2c74c8b009180a3859096d38aff9992ed720cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 888 zcmWIYbaN|UW?*nm@vO*AElFfyU|`?{;^LB`%vC^o4-G;Bo!yTJinZ z0XF00r)uk@rcD2|pyc6gPi>VW4I-UKKRu57?a}6afobwarw$8tb%`k_J3pR!eS)($ zd|TGR$1~kGwp$*PD?MGk^pw=crQvUz)`b~8YYjIE{F|KL`b8?+P%Pi_hraV!`J+#` z{1h$o3@)5tyYX#%M7Iqa$G?*N1p=0-p3GNP?Bvk-ExE{C;-Z_|m(}}gSNqQYeLXI% zd0tv^Wp0uZ(6!Reg11&i8~d{}G4eC8akFuAfe8jqkk=R(7}*##mQ`x;AJC5wVB!-1 zi!reAv-9&Za6nWr=-jz|#FVZ53?CDx00W!2u(&vwfXlZ}G<}*TfABsZ6E9F+R9I9B zOu*%r?_Vz)%4)?U#>5CSpO=Z34K9D~?iL-(FTS_MnFN9Q`Iz{a!313XW$h~qzPlaE z_?WnX@?yebl3)TZ|1J5Bg@=N_Hy;xhP+mk>L;_5}<^P(WF8vkvUq*n52WGzzyAU5- zz9==VSR5&&m?0s=!v=CC4;vpdAG_?NB$x7Cbw-RlY+~$UJgT;LiXLq zK?aI&OTogFkqI1@x4XaSSC#H;0Lls}3hBZ^6lfhNIAH+@Z*YAehiJ1QK8~kTt(^Uu$O>8wV3J3oAPV6G9mPPzTnx diff --git a/.cache/clangd/index/mpd.cpp.7FCBEF52ABE61287.idx b/.cache/clangd/index/mpd.cpp.7FCBEF52ABE61287.idx deleted file mode 100644 index 7d6d83705a258ce42ef152a027165062f9050ef8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6492 zcmYLN3tWuZ8}2>6W~%vSnwe@clcq6hQqx`2Md^l0x+qckLZWi%q6-R(qITuFTTuzc zvL)q`CDOXCtm`7gx-4xhmaulUKeYe%>@NR)znc`0~(wp~K z{^BRvdUS^SWa~mJrzHoLEjspv?UdG;-Jk#U)_P#`(FCdg!oVL-o^VF(tUiV?2 z#1ADO-u=*NssEk%rKr6wUWPkYss4<7=#}^3SL-RQ_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$kyNCT=SzROBso&p09e<>(>3&1K-j>3AuxE$hqLT^Tg*x+l84&DG&s? zE*93FH^L1+j&&P%3FcgqOE|<$gx!`%OvGD2T_^wVG z$k6$lD3hG$t}|DK`CH|ul|X>F9_YP!zNrMe_&ob`D+PpbzDy?5aKZDEq=n;C+ES8f z08oD%9w+1ZN7GL{938rtLjxV+M%*anc?0d7Q(1S#Oam?Av3RWK{xmO7dc|_Kafk*g zczio$S8&1iyE}J2Thmk0PJWic z12y7P@u|K%A9!$VZP`B8Jqmci`AiUF&kC`Mh=YO4+x!JQV`BGXsg{r%LyizZlVfmVWq6o@$yk$Lu>uOx82_MMA})D&!QT ztWZcHcpz4tyy3o)k+Odp;AWG;q;<80>7Mu0pM<47(VmQaf}7bpQat$mG}qD(2O*8~ zkJBQX;AB=MBoExoN>i1(?OI{$g$_UxzA9gaBxGWl9})=eVa2I!D2dsA?p!4ts5j^% zkv@>J+8|rtd{z}C2P|1LkPC1#>p<5L*Rp*4>rOa|@~6~Sx7kWt3G%v^kgyqTQ-p-w zXou-AI4r$B32)UJ(tm_IZHcyID9@+9o~78cBt1*qv-}tK2>+n~ diff --git a/.cache/clangd/index/network.cpp.109ECEBB28F3CA1E.idx b/.cache/clangd/index/network.cpp.109ECEBB28F3CA1E.idx deleted file mode 100644 index 5f659f91839340819147bc27ba2dcb52d4f6e1b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12826 zcmbt)d036x7jS#Od%tz2&N-br&GW3eNHU~r$ef~F(k zwkU+Csi{fef8nA9zw5!v7@?Zl(xfdx0rMVt$!h$^W-hwZGsq_O{@q#Imugt$+?EI| zQf9xfcF#g0)r>g@omS@8|E(Alr+u|}$eO7o^D0d)ugG&+A2DU?=#)&WoYGVI$G3$x z-wSQ|(|suCll1uzTH?Ct+;3hPZFd_(4ZNgvUAMd_GCTCJOfc{BpW3PSz2@%@pLESmx_0@?txo^6kYTb9E`cYW) zv!~%cy24GfKR>*t{G;EEgQXWgEFxo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.959179E628BFA829.idx deleted file mode 100644 index 87fa996cefd4a53e6dc1c454aac85f53cd8b0e89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3296 zcmYM02~<;88pp#034xc#llNW%2?-EL*q1=q!WI^h#RbJytzxSPb@z}cF0ERpE(I4T zt_L{7P!~qgQ^(F&go;>ZP;^jwY8|(6FI8NMB5HAL=etkuOU}vv+%La-zqjP&cQY|J zJNq&vkz~%!UB0kn$xJ7SL?VZ`ZHaa6H3x|#7d}{Czhlza#n+;!pCS)ldK`Uk=jYPd zIce40{c;b_ipmk^YDRZ2wO(25!ynJz7-uOz5}cZP?$hVnMh(6?GNZZeXZKUPuA0Wz zHQdn-atGMzi5KbUTIsO1$l_nl{QKURMLQ}A3ld8Q`sHT&>)necENia*GHlMF2Pxwg zGar93SG)Fo-uK?J*htT3asBk*=0ktl67$)mptZrrJ!Wh_yteJp_9MMXYwq1oj@Y|> z;iC!GKPoJ#on_L1qTbb}pk4DXH=dlk@wTemr{})0yWq6-adC0^3`13d?}6(_xxov2 zip{pQ&bOQf$G)EV-xpJ_=A=y5CAf7Jv=$64QvPq3uA{BDJH>_%Ll%`-u}Bw>49G*UvH=Dl(rpEpl12#nZHAD5bBjBqU zEOBfmCCk5&IqTc=Y(Yu$t%nN7g75dYv_+i!+jp&3TT|TF2i&By>t_N&iw?!0_>@{YS| z`(~ZQwqoHdQ;!WN{h+MUKihp9+iuE2Sfb`eM zHC`fDAGmldRJ#6}2htO+m1~tE*KOHtb^QBc9|pM+9>qmzMXuL={3a=V&j61Q;VPxd zSL7il%Ove9@=IwH2IrSWXDNgbd2FSzKi;u#CXHf&TWAX>gvjH(j_PustQw|~JMct4 zQ7weX(@K9#>kb?Il0h!y_z_%$UgQ?frMl+Z`!X36O1ObD_=`N}VtcG}#ljT~iXuFi z3)YBy>(h3a{L4M>81aJX? zA}`?#H#}cI?O~8V;bB~u{SKEDmAs$5bs_hj1YVk@siStxRb6R|<`S;QBJ@OkN0)Kbcc^Y|N6P-)N)-oOK6sr%>M?;$Q$rNh{HN-&18d4}W z2j#d@@*qpyO`J) zt`u8$c5i6d57S%Za3}Lz@_35Pcgg38fng3dFA*-3ShU2i&=AX&=oBc{D6uC{tWF|J zD6uIwymKQ=#!lS$>YooLO?bJ^kz!TuDh0)=-PMqz(P$a5B+SHiBvN#6V6hCh{rQua z%8rip@bK^MV2D?s#6Ed2r#60aLu(^6)c9!vDOT&F z)f2bC31hJkl|YF-Vl7!P6aOc)S&MB|c;JoW?TaG=i9}-`df105`%q~gD(pi~`_Rii fSS18rqo?a@A2PgSI^xQJo diff --git a/.cache/clangd/index/pulseaudio.cpp.33560C8DDD3A5AD3.idx b/.cache/clangd/index/pulseaudio.cpp.33560C8DDD3A5AD3.idx deleted file mode 100644 index a0d951ab1d34d5ca8ce517492c946b6e919fd9bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5832 zcmYLN2|Scr8~2RY7~>tw%rIt*F~+`*bu1-IMTA6{w~|y^X|dc&N_EqsqFqIsq~&(q zbdeVAQ%wmsYke8*{QKe7-F_z476G`)iL<9a(nI5&zR>sVB~#uh{g)HRHFf z^{IP5Omh6z#JF{3=-$dp=l(RF@y+7v{LX-&&mI3R)BJShNxf!G{GE+6Zq5J5T%x`8 zsLO!2`_4U+S7b(nyjb>XZ{va|i`s&`7e0DXQBb+nas2rhgT-}o8}(m5t^9ELuQtd2 zynn1-U#Y*nP~Cm`)yQkw##_gF>`Fi1-8e^F|9aYv$_vxy^2slzA|KAd_S%G@?B7e< zNB(ZxToRm+vMYXWh?*?bY?~cc}TAH+AZ#%{`yJp5>BAQP6N&yQ|}L{U45;_`Rg{s ztn#m~_1vbod&JJ5D{bzL5bgM?@{Mox(>BiEtGZxeSW(7*YCU(x7Z>R!TAbeL-F{M* zwPi@a5t}+{OZ1_ma}HTGeOmd>L1TyWXS6*XP&&^#gSz3c0^&gRmj4WY+d z#{Tu@%gQHqZVHvJe(DDE#($9~y0h8Us}v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@D0MOyC?5SKucz>F=q z0~Q2kYRL<*K5e|J<=UDVS8$_Gg7hTKMa#jd97g=S$YCTpn>jn;Wx#5IEBnWd?o7My z(WO^%D{#fVpwSDwvk#lrY=0-aqFX} z3Mhw&3l5R{oS&`t#cJ^naQ*>Z;ztrEepFNflTdI6gkPNDc5e3j^#?GlnM@{T1s;Qk z+?UVfnu&=xrz^fuwW zr~@1?OGM=jgUm==@Ii1q2*E$^ptvuxP#MMkehs~@b>!&oP?gd$s2J)30xd zLzYh>h!#yK{!dEdGeE z6#=`5t{T-~Rt=5~@o~}l(_eSvzTiMh7Wgf? zX7dKFq|!9d#L>jR+qb+Fw>a5wE*>yRyKhxT|Q*3VEdd~-gI4>_YC!T9G>CN9~yxD<5z|knVKy; zuTHv7Mj1t!zw%?my=zt`ARGkEK``u*kx8-#Y5$@?m!WIedtq?Lvh=j)2(!UA8v^>S zd$8Nw#&5xiYr&?LPHPR|(g5zS4?G?){ffuSySJ)5r9{qQ|E>6QyrBG@3ZTdUg zwVUrez$~uDRO8`>Fu0hgcw(M4UX~aZ_-vtXfzBgm%aI+(WpX)QoY>y@>@D+_CnqGv z)4x`wBu`Bd&<{$w`Thr#_&;~aj0~?zP^wH#nwA)Y;&D+?5GWKG1`HYLINZk9*3VUH z=Wp-fWUjC U(BNx_3%EMEVN*jQL&vK87hG7Kh5!Hn diff --git a/.cache/clangd/index/pulseaudio.hpp.C6D74738A7A6B198.idx b/.cache/clangd/index/pulseaudio.hpp.C6D74738A7A6B198.idx deleted file mode 100644 index 40bf5907d709a90dfc20cedeb8f98395162dbfd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2202 zcmYM04Nw$i7{~YCQ+7G_Ue4vXPwu!oj&Be26eWceNc>0>WXz95M-&;+69iJkPfSw* z5h2A93e8Hb{9uf+2m{nc63Hl2kRg+hAuU2CKm)O77vJS(_|HE3+vnL`xZg7@m>nHm z$WT<&>e-o&#Eg}rD2kH9PkKh$+Q|}%szMZ%S$eQAJVk0|-+w+K{?Nof9FEho&MEz) zX0}U;; zt{yDz{yo(kdw>g0DBQhvRr#aR{`P{RiT>#2o;dojKG+dkx8k>xQ7!+P!y>0H_&%ZS zq5aQ>`oi;Pwk@r`d#!9yL*!06rFv)e9kVZT|Xu zB~e}XXe6;xjEj?tLI}!vc)o;@*ts&#FpHxaBX^i!!4{1W;)Kw*j6)qw)<%pxfCu0J ztq>v)-!`CbL`hW`8G+ld%~J@GNA2A|*mI(}Pk~&$hu?|ODRrJApRczxD*aL{7>$Ph zU>s}_LgXfc_9T`2VB`ec z2m81QA@YQ|ZN)nk;cjZ=L*`?Ir6Nz95+C!#SP+VlC-ev6Ko22AzP)Z5AD?U5YPkbWgrYD9i4CNdzScFqor#z4P^#=|Ux$iHf~=g#QOzl4z& za5FZ$3nB7KsZUN>(hsk3NKNLeuu3QLD-TK=j!%u9${`)$?$~{V*Cd5hCHLo^#7GMB zjT)m#2(ka_zWZy-v(7A2AO-2yDzzq&-%fjyAGT=AbNHh`zc=>Q2_f=dKF)XU+Up;L zksEMd?5h$&R{jqqiP`?r)TBq3am6~dq55YIbSY{cn=rzzQ;MwxZ+4uZ~45EV|gXv&7*%fd{eo>Is042W{ z$R?0T7=8l~@qzNz6VIXKB_~?LQT`!o|F;#7`)BIf;(Y%WFvNgOaz7$OaelrV+P*@=o3SBJG`x z^tU(QMlL!R6EO=e=CvXsLCIV6tL1d}vGymQz{T!C?qNhD7{%*DtbvmMIuS{rmp3FW zas5hu*QckgN{{0Yn6Pto6+3NbQ=ME`xwDL>Wc=CTj|({%{?Fo7#g3eH9yz2(4*v%d Cs1;-Y diff --git a/.cache/clangd/index/sleeper_thread.hpp.B273FAC75439EB17.idx b/.cache/clangd/index/sleeper_thread.hpp.B273FAC75439EB17.idx deleted file mode 100644 index ee3351c34d12016680e3261376da49be2729a29e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1672 zcmYL~3s4hR6oxl9H}9Ke6G%1*C~*@c5=ukEK%hh!jEN{uEme!v8c>UG30AR;#aCyn zW$L3^YjLdN6SXtgQAAs7u``H{qjoH`q7l^k>S(PU#bR4~cI}3p$)CIX-#z!-bH6h? zF3<0;lT*~lio7Lrr&mwI6h&#_7pktRyaNB1B^0%!p?>|jS*LTzs3-1U-m2XE;kKESld7a0<`y}wUG`)G-m{85!AVL(C zaW1;9Y~eo_jYwjoFpcOaK`13(3b+CX5A1uoJtvk%2>b#|0VhbrAN%{i`5J4glYHFtyF6=JZ%^(84QD-y@ z67e^bY`023DtkyHE%?Qj;vs@W{EZXObZ^WV0Xw9@=M)?xNW|Z>Y*Nd{OGPCtV!`(z zpHz^D-*oiZt0wkl{mTjyM4~V+5x@OR!pe~iX)QF;!25-kLaQJV|FQM!`;C8{TtFi! z_(hhYA%YC}q0?thevo&VK@9lmigb-25&ub}q3MzG@z z$K*j9g1*Jam%Sz>*cI!t66}fffEFqWNqp+&mg1D$AjI@qyoubSrlb0&yH>%iJ;olF zOqN{eQHHljFlGs>6;YI^1q8F@w?fY;dl9T{j`tsY)x*0tQ^sfK_YQ7wLlsXP78_vtpPr(UluY(GT7om>nUDZaxX3hAfCqZ(>DAjVxO&ba zj9r{70b>v6Noa_lkj1TYzYSTrG%f=itHxsxVTa6l()T?Yy<^JC{a0WP8_mK_^A-78 z5qJpBgMMh~?n-}o#sUbgXY@LZEySWdv}tOI*4NPs5BYKd05q#>{%lx@x9#j&*q5L2 zo5aR|v$mORg8=|j5~ypaD;bg*>Pc1$jnduT(|+ej;}HmDGuT*+lMG30&ji`^y0&s3 zgmT6>2a7!fC1P}piC~k~1VmXm>o6!(u00Q?jdhMAI7^-dCE}ax@&9dw)IvKEJPMCe xR!yHXjqjmQRe31D53ub<*AMFxA7YtIu28Bd_?C#5LL5+(a$u+$7|I5Q{{f$nonQa} diff --git a/.cache/clangd/index/sndio.cpp.1174277772D16F52.idx b/.cache/clangd/index/sndio.cpp.1174277772D16F52.idx deleted file mode 100644 index dcbcf66a93e0bc7fd46a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7SO?$ndzM?^M84#j<~r2O zQBV0k^ApCbv zVj{8#=*@s;0GDbcFan!qd^1QksYD8dYDcq!aX%wJGjP)^ObXudBVl#{Z2^qOvEm3% z4dQ|PmS9Ub;4eD^_N+v-N+L)th|_}L(z_6?i@+Mh(;$7~4e@%Aeq&m^V~c&5Gx#KO z7WsVLWH+v=<$VF?QVNv9?_Ozw#tw$Nfpac27s!&Mh;|e~+lJj-m}@eMt29lFN4wvaxOBJ1{2=TTEbr904B38MrUzr> z9SQ}v)w7j=G`Dr6;3}4iN5P9(#lq8Jin!J^;dAh>2AS6&>#os&rjp(YqBi}^HdLomHKVQw31ux2i^EuKS2}*a#_QLQrv^CJr_spM*;ad@9 zD?#r&5M>9^9zpygNK9Deoks?j6obJp9$kbaz^jmc6*9l#e$5w8=z9tSDt(o>?}RdG zz4n>Qa6bfbVfaS!MxBASfYmAfubH3|#0X*!dEzHKvL~_uZlrJI+|@rnt@1ZjL2CNh z`ZveeD4 zB%s1nVf*A^h`Oxz@piCCJfzvrC^(KlN5H24^CdO=?F4U-pqM}WUQ$my+(m{xI+36g znNAIOzaE?}+5iLf$ezU@~zDi5Vzgn?qiVpCeBazGf-FxcGQ9-#}~_>NC$J*e<|6 z(8JUr$kE$X>S<->HOJc4!q~{tPhvh-9%AC_WaIDdCUX`=>xV}~#)Ron`D6x@g=y<( W(Pt0 diff --git a/.cache/clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx b/.cache/clangd/index/sndio.hpp.2C5698C31C5CA7B4.idx deleted file mode 100644 index a6d18d34376287f1e1ad737d131bb841036f3a23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1304 zcmWIYbaNA6Wngel@vO*AElFfyU|`?{;^LB`%o{*@4kH6Y#hl)W*7=7WI2wK$$NJ8? z7;Rndy|k}GMrB(||7F`dX(#j7zuvKGRar-i!vXe3jO`kWnY&Y(9vEh=2$_3I%C2{r ztrDM|W|f3@TFv9r6OH=}BZQAG7q?qg>g@IX!en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+4IJu;`6c{+6`a@Uj zvzqr=U5$^452#;SN!kER!1d3#J;%+z$>g~h6QeLxKTs(fTz;0$>17I9dnE;!cwzFw z?84%3`MIizk0u5(zvp9O0h%u*Eu{=5;PP8;&paN-mGMBFNd%^!pNXFtE`PJjL(Kl_ z*A_k|W}tpaX-Ro70hhnEuJS>N)|0&gOgu3CLhM3PaQU}CUle`#cqo>giBX7wlZTCm z3rxWL&&bJGl$uuT3k+$lH6PB}%=-6?k%v=AT1Xid@QhsG09RV7pxJiiNgGgBSYB8i z7VJP-P?!gEy6(+Q73c%X@(J-tg!l=mznEyl3gk+$OYy?O7^oN&z@_Z{Z=7Kr6@uTRtaPurqRUf`S_s%0MnCbYX!CG!PV`urOp~Ix4aSCUIJHl=9E_W*WqFi>ikO`$dwY7l4K}K z%}E5Mm*S%2;$RSi3q(Kw2aLhMz>Z*YBbaOmCZ|z1II7Ju2exY;>a*%(+6asXqK B9!mfK diff --git a/.cache/clangd/index/taskbar.cpp.3B871EDA6D279756.idx b/.cache/clangd/index/taskbar.cpp.3B871EDA6D279756.idx deleted file mode 100644 index da30b7b2c157c04d7033cd7cef0ad65e3ca015fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12886 zcmYjX2VBkF8}BUc?f$CUyp{H*rJ{_I8IkbXFZpHXjf}i_?a|O8QF==m*-A!2L`Ft7 z$w-l;5-B5kjsDLm<=^Mi?|Yx~d+r&}InO-z4{t9oUuPwye$%{{%$dG$GF4JiQi1>A zg$rig0-`$*OSZ*~88P=|H+jRbClji(79Z?8_{_;e175D_n=>G}?*RWNrBM|YR!8T} zzA-{o4X%KQ1^UUJ!s+aG`EH?-gUzWn+-t;Opa1L{tNUv>MUmbTNg z!RjNK{nA*XCiARQedX`0KTPda{SlIBj$HgaK_qiPk^?x$^+$VeYl&>3? ztp8Cx@5QnoLwc_b-{kpYL->Pl;YZ)cyfso;y3F%xY36CSWZ`=|mD+a4y*@hW`dXh% zt50vb_jlC9GZVc+&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(xWU6E$lJ?TYaJyS6CM#0CZ-DEPrgIM;eB2)WtiYB>=83?h@1Jay);(czeIn!8b1aCP;g&VidY>*1 z^O~;`2W_UDWj^?^$u@GO^NmGibtk3?ePFtobv8#w#XF=&_O*w_pUulwgmtdk^mL2D zm3IYNtiRplQkat;ITfzHbkVTK&MIZ4x}*4nQuTL7zB2n-xgU00C|WG=vG-o53|orO zdCjcb|7JyQH(RMU{p)VFS_U_-x!w%LmAOeuKp${LUeJ&I)RD)>#38`IEG#Ch045kX zK;8uck#%oZvu+gLE5O7lz`&}fqG!Y`ASR#!mzTfaVYpgHPE>%23n*`+Y@^F8C?==? zm)HDoE9)JV5hB#6)Dl1YABy)aK{ba}IuDOpHMN%yP_{%-l@eym0xb{kH#G z9xf~rVB!VJiz|z3GV`+YBIMhdQ#n!^)l4V&dk5_?ekqh+Pt90z*-1TJcq&1T3T&xxgU= z3m8UDaDc$V0mudUALebKVvwJmewo!gnS9%kk%w7OQBV`+X`o_|XM;Ii_vWSw^Z}j5 zEy*pZ0gE_T9&UTuy0DMWF9;5<$K$E=n%81~H)V4q`G_c7Bk3 anU}Dhg`JIwg@Fwu1_A6a1_J{Vf(Zbi#?Pbx diff --git a/.cache/clangd/index/tray.cpp.02A8D890AD31BCCD.idx b/.cache/clangd/index/tray.cpp.02A8D890AD31BCCD.idx deleted file mode 100644 index d907a6a2994853609beddb733ee264a4e73b4236..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2114 zcmX|B4LDTk9v{cdIdjgO`8a0GFf+^yGa8K~bSFeo2qhn7hNQ&oh`2J^lyY^^E|%33 zd)NB7MITnN2$fbB)vX@Vx?8foLaUbAv3*dfbl>qjb)IMb&-~us|NWoe|Np+f6XNIN z<4Prw*2VgzC2CTm$s`hq4t~1Sl-&|z5(xraTKVCveMw~woXOBLS5reZ!>5L7C6hNaU#3mNFYPlnW>`IpY9sRg9r_Gnf!vT`4JS1YJx z{$BQuJ(9W$3h%oyyqp#O8E(w#B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hfztq@FiI}MjK(-#neLR= z(UD_F_MogQPM&+`-LJb0k=1NEn?Y7{gdB_FzVOzIXU}Osj*KSb70;c)M{o2N0Vqf1 zM8%YO!|-M86qt{p{;9tX1}nN=-3BZS!}NOM%xsynJ_bMqO+nOmz4~sbRN?_3;)VoY z@+nEH_k1z{_QG6Pc)6v#s`%2vF2GV@Dx3*2a9|zUktRFi>x2xhoory@p8}?VM#3c(Udi%l6K#71WFe9tQCSndLMYAW`@Ga4$#OSOIf5Hu6 z@i9`5w_7`H`YqQKQiYRLpO#6an8esU2DoMGRwG|?zQD)L+hN^OPsLhiv7OhlRV!qF zvymuWm)KfcT1Y*FR_-qAMXT-QYn&WcE;rlE_45x1*i_@% diff --git a/.cache/clangd/index/tray.hpp.469C1AF36DEA64C2.idx b/.cache/clangd/index/tray.hpp.469C1AF36DEA64C2.idx deleted file mode 100644 index 3a9e9b296bf8acb6781cba51d2593c36d1bd5568..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 988 zcmWIYbaT7H%)sEB;#rZKT9U}Zz`(!@#Kk2=nVW$0X+{QyiaB!wcXJ&!;JG3mx_f(% z?5%~mB_@7r1jKK1)h#)DDSy2z(^6-}6v6fq^}C8YSWTTz>vQhis3K69;C^Cmr{lxe zvun9BYSK5W<@l}Hy!5a^U-S#s{H4263y-|;U3heh`*g1w^4V@iB1$B=Om&C`!50n>|5mx~daQR&uAFkre z-m!t5iBW)ojhl^|3rsL@Lfp^D#&~G0(rJwuMrQ<=cwjCRVi)3pn{d`Qcl+Fr?T^Hm z7-90fOuTGx`Cqnb&sugdNeVFW!Q}bb`FY{;MX71U!AK#=$OR5T4XcBZyA_fZn0VNP zWQ7!Y*n|~?RrG&L3x2)+RgIB{OAE*JRiF>ZQBEF^(kkec(V(F^lbS9k!86=N6UdKh_I;^#es|3EIc2)Fc81J*C>{Nml9 z@DUP{0fvvLuskfRfhK^%xF|Iz5tOQmi;|0jK@4cB1Tlfx5e7J53P-qqJXT56=5}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^%WsYBn=dY)%xNG_gULPq!ZqhFeBFp9u&vku_nN!TGG+F3cf^h4COlNB>-rk% zJ`B$YXNF_7*8-~+tOi>|B-;+R#loe##NLXHPZXz?R3M-g7!;V0)G83H0(}}_xD|8| z_5q&jM!z!-N5OrtjRaz#hkVi!73?JrZ^R=7OaVTaI!qm%zPE+ZN%B%VBo=TA@Q6ZA zq2{yCslK1y2b@O}Ne$BSW#ZFC3DH}R;_?g-XF&7awqX-iZg%D4CKnACeDud_jCcId z`@!E;clC2LuF#+mgI)@PQX2g#fm;cflKWufJ_x0a^F0b-pJRmChuLXPn>%guKoM|9ZtEc7a!Kt2>YXG$ddffmH4fO3B z!LAXUzr3roRNGr@gQ=K9Cuk^ehnEL?{@HjA!({n2j zt-$%ZM$|cdrd}hK#m~3-pTT#k*2fj|R8qX5rQ_I@%Sn~}~ETVFdj2MbqAlVKiK zQZup0+oE%-``VqQ8!68wjbyT$oHFZA8=BV&kOs=-Z7(JmtGki*D IbXX+g|A~rsG5`Po diff --git a/.cache/clangd/index/watcher.hpp.F4849F54352399E5.idx b/.cache/clangd/index/watcher.hpp.F4849F54352399E5.idx deleted file mode 100644 index 8ee37cc490750e62eca5bf907dd91e1d632a4f71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2232 zcmYjS2~ZPf7~O1E$Zj^tW^+I|5{^Iu2?hv=RV)aIq5`7`ii!*%bp)vzP^lJd9T{&& zDa8YHP^s1f#8#_LovJw01C^o{(6NdZv?3lO;#sxduKr7RCNI15{`dXg|7G9H#Dw_x z1__46&P*sS$SukuFbtEyr?AK|d#nh<7T_3GTwOM?Iq6I=^L)>|<+1tX{0nt4C0)@Y z!*<@C`PmEq^sbK6GgA5+kN$l)v1Ux!)wRD5|8;-*&)qR|W;MMVt3H@qcxdrWb?@{G zYhH_|rAk;eYsL!)Kd0+(Au~f?SUAv?*57SLG$(m7oR`s$Q;|! zyfVJ;@^HrmUHx}+*)bFGhY|}Bb=}iBvFfDTj#U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&TU$ zMJWPv<07QsQ)uAir{1{T=l#&`cBTH}2{8;oA84ehP&`yZQ+C`gK_LQiE`8sGwC{ioaj2^ShDCb$M5BTy>9VlEB#KWThm$b2g0-o{|_ zC^&m?z$laqu!c(n6a-L#O9AA2cu6?ZL(gO&1LGns%sHnqk8R^0N#P(0ox&I9OsZ5c zVYNn&(g135DS*rmH96-auLH|@yz_kp;W!gA5@x8CYH8$jU^#~)V}q7+HS)1YL~;H_ zwgr~+EOIG4au)s2@aFmRrVSIg-!9S=@5r5##r=B}I&una+zrXW$4iQCFpT;zhdHyY O{`49#DWx%bfcOukpfkAu diff --git a/.cache/clangd/index/window.cpp.8AB8664D31F55915.idx b/.cache/clangd/index/window.cpp.8AB8664D31F55915.idx deleted file mode 100644 index d84db141d9d657d794a181c0dee61d88f723af36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3582 zcmYLLd0bP+77p=dx#R}2k%TO4A%P^2gapXKzKbYAG-d*bvMGX~f<{mTt76sSZWk#o zb*qYCYu(UN_o}?Q?@OyxE7tmIwLqyBeJ8%BFMoW$nR8~&ocqmp&cvFYn%d7Kk&=qj zYbr{n7hoh338tj#=~a`44Iz;x(n+M6mN~Xdl|Nfp=f2$a^73q(x8Ts>YXQ&W(@Qst zImsJC{*qS}azmP=W;}H8<+?4!Nypl-#gAINU)9t-MfB`*e+}QfZqwuyKix%V>P4|p zmr4&UioP-KpGwlJ0(PdP;nK~NF8$N+s^DUy@M>e_eb4sFs3VrRtlb}7el@WE(!(1E z8VW}g@A=!=DXTr!+jqn^C!A`_*7fSf4Q$WUp#s1tFkSOBbj{-4dXT3 zY%4V(v`1KI-5C8~`;CqWLrn6L(8$ZVS0j!ema^h5EJl;fF*NS+efoKQeuB+Gi64hw zDZ8M&^0ztTf!=6qizqtfU(}f~?{v$HYSY%-HP3Gx%=`Q$Ib_jc11s+f>kE4kd-s^D zzttV_!gO&o5az0juPmtFk>=;NR7^vEp0OzJrX;Hm6$qm~?W+v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U=t&SaDV^Eotn0=dg$(&OilY!;V3-nsqYVlg$# zz^04>Qp1o(jjumlL>(olEJ5|lJ3B^e+s>9y$4wO9M61`UBfR3mU$~IjJO%xyV8YBR zxEsUYJ(<&hdYC%Q`0rQqH=R?>Kf4~fgrf|YUIyU&vpQ-PD=;=-Q@8{(IekP^PoSQ(+iE(i-%2sMOGAPn3+-MU{{eZjO9ub| diff --git a/.cache/clangd/index/workspaces.hpp.0FDE443B68162423.idx b/.cache/clangd/index/workspaces.hpp.0FDE443B68162423.idx deleted file mode 100644 index e4f37356d26c43375d9da06060c2ecfbdd3eb81a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2044 zcmYL~3s4hB7=SO!BfwoQmvF|AkS9$-F6bdaUVTs933lDo91F4ntoG zQ^ZoJqs0f-TDA4jQKSk=(F&p{Fde0(!$=jh)@pU46&2gP)4kjb|LmXdcK6@S_mhm& z9jD4GYG;Xj_s?R5>U1 zZ`E$BO1)o852WPn*(*JBx$*B~1`=yH;raF*B^5E)sM^&Oo+FEGuV|3;9yqxpfqjvA zAbi`xZ9Od$cH=qk+`i+_=T_Ls;&&_3f9rV1b&oN0)fC@TTr9bsKQs5zSY4B}8d&om zyx)1*JUG7SsB2~Yk-6d(_jR+64u6=x)Bl3^iKX7f&7sSKeu&$fWs`iCal7uz=FRuC zKTY0u`y8{nr|%RotjzYFy0v#x^`SO(PrK|ui^F!Xdi~5s=Mh!n*TxR|So?tb;_*($ zcYogM8NV_!>b|0LJnu=)ADUZ{)Y1Ob?1TlT%gfsyK6`*aE_;xAS~R%O@)UpSc@G0wd%W)-sC^0*}ke+#pH6`V9#TkegX^3?Bp@pWhR`=e=k9 zNZ<*1FdJ;=gTRv#Vya#XDBDhfKvchxHkt&UmUJ~dFMeG)1!%+#w871@M>YDE+LJ{j zP{Z}DtTloU!u(|pI?BH0>I4O3Xnr6a=)Rxjl67)bzw2k~MEwNr6@MW7GBD2^G zU$clUlI(&RuHBTS29_iZl}01sVZog3$ZuE@=QYw9rkuveUYK&$mNJgCn>{HkTuMJn zpHe2?d^f>)jRdfMRt9S}`IvAdG@QbTT%`baMw)ibhEswJL2QjHxitaXHVW%hSyT*x ztF7t~0uKQpUdVJfku$u0$2xm;N5{wBaPfFqGJ$It4NKtKsaiX{mRMaptRYGt2Tw|y z16q?C$`8%DH7N4L6)}ne)D-ZHTt}cDfGO7iS4_FPi%s9Az>HSqh=&d|bhF&1VD>Izr}-wh=NMfu$S z`_hsnrRCf}%7vGY4;o;YpL+;@pwUC20frIoA?Y6Ck0RsPs`H`0`$ Date: Wed, 20 Jan 2021 17:48:35 -0800 Subject: [PATCH 131/303] fix(client): attach styles only once Gdk >= 3.10 has only one GdkScreen. No need to reattach styles on every output change. --- src/client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 24984a4..9fdf870 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -129,9 +129,6 @@ void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_ wl_display_roundtrip(client->wl_display); for (const auto &config : configs) { client->bars.emplace_back(std::make_unique(&output, config)); - Glib::RefPtr screen = client->bars.back()->window.get_screen(); - client->style_context_->add_provider_for_screen( - screen, client->css_provider_, GTK_STYLE_PROVIDER_PRIORITY_USER); } } } catch (const std::exception &e) { @@ -232,6 +229,9 @@ auto waybar::Client::setupCss(const std::string &css_file) -> void { if (!css_provider_->load_from_path(css_file)) { throw std::runtime_error("Can't open style file"); } + // there's always only one screen + style_context_->add_provider_for_screen( + Gdk::Screen::get_default(), css_provider_, GTK_STYLE_PROVIDER_PRIORITY_USER); } void waybar::Client::bindInterfaces() { From 7fa1c118335cad40fdb92db49f4e35c8f8dc0bac Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 20 Jan 2021 19:36:16 -0800 Subject: [PATCH 132/303] fix(client): unsubscribe after receiving xdg_output.done event Ignore any further xdg_output events. Name and description are constant for the lifetime of wl_output in xdg-output-unstable-v1 version 2 and we don't need other properties. Fixes #990. --- src/client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 9fdf870..0ad4e6b 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -123,14 +123,14 @@ void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_ spdlog::debug("Output detection done: {} ({})", output.name, output.identifier); auto configs = client->getOutputConfigs(output); - if (configs.empty()) { - output.xdg_output.reset(); - } else { + if (!configs.empty()) { wl_display_roundtrip(client->wl_display); for (const auto &config : configs) { client->bars.emplace_back(std::make_unique(&output, config)); } } + // unsubscribe + output.xdg_output.reset(); } catch (const std::exception &e) { std::cerr << e.what() << std::endl; } From 3bcf3904849bc3cb91799d992336d1b7fe59dd1e Mon Sep 17 00:00:00 2001 From: Martin Pittermann Date: Sun, 24 Jan 2021 21:39:14 +0100 Subject: [PATCH 133/303] add power to battery formatter --- include/modules/battery.hpp | 10 +++++----- src/modules/battery.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/modules/battery.hpp b/include/modules/battery.hpp index 08dd79d..41bc0ad 100644 --- a/include/modules/battery.hpp +++ b/include/modules/battery.hpp @@ -31,11 +31,11 @@ class Battery : public ALabel { private: static inline const fs::path data_dir_ = "/sys/class/power_supply/"; - void refreshBatteries(); - void worker(); - const std::string getAdapterStatus(uint8_t capacity) const; - const std::tuple getInfos(); - const std::string formatTimeRemaining(float hoursRemaining); + void refreshBatteries(); + void worker(); + const std::string getAdapterStatus(uint8_t capacity) const; + const std::tuple getInfos(); + const std::string formatTimeRemaining(float hoursRemaining); int global_watch; std::map batteries_; diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 86f24b2..8577469 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -135,7 +135,7 @@ void waybar::modules::Battery::refreshBatteries() { } } -const std::tuple waybar::modules::Battery::getInfos() { +const std::tuple waybar::modules::Battery::getInfos() { std::lock_guard guard(battery_list_mutex_); try { @@ -210,10 +210,10 @@ const std::tuple waybar::modules::Battery::getInfos status = "Full"; } - return {cap, time_remaining, status}; + return {cap, time_remaining, status, total_power / 1e6}; } catch (const std::exception& e) { spdlog::error("Battery: {}", e.what()); - return {0, 0, "Unknown"}; + return {0, 0, "Unknown", 0}; } } @@ -248,7 +248,7 @@ const std::string waybar::modules::Battery::formatTimeRemaining(float hoursRemai } auto waybar::modules::Battery::update() -> void { - auto [capacity, time_remaining, status] = getInfos(); + auto [capacity, time_remaining, status, power] = getInfos(); if (status == "Unknown") { status = getAdapterStatus(capacity); } @@ -302,6 +302,7 @@ auto waybar::modules::Battery::update() -> void { auto icons = std::vector{status + "-" + state, status, state}; label_.set_markup(fmt::format(format, fmt::arg("capacity", capacity), + fmt::arg("power", power), fmt::arg("icon", getIcon(capacity, icons)), fmt::arg("time", time_remaining_formatted))); } From cd97bdb30f1d6d5b6ebc9553bb9ff1e13ccefa28 Mon Sep 17 00:00:00 2001 From: Martin Pittermann Date: Sun, 24 Jan 2021 21:49:00 +0100 Subject: [PATCH 134/303] document power formatter in battery module --- man/waybar-battery.5.scd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/waybar-battery.5.scd b/man/waybar-battery.5.scd index 869df32..a4650cd 100644 --- a/man/waybar-battery.5.scd +++ b/man/waybar-battery.5.scd @@ -96,6 +96,8 @@ The *battery* module displays the current capacity and state (eg. charging) of y *{capacity}*: Capacity in percentage +*{power}*: Power in watts + *{icon}*: Icon, as defined in *format-icons*. *{time}*: Estimate of time until full or empty. Note that this is based on the power draw at the last refresh time, not an average. From e19aa1d43af943d83eae532833b2ada0baaed31f Mon Sep 17 00:00:00 2001 From: Thomas Sarboni Date: Sat, 30 Jan 2021 01:41:45 +0100 Subject: [PATCH 135/303] [sway/window] Add app_id to usable fields in title --- src/modules/sway/window.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index e920345..d8f113f 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -56,7 +56,8 @@ auto Window::update() -> void { bar_.window.get_style_context()->remove_class("solo"); bar_.window.get_style_context()->remove_class("empty"); } - label_.set_markup(fmt::format(format_, window_)); + label_.set_markup(fmt::format(format_, fmt::arg("title", window_), + fmt::arg("app_id", app_id_))); if (tooltipEnabled()) { label_.set_tooltip_text(window_); } From 6cc32126052c58b8fd87cd400f4270151ffcafda Mon Sep 17 00:00:00 2001 From: nullobsi Date: Sat, 30 Jan 2021 18:04:59 -0800 Subject: [PATCH 136/303] add length limits for MPD module tags --- man/waybar-mpd.5.scd | 16 ++++++++++++++++ src/modules/mpd/mpd.cpp | 34 +++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/man/waybar-mpd.5.scd b/man/waybar-mpd.5.scd index 8c33c62..3f1ef9b 100644 --- a/man/waybar-mpd.5.scd +++ b/man/waybar-mpd.5.scd @@ -73,6 +73,22 @@ Addressed by *mpd* default: "MPD (disconnected)" ++ Tooltip information displayed when the MPD server can't be reached. +*artist-len*: ++ + typeof: integer ++ + Maximum length of the Artist tag. + +*album-len*: ++ + typeof: integer ++ + Maximum length of the Album tag. + +*album-artist-len*: ++ + typeof: integer ++ + Maximum length of the Album Artist tag. + +*title-len*: ++ + typeof: integer ++ + Maximum length of the Title tag. + *rotate*: ++ typeof: integer ++ Positive value to rotate the text label. diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index 98332dc..ab82224 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -2,7 +2,7 @@ #include #include - +#include #include "modules/mpd/state.hpp" #if defined(MPD_NOINLINE) namespace waybar::modules { @@ -98,8 +98,8 @@ void waybar::modules::MPD::setLabel() { } auto format = format_; - - std::string artist, album_artist, album, title, date; + Glib::ustring artist, album_artist, album, title; + std::string date; int song_pos = 0, queue_length = 0; std::chrono::seconds elapsedTime, totalTime; @@ -144,13 +144,25 @@ void waybar::modules::MPD::setLabel() { bool singleActivated = mpd_status_get_single(status_.get()); std::string singleIcon = getOptionIcon("single", singleActivated); + auto artistLen = config_["artist-len"].isInt() ? + config_["artist-len"].asInt() : artist.size(); + + auto albumArtistLen = config_["album-artist-len"].isInt() ? + config_["album-artist-len"].asInt() : album_artist.size(); + + auto albumLen = config_["album-len"].isInt() ? + config_["album-len"].asInt() : album.size(); + + auto titleLen = config_["title-len"].isInt() ? + config_["title-len"].asInt() : title.size(); + try { label_.set_markup( fmt::format(format, - fmt::arg("artist", Glib::Markup::escape_text(artist).raw()), - fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()), - fmt::arg("album", Glib::Markup::escape_text(album).raw()), - fmt::arg("title", Glib::Markup::escape_text(title).raw()), + fmt::arg("artist", Glib::Markup::escape_text(artist.substr(0, artistLen)).raw()), + fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist.substr(0, albumArtistLen)).raw()), + fmt::arg("album", Glib::Markup::escape_text(album.substr(0, albumLen)).raw()), + fmt::arg("title", Glib::Markup::escape_text(title.substr(0, titleLen)).raw()), fmt::arg("date", Glib::Markup::escape_text(date).raw()), fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), @@ -171,10 +183,10 @@ void waybar::modules::MPD::setLabel() { : "MPD (connected)"; try { auto tooltip_text = fmt::format(tooltip_format, - fmt::arg("artist", artist), - fmt::arg("albumArtist", album_artist), - fmt::arg("album", album), - fmt::arg("title", title), + fmt::arg("artist", artist.substr(0, artistLen).raw()), + fmt::arg("albumArtist", album_artist.substr(0, albumArtistLen).raw()), + fmt::arg("album", album.substr(0, albumLen).raw()), + fmt::arg("title", title.substr(0, titleLen).raw()), fmt::arg("date", date), fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), From 149c1c2f1b8b4c23f3bc7ea70d9cd503f29d9f31 Mon Sep 17 00:00:00 2001 From: Joshua Chapman Date: Sun, 31 Jan 2021 11:33:17 +0100 Subject: [PATCH 137/303] Update waybar-bluetooth.5.scd Remove the `status` from the `tooltip-format` example since it will throw error. Related to #685 --- man/waybar-bluetooth.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/waybar-bluetooth.5.scd b/man/waybar-bluetooth.5.scd index 8151ec0..5d7d7dd 100644 --- a/man/waybar-bluetooth.5.scd +++ b/man/waybar-bluetooth.5.scd @@ -85,7 +85,7 @@ Addressed by *bluetooth* "enabled": "", "disabled": "" }, - "tooltip-format": "{status}" + "tooltip-format": "{}" } ``` From 3881af4bbe6412248ac5dc72e55865ae755ee833 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Sun, 31 Jan 2021 15:37:26 -0400 Subject: [PATCH 138/303] Improved wlr/taskbar icon search. --- src/modules/wlr/taskbar.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 4cbb8ce..83ce366 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -26,19 +26,19 @@ const std::string WHITESPACE = " \n\r\t\f\v"; static std::string ltrim(const std::string& s) { - size_t start = s.find_first_not_of(WHITESPACE); - return (start == std::string::npos) ? "" : s.substr(start); + size_t start = s.find_first_not_of(WHITESPACE); + return (start == std::string::npos) ? "" : s.substr(start); } static std::string rtrim(const std::string& s) { - size_t end = s.find_last_not_of(WHITESPACE); - return (end == std::string::npos) ? "" : s.substr(0, end + 1); + size_t end = s.find_last_not_of(WHITESPACE); + return (end == std::string::npos) ? "" : s.substr(0, end + 1); } static std::string trim(const std::string& s) { - return rtrim(ltrim(s)); + return rtrim(ltrim(s)); } @@ -103,8 +103,8 @@ static std::string get_from_desktop_app_info(const std::string &app_id) /* Method 2 - use the app_id and check whether there is an icon with this name in the icon theme */ static std::string get_from_icon_theme(const Glib::RefPtr& icon_theme, - const std::string &app_id) { - + const std::string &app_id) +{ if (icon_theme->lookup_icon(app_id, 24)) return app_id; @@ -122,6 +122,10 @@ static bool image_load_icon(Gtk::Image& image, const Glib::RefPtr> app_id) { + size_t start = 0, end = app_id.size(); + start = app_id.rfind(".", end); + std::string app_name = app_id.substr(start+1, app_id.size()); + auto lower_app_id = app_id; std::transform(lower_app_id.begin(), lower_app_id.end(), lower_app_id.begin(), [](char c){ return std::tolower(c); }); @@ -130,10 +134,14 @@ static bool image_load_icon(Gtk::Image& image, const Glib::RefPtr Date: Sun, 31 Jan 2021 11:53:53 -0800 Subject: [PATCH 139/303] Use g_unichar_iswide to properly align calendar on CJK locales --- include/util/ustring_clen.hpp | 5 +++++ meson.build | 1 + src/modules/clock.cpp | 15 ++++++++++----- src/util/ustring_clen.cpp | 9 +++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 include/util/ustring_clen.hpp create mode 100644 src/util/ustring_clen.cpp diff --git a/include/util/ustring_clen.hpp b/include/util/ustring_clen.hpp new file mode 100644 index 0000000..cddd2e1 --- /dev/null +++ b/include/util/ustring_clen.hpp @@ -0,0 +1,5 @@ +#pragma once +#include + +// calculate column width of ustring +int ustring_clen(const Glib::ustring &str); \ No newline at end of file diff --git a/meson.build b/meson.build index 49e71f2..373ec86 100644 --- a/meson.build +++ b/meson.build @@ -147,6 +147,7 @@ src_files = files( 'src/main.cpp', 'src/bar.cpp', 'src/client.cpp', + 'src/util/ustring_clen.cpp' ) if is_linux diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 5b2c3f4..0aade69 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -5,6 +5,7 @@ #include #include +#include "util/ustring_clen.hpp" #ifdef HAVE_LANGINFO_1STDAY #include #include @@ -154,12 +155,16 @@ auto waybar::modules::Clock::weekdays_header(const date::weekday& first_dow, std do { if (wd != first_dow) os << ' '; Glib::ustring wd_ustring(date::format(locale_, "%a", wd)); - auto wd_len = wd_ustring.length(); - if (wd_len > 2) { - wd_ustring = wd_ustring.substr(0, 2); - wd_len = 2; + auto clen = ustring_clen(wd_ustring); + auto wd_len = wd_ustring.length(); + fmt::print("{} {}\n", clen, wd_len); + while (clen > 2) { + wd_ustring = wd_ustring.substr(0, wd_len-1); + wd_len--; + clen = ustring_clen(wd_ustring); } - const std::string pad(2 - wd_len, ' '); + fmt::print("{} {}", clen, wd_len); + const std::string pad(2 - clen, ' '); os << pad << wd_ustring; } while (++wd != first_dow); os << "\n"; diff --git a/src/util/ustring_clen.cpp b/src/util/ustring_clen.cpp new file mode 100644 index 0000000..cd7d9cf --- /dev/null +++ b/src/util/ustring_clen.cpp @@ -0,0 +1,9 @@ +#include "util/ustring_clen.hpp" + +int ustring_clen(const Glib::ustring &str){ + int total = 0; + for (auto i = str.begin(); i != str.end(); ++i) { + total += g_unichar_iswide(*i) + 1; + } + return total; +} \ No newline at end of file From ecba117dc05b6677c951c4b1c3f1dd2442494aab Mon Sep 17 00:00:00 2001 From: nullobsi Date: Sun, 31 Jan 2021 11:56:25 -0800 Subject: [PATCH 140/303] remove unnessecary logging --- src/modules/clock.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 0aade69..22bedc7 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -157,13 +157,11 @@ auto waybar::modules::Clock::weekdays_header(const date::weekday& first_dow, std Glib::ustring wd_ustring(date::format(locale_, "%a", wd)); auto clen = ustring_clen(wd_ustring); auto wd_len = wd_ustring.length(); - fmt::print("{} {}\n", clen, wd_len); while (clen > 2) { wd_ustring = wd_ustring.substr(0, wd_len-1); wd_len--; clen = ustring_clen(wd_ustring); } - fmt::print("{} {}", clen, wd_len); const std::string pad(2 - clen, ' '); os << pad << wd_ustring; } while (++wd != first_dow); From 8c70513a248fb9c22ff37d14e9a06b983099ab71 Mon Sep 17 00:00:00 2001 From: nullobsi Date: Sun, 31 Jan 2021 13:58:41 -0800 Subject: [PATCH 141/303] add common `align` config property to set text alignment add fixed-length property to set the fixed width of the label --- src/ALabel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 9371a0e..4d15cc1 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -28,6 +28,15 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st label_.set_single_line_mode(true); } + if (config_["fixed-length"].isUInt()) { + label_.set_width_chars(config_["fixed-length"].asUInt()); + } + + if (config_["align"].isDouble()) { + auto align = config_["align"].asFloat(); + label_.set_xalign(align); + } + if (config_["rotate"].isUInt()) { label_.set_angle(config["rotate"].asUInt()); } From c8d7b6fa92ea006d35b4c425fb38fb8fe83f7d98 Mon Sep 17 00:00:00 2001 From: nullobsi Date: Sun, 31 Jan 2021 14:03:49 -0800 Subject: [PATCH 142/303] rename fixed-length to min-length --- src/ALabel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 4d15cc1..ed5740a 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -20,7 +20,7 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st } event_box_.add(label_); if (config_["max-length"].isUInt()) { - label_.set_max_width_chars(config_["max-length"].asUInt()); + label_.set_max_width_chars(config_["max-length"].asInt()); label_.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END); label_.set_single_line_mode(true); } else if (ellipsize && label_.get_max_width_chars() == -1) { @@ -28,8 +28,8 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st label_.set_single_line_mode(true); } - if (config_["fixed-length"].isUInt()) { - label_.set_width_chars(config_["fixed-length"].asUInt()); + if (config_["min-length"].isUInt()) { + label_.set_width_chars(config_["min-length"].asUInt()); } if (config_["align"].isDouble()) { From 72cd753c0259f695adc4bf372048256bc403a47d Mon Sep 17 00:00:00 2001 From: nullobsi Date: Mon, 1 Feb 2021 01:44:51 -0800 Subject: [PATCH 143/303] align should use rotate property --- src/ALabel.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index ed5740a..8d9c9b4 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -32,14 +32,24 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st label_.set_width_chars(config_["min-length"].asUInt()); } - if (config_["align"].isDouble()) { - auto align = config_["align"].asFloat(); - label_.set_xalign(align); - } + uint rotate = 0; if (config_["rotate"].isUInt()) { - label_.set_angle(config["rotate"].asUInt()); + rotate = config["rotate"].asUInt(); + label_.set_angle(rotate); } + + if (config_["align"].isDouble()) { + auto align = config_["align"].asFloat(); + if (rotate == 90 || rotate == 270) { + label_.set_yalign(align); + } else { + label_.set_xalign(align); + } + + } + + } auto ALabel::update() -> void { From 97f7050d7defb4dc3e23a1709ce063dbfaa38d9f Mon Sep 17 00:00:00 2001 From: nullobsi Date: Mon, 1 Feb 2021 08:34:51 -0800 Subject: [PATCH 144/303] Update man pages --- man/waybar-backlight.5.scd | 8 ++++++++ man/waybar-battery.5.scd | 8 ++++++++ man/waybar-bluetooth.5.scd | 8 ++++++++ man/waybar-clock.5.scd | 8 ++++++++ man/waybar-cpu.5.scd | 8 ++++++++ man/waybar-custom.5.scd | 8 ++++++++ man/waybar-disk.5.scd | 8 ++++++++ man/waybar-idle-inhibitor.5.scd | 8 ++++++++ man/waybar-memory.5.scd | 8 ++++++++ man/waybar-mpd.5.scd | 8 ++++++++ man/waybar-network.5.scd | 8 ++++++++ man/waybar-pulseaudio.5.scd | 8 ++++++++ man/waybar-sndio.5.scd | 8 ++++++++ man/waybar-sway-language.5.scd | 8 ++++++++ man/waybar-sway-mode.5.scd | 8 ++++++++ man/waybar-sway-window.5.scd | 8 ++++++++ man/waybar-temperature.5.scd | 8 ++++++++ 17 files changed, 136 insertions(+) diff --git a/man/waybar-backlight.5.scd b/man/waybar-backlight.5.scd index e6116e3..d14e4f2 100644 --- a/man/waybar-backlight.5.scd +++ b/man/waybar-backlight.5.scd @@ -24,6 +24,14 @@ The *backlight* module displays the current backlight level. typeof: integer ++ The maximum length in characters the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *rotate*: ++ typeof: integer ++ Positive value to rotate the text label. diff --git a/man/waybar-battery.5.scd b/man/waybar-battery.5.scd index a4650cd..48c2ee1 100644 --- a/man/waybar-battery.5.scd +++ b/man/waybar-battery.5.scd @@ -55,6 +55,14 @@ The *battery* module displays the current capacity and state (eg. charging) of y typeof: integer++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *rotate*: ++ typeof: integer++ Positive value to rotate the text label. diff --git a/man/waybar-bluetooth.5.scd b/man/waybar-bluetooth.5.scd index 5d7d7dd..0cd9386 100644 --- a/man/waybar-bluetooth.5.scd +++ b/man/waybar-bluetooth.5.scd @@ -35,6 +35,14 @@ Addressed by *bluetooth* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-clock.5.scd b/man/waybar-clock.5.scd index 9f36c43..28688ee 100644 --- a/man/waybar-clock.5.scd +++ b/man/waybar-clock.5.scd @@ -45,6 +45,14 @@ The *clock* module displays the current date and time. typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *rotate*: ++ typeof: integer ++ Positive value to rotate the text label. diff --git a/man/waybar-cpu.5.scd b/man/waybar-cpu.5.scd index cb83134..c8b12e2 100644 --- a/man/waybar-cpu.5.scd +++ b/man/waybar-cpu.5.scd @@ -24,6 +24,14 @@ The *cpu* module displays the current cpu utilization. typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *rotate*: ++ typeof: integer ++ Positive value to rotate the text label. diff --git a/man/waybar-custom.5.scd b/man/waybar-custom.5.scd index 3e820c6..8f9dcfa 100644 --- a/man/waybar-custom.5.scd +++ b/man/waybar-custom.5.scd @@ -67,6 +67,14 @@ Addressed by *custom/* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-disk.5.scd b/man/waybar-disk.5.scd index 431d7c8..5879714 100644 --- a/man/waybar-disk.5.scd +++ b/man/waybar-disk.5.scd @@ -39,6 +39,14 @@ Addressed by *disk* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-idle-inhibitor.5.scd b/man/waybar-idle-inhibitor.5.scd index 9d231d8..0b0bdd0 100644 --- a/man/waybar-idle-inhibitor.5.scd +++ b/man/waybar-idle-inhibitor.5.scd @@ -27,6 +27,14 @@ screensaving, also known as "presentation mode". typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. A click also toggles the state diff --git a/man/waybar-memory.5.scd b/man/waybar-memory.5.scd index 81c6216..3ff4c35 100644 --- a/man/waybar-memory.5.scd +++ b/man/waybar-memory.5.scd @@ -34,6 +34,14 @@ Addressed by *memory* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-mpd.5.scd b/man/waybar-mpd.5.scd index 8c33c62..5bbc00a 100644 --- a/man/waybar-mpd.5.scd +++ b/man/waybar-mpd.5.scd @@ -81,6 +81,14 @@ Addressed by *mpd* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-network.5.scd b/man/waybar-network.5.scd index ab459ae..f274881 100644 --- a/man/waybar-network.5.scd +++ b/man/waybar-network.5.scd @@ -64,6 +64,14 @@ Addressed by *network* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-pulseaudio.5.scd b/man/waybar-pulseaudio.5.scd index c3f50e0..d894290 100644 --- a/man/waybar-pulseaudio.5.scd +++ b/man/waybar-pulseaudio.5.scd @@ -50,6 +50,14 @@ Additionally you can control the volume by scrolling *up* or *down* while the cu typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *scroll-step*: ++ typeof: float ++ default: 1.0 ++ diff --git a/man/waybar-sndio.5.scd b/man/waybar-sndio.5.scd index a61c332..90a73f4 100644 --- a/man/waybar-sndio.5.scd +++ b/man/waybar-sndio.5.scd @@ -26,6 +26,14 @@ cursor is over the module, and clicking on the module toggles mute. typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *scroll-step*: ++ typeof: int ++ default: 5 ++ diff --git a/man/waybar-sway-language.5.scd b/man/waybar-sway-language.5.scd index a288cca..769924f 100644 --- a/man/waybar-sway-language.5.scd +++ b/man/waybar-sway-language.5.scd @@ -25,6 +25,14 @@ Addressed by *sway/language* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-sway-mode.5.scd b/man/waybar-sway-mode.5.scd index 958a1ed..b8b59cd 100644 --- a/man/waybar-sway-mode.5.scd +++ b/man/waybar-sway-mode.5.scd @@ -25,6 +25,14 @@ Addressed by *sway/mode* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-sway-window.5.scd b/man/waybar-sway-window.5.scd index 4863a76..40250e6 100644 --- a/man/waybar-sway-window.5.scd +++ b/man/waybar-sway-window.5.scd @@ -25,6 +25,14 @@ Addressed by *sway/window* typeof: integer ++ The maximum length in character the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when clicked on the module. diff --git a/man/waybar-temperature.5.scd b/man/waybar-temperature.5.scd index 7810a59..8d11e51 100644 --- a/man/waybar-temperature.5.scd +++ b/man/waybar-temperature.5.scd @@ -63,6 +63,14 @@ Addressed by *temperature* typeof: integer ++ The maximum length in characters the module should display. +*min-length*: ++ + typeof: integer ++ + The minimum length in characters the module should take up. + +*align*: ++ + typeof: float ++ + The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. + *on-click*: ++ typeof: string ++ Command to execute when you clicked on the module. From ac6667b1c979aa9493c4ae033d121a712743e484 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Tue, 2 Feb 2021 01:03:28 -0400 Subject: [PATCH 145/303] [wlr/taskbar] More icon search improvements. * Added ~/.local/share prefix to search in user defined apps. * Add support for apps that don't properly set an id like pamac. --- src/modules/wlr/taskbar.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 83ce366..15b927a 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -15,6 +15,7 @@ #include #include +#include #include @@ -64,6 +65,9 @@ static std::vector search_prefix() } while(end != std::string::npos); } + std::string home_dir = std::getenv("HOME"); + prefixes.push_back(home_dir + "/.local/share/"); + for (auto& p : prefixes) spdlog::debug("Using 'desktop' search path prefix: {}", p); @@ -111,6 +115,26 @@ static std::string get_from_icon_theme(const Glib::RefPtr& icon_ return ""; } +/* Method 3 - as last resort perform a search for most appropriate desktop info file */ +static std::string get_from_desktop_app_info_search(const std::string &app_id) +{ + std::string desktop_file = ""; + + gchar*** desktop_list = g_desktop_app_info_search(app_id.c_str()); + if (desktop_list != nullptr && desktop_list[0] != nullptr) { + for (size_t i=0; desktop_list[0][i]; i++) { + if(desktop_file == "") { + desktop_file = desktop_list[0][i]; + } + break; + } + g_strfreev(desktop_list[0]); + } + g_free(desktop_list); + + return get_from_desktop_app_info(desktop_file); +} + static bool image_load_icon(Gtk::Image& image, const Glib::RefPtr& icon_theme, const std::string &app_id_list, int size) { @@ -142,9 +166,11 @@ static bool image_load_icon(Gtk::Image& image, const Glib::RefPtrload_icon(icon_name, size, Gtk::ICON_LOOKUP_FORCE_SIZE); if (pixbuf) { From 7eb2a6b7090c371656dd2df7fd44af6d430b43cb Mon Sep 17 00:00:00 2001 From: Genesis Date: Tue, 2 Feb 2021 21:58:26 +0100 Subject: [PATCH 146/303] Add a configuration entry to disable auto_back_and_forth on Sway workspaces --- include/modules/sway/workspaces.hpp | 2 +- man/waybar-sway-workspaces.5.scd | 12 ++++++++---- src/modules/sway/workspaces.cpp | 14 ++++++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/include/modules/sway/workspaces.hpp b/include/modules/sway/workspaces.hpp index 92ec051..c644383 100644 --- a/include/modules/sway/workspaces.hpp +++ b/include/modules/sway/workspaces.hpp @@ -20,7 +20,7 @@ class Workspaces : public AModule, public sigc::trackable { auto update() -> void; private: - static inline const std::string workspace_switch_cmd_ = "workspace --no-auto-back-and-forth \"{}\""; + static inline const std::string workspace_switch_cmd_ = "workspace {} \"{}\""; static int convertWorkspaceNameToNum(std::string name); diff --git a/man/waybar-sway-workspaces.5.scd b/man/waybar-sway-workspaces.5.scd index 5e51689..f2808b9 100644 --- a/man/waybar-sway-workspaces.5.scd +++ b/man/waybar-sway-workspaces.5.scd @@ -66,12 +66,16 @@ Addressed by *sway/workspaces* Lists workspaces that should always be shown, even when non existent *on-update*: ++ - typeof: string ++ - Command to execute when the module is updated. + typeof: string ++ + Command to execute when the module is updated. *numeric-first*: ++ - typeof: bool ++ - Whether to put workspaces starting with numbers before workspaces that do not start with a number. + typeof: bool ++ + Whether to put workspaces starting with numbers before workspaces that do not start with a number. + +*disable-auto-back-and-forth*: ++ + typeof: bool ++ + Whether to disable *workspace_auto_back_and_forth* when clicking on workspaces. If this is set to *true*, clicking on a workspace you are already on won't do anything, even if *workspace_auto_back_and_forth* is enabled in the Sway configuration. # FORMAT REPLACEMENTS diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index d0c2463..43dcf33 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -257,11 +257,19 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) { ipc_.sendCmd( IPC_COMMAND, fmt::format(workspace_switch_cmd_ + "; move workspace to output \"{}\"; " + workspace_switch_cmd_, + "--no-auto-back-and-forth", node["name"].asString(), node["target_output"].asString(), + "--no-auto-back-and-forth", node["name"].asString())); } else { - ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, node["name"].asString())); + ipc_.sendCmd( + IPC_COMMAND, + fmt::format("workspace {} \"{}\"", + config_["disable-auto-back-and-forth"].asBool() + ? "--no-auto-back-and-forth" + : "", + node["name"].asString())); } } catch (const std::exception &e) { spdlog::error("Workspaces: {}", e.what()); @@ -322,7 +330,9 @@ bool Workspaces::handleScroll(GdkEventScroll *e) { } } try { - ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, name)); + ipc_.sendCmd( + IPC_COMMAND, + fmt::format(workspace_switch_cmd_, "--no-auto-back-and-forth", name)); } catch (const std::exception &e) { spdlog::error("Workspaces: {}", e.what()); } From 22ed153004e904ed58fe3d4817576552ff1fa57b Mon Sep 17 00:00:00 2001 From: jgmdev Date: Wed, 3 Feb 2021 21:04:10 -0400 Subject: [PATCH 147/303] [wlr/taskbar] Fix unhandled exception crash when icon name is a path. --- src/modules/wlr/taskbar.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 15b927a..93c6a77 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -1,5 +1,7 @@ #include "modules/wlr/taskbar.hpp" +#include "glibmm/error.h" +#include "glibmm/fileutils.h" #include "glibmm/refptr.h" #include "util/format.hpp" @@ -74,6 +76,18 @@ static std::vector search_prefix() return prefixes; } +Glib::RefPtr load_icon_from_file(std::string icon_path, int size) +{ + try { + auto pb = Gdk::Pixbuf::create_from_file(icon_path, size, size); + return pb; + } catch(Glib::Error&) { + return {}; + } catch(...) { + return {}; + } +} + /* Method 1 - get the correct icon name from the desktop file */ static std::string get_from_desktop_app_info(const std::string &app_id) { @@ -172,7 +186,17 @@ static bool image_load_icon(Gtk::Image& image, const Glib::RefPtrload_icon(icon_name, size, Gtk::ICON_LOOKUP_FORCE_SIZE); + Glib::RefPtr pixbuf; + + try { + pixbuf = icon_theme->load_icon(icon_name, size, Gtk::ICON_LOOKUP_FORCE_SIZE); + } catch(...) { + if (Glib::file_test(icon_name, Glib::FILE_TEST_EXISTS)) + pixbuf = load_icon_from_file(icon_name, size); + else + pixbuf = {}; + } + if (pixbuf) { image.set(pixbuf); found = true; From 8a284e7c74e25c07a603612393a9a07bf31baee7 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Wed, 3 Feb 2021 21:14:04 -0400 Subject: [PATCH 148/303] [wlr/taskbar] Declared load_icon_from_file() static. --- src/modules/wlr/taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 93c6a77..1135a8e 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -76,7 +76,7 @@ static std::vector search_prefix() return prefixes; } -Glib::RefPtr load_icon_from_file(std::string icon_path, int size) +static Glib::RefPtr load_icon_from_file(std::string icon_path, int size) { try { auto pb = Gdk::Pixbuf::create_from_file(icon_path, size, size); From e293b89f6ba08ca92c834bad4473d708530521de Mon Sep 17 00:00:00 2001 From: jgmdev Date: Thu, 4 Feb 2021 04:57:08 -0400 Subject: [PATCH 149/303] [wlr/taskbar] Removed unnecessary catch statement. --- src/modules/wlr/taskbar.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 1135a8e..c2acbd9 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -81,8 +81,6 @@ static Glib::RefPtr load_icon_from_file(std::string icon_path, int try { auto pb = Gdk::Pixbuf::create_from_file(icon_path, size, size); return pb; - } catch(Glib::Error&) { - return {}; } catch(...) { return {}; } From fffb52dd936b7e633996e1a506577c7409cef1fc Mon Sep 17 00:00:00 2001 From: jgmdev Date: Sun, 7 Feb 2021 00:50:52 -0400 Subject: [PATCH 150/303] [wlr/taskbar] Check StartupWMClass on list returned by g_desktop_app_info_searchi() --- src/modules/wlr/taskbar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index c2acbd9..e91b19a 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -137,8 +137,13 @@ static std::string get_from_desktop_app_info_search(const std::string &app_id) for (size_t i=0; desktop_list[0][i]; i++) { if(desktop_file == "") { desktop_file = desktop_list[0][i]; + } else { + auto tmp_info = Gio::DesktopAppInfo::create(desktop_list[0][i]); + auto startup_class = tmp_info->get_startup_wm_class(); + + if (startup_class == app_id) + desktop_file = desktop_list[0][i]; } - break; } g_strfreev(desktop_list[0]); } From f14a73584f4eeb1c2c761ba293ad616cb7020975 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Sun, 7 Feb 2021 01:01:57 -0400 Subject: [PATCH 151/303] [wlr/taskbar] Added break when matching StartupWMClass is found. --- src/modules/wlr/taskbar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index e91b19a..08e8bf3 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -141,8 +141,10 @@ static std::string get_from_desktop_app_info_search(const std::string &app_id) auto tmp_info = Gio::DesktopAppInfo::create(desktop_list[0][i]); auto startup_class = tmp_info->get_startup_wm_class(); - if (startup_class == app_id) + if (startup_class == app_id) { desktop_file = desktop_list[0][i]; + break; + } } } g_strfreev(desktop_list[0]); From e4a65c72dd8d48a787f065ce330230c45b2e74cb Mon Sep 17 00:00:00 2001 From: jgmdev Date: Sun, 7 Feb 2021 04:27:16 -0400 Subject: [PATCH 152/303] Added missing 'if' space. --- src/modules/wlr/taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 08e8bf3..ef46f36 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -135,7 +135,7 @@ static std::string get_from_desktop_app_info_search(const std::string &app_id) gchar*** desktop_list = g_desktop_app_info_search(app_id.c_str()); if (desktop_list != nullptr && desktop_list[0] != nullptr) { for (size_t i=0; desktop_list[0][i]; i++) { - if(desktop_file == "") { + if (desktop_file == "") { desktop_file = desktop_list[0][i]; } else { auto tmp_info = Gio::DesktopAppInfo::create(desktop_list[0][i]); From 65853812306414b525ea6beb25dc915249dc922e Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 8 Feb 2021 22:30:01 -0800 Subject: [PATCH 153/303] fix(client): remove unnecessary wl_output_roundtrip At this point we're not awaiting any protocol events and flushing wayland queue makes little sense. As #1019 shows, it may be even harmful as an extra roundtrip could process wl_output disappearance and delete output object right from under our code. --- src/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client.cpp b/src/client.cpp index 0ad4e6b..9983bb5 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -124,7 +124,6 @@ void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_ auto configs = client->getOutputConfigs(output); if (!configs.empty()) { - wl_display_roundtrip(client->wl_display); for (const auto &config : configs) { client->bars.emplace_back(std::make_unique(&output, config)); } From 89b5e819a34388e39829bd3cbe52d5fb28a08297 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 8 Feb 2021 23:05:31 -0800 Subject: [PATCH 154/303] fix(client): improve guard from repeated xdg_output.done events Multiple .done events may arrive in batch. In this case libwayland would queue xdg_output.destroy and dispatch all pending events, triggering this callback several times for the same output. Delete xdg_output pointer immediately on the first event and use the value as a guard for reentering. --- src/client.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 9983bb5..fcfcd98 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -120,16 +120,26 @@ void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_ auto client = waybar::Client::inst(); try { auto &output = client->getOutput(data); - spdlog::debug("Output detection done: {} ({})", output.name, output.identifier); + /** + * Multiple .done events may arrive in batch. In this case libwayland would queue + * xdg_output.destroy and dispatch all pending events, triggering this callback several times + * for the same output. .done events can also arrive after that for a scale or position changes. + * We wouldn't want to draw a duplicate bar for each such event either. + * + * All the properties we care about are immutable so it's safe to delete the xdg_output object + * on the first event and use the ptr value to check that the callback was already invoked. + */ + if (output.xdg_output) { + output.xdg_output.reset(); + spdlog::debug("Output detection done: {} ({})", output.name, output.identifier); - auto configs = client->getOutputConfigs(output); - if (!configs.empty()) { - for (const auto &config : configs) { - client->bars.emplace_back(std::make_unique(&output, config)); + auto configs = client->getOutputConfigs(output); + if (!configs.empty()) { + for (const auto &config : configs) { + client->bars.emplace_back(std::make_unique(&output, config)); + } } } - // unsubscribe - output.xdg_output.reset(); } catch (const std::exception &e) { std::cerr << e.what() << std::endl; } From 95a6689077b5a42833ba3a228f0e56e7a4b71d66 Mon Sep 17 00:00:00 2001 From: Andy Russell Date: Mon, 8 Feb 2021 23:52:29 -0500 Subject: [PATCH 155/303] disable Idle Inhibitor module if unsupported --- src/modules/idle_inhibitor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/idle_inhibitor.cpp b/src/modules/idle_inhibitor.cpp index 9978bba..26889c2 100644 --- a/src/modules/idle_inhibitor.cpp +++ b/src/modules/idle_inhibitor.cpp @@ -12,6 +12,10 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar& bar_(bar), idle_inhibitor_(nullptr), pid_(-1) { + if (waybar::Client::inst()->idle_inhibit_manager == nullptr) { + throw std::runtime_error("idle-inhibit not available"); + } + event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.signal_button_press_event().connect( sigc::mem_fun(*this, &IdleInhibitor::handleToggle)); From 40f4dc9ecf26a8d9cd8d33b9bc88ff4dd6b3e508 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 1 Feb 2021 18:50:45 -0800 Subject: [PATCH 156/303] fix(rfkill): accept events larger than v1 event size Kernel 5.11 added one more field to the `struct rfkill_event` and broke unnecessarily strict check in `rfkill.cpp`. According to `linux/rfkill.h`, we must accept events at least as large as v1 event size and should be prepared to get additional fields at the end of a v1 event structure. --- src/util/rfkill.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/rfkill.cpp b/src/util/rfkill.cpp index 82d29e9..e968ca1 100644 --- a/src/util/rfkill.cpp +++ b/src/util/rfkill.cpp @@ -61,7 +61,7 @@ void waybar::util::Rfkill::waitForEvent() { break; } - if (len != RFKILL_EVENT_SIZE_V1) { + if (len < RFKILL_EVENT_SIZE_V1) { throw std::runtime_error("Wrong size of RFKILL event"); continue; } From 38c29fc2426557b43af91e7557c40f7880aaa0b8 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 2 Feb 2021 19:17:06 -0800 Subject: [PATCH 157/303] refactor(rfkill): poll rfkill events from Glib main loop Open rfkill device only once per module. Remove rfkill threads and use `Glib::signal_io` as a more efficient way to poll the rfkill device. Handle runtime errors from rfkill and stop polling of the device instead of crashing waybar. --- include/modules/bluetooth.hpp | 16 ++++---- include/modules/network.hpp | 2 - include/util/rfkill.hpp | 15 +++++-- src/modules/bluetooth.cpp | 8 +--- src/modules/network.cpp | 17 ++++---- src/util/rfkill.cpp | 73 ++++++++++++++++++----------------- 6 files changed, 64 insertions(+), 67 deletions(-) diff --git a/include/modules/bluetooth.hpp b/include/modules/bluetooth.hpp index 04c213d..716df0e 100644 --- a/include/modules/bluetooth.hpp +++ b/include/modules/bluetooth.hpp @@ -1,11 +1,11 @@ #pragma once -#include -#include "ALabel.hpp" - #include -#include "util/sleeper_thread.hpp" +#include + +#include "ALabel.hpp" #include "util/rfkill.hpp" +#include "util/sleeper_thread.hpp" namespace waybar::modules { @@ -16,11 +16,9 @@ class Bluetooth : public ALabel { auto update() -> void; private: - std::string status_; - util::SleeperThread thread_; - util::SleeperThread intervall_thread_; - - util::Rfkill rfkill_; + std::string status_; + util::SleeperThread thread_; + util::Rfkill rfkill_; }; } // namespace waybar::modules diff --git a/include/modules/network.hpp b/include/modules/network.hpp index c02d3c5..539f458 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -75,8 +75,6 @@ class Network : public ALabel { util::SleeperThread thread_; util::SleeperThread thread_timer_; #ifdef WANT_RFKILL - util::SleeperThread thread_rfkill_; - util::Rfkill rfkill_; #endif }; diff --git a/include/util/rfkill.hpp b/include/util/rfkill.hpp index ac3d406..5d519ca 100644 --- a/include/util/rfkill.hpp +++ b/include/util/rfkill.hpp @@ -1,19 +1,26 @@ #pragma once +#include #include +#include +#include namespace waybar::util { -class Rfkill { +class Rfkill : public sigc::trackable { public: Rfkill(enum rfkill_type rfkill_type); - ~Rfkill() = default; - void waitForEvent(); + ~Rfkill(); bool getState() const; + sigc::signal on_update; + private: enum rfkill_type rfkill_type_; - int state_ = 0; + bool state_ = false; + int fd_ = -1; + + bool on_event(Glib::IOCondition cond); }; } // namespace waybar::util diff --git a/src/modules/bluetooth.cpp b/src/modules/bluetooth.cpp index b390976..9939cc1 100644 --- a/src/modules/bluetooth.cpp +++ b/src/modules/bluetooth.cpp @@ -1,17 +1,11 @@ #include "modules/bluetooth.hpp" -#include "util/rfkill.hpp" -#include -#include waybar::modules::Bluetooth::Bluetooth(const std::string& id, const Json::Value& config) : ALabel(config, "bluetooth", id, "{icon}", 10), status_("disabled"), rfkill_{RFKILL_TYPE_BLUETOOTH} { + rfkill_.on_update.connect(sigc::hide(sigc::mem_fun(*this, &Bluetooth::update))); thread_ = [this] { - dp.emit(); - rfkill_.waitForEvent(); - }; - intervall_thread_ = [this] { auto now = std::chrono::system_clock::now(); auto timeout = std::chrono::floor(now + interval_); auto diff = std::chrono::seconds(timeout.time_since_epoch().count() % interval_.count()); diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 7d9da8b..41bc9d5 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -212,18 +212,15 @@ void waybar::modules::Network::worker() { thread_timer_.sleep_for(interval_); }; #ifdef WANT_RFKILL - thread_rfkill_ = [this] { - rfkill_.waitForEvent(); - { - std::lock_guard lock(mutex_); - if (ifid_ > 0) { - getInfo(); - dp.emit(); - } + rfkill_.on_update.connect([this](auto &) { + std::lock_guard lock(mutex_); + if (ifid_ > 0) { + getInfo(); + dp.emit(); } - }; + }); #else - spdlog::warn("Waybar has been built without rfkill support."); + spdlog::warn("Waybar has been built without rfkill support."); #endif thread_ = [this] { std::array events{}; diff --git a/src/util/rfkill.cpp b/src/util/rfkill.cpp index e968ca1..d3eb516 100644 --- a/src/util/rfkill.cpp +++ b/src/util/rfkill.cpp @@ -19,60 +19,63 @@ #include "util/rfkill.hpp" #include +#include #include -#include -#include +#include #include #include -#include -#include -waybar::util::Rfkill::Rfkill(const enum rfkill_type rfkill_type) : rfkill_type_(rfkill_type) {} - -void waybar::util::Rfkill::waitForEvent() { - struct rfkill_event event; - struct pollfd p; - ssize_t len; - int fd, n; - - fd = open("/dev/rfkill", O_RDONLY); - if (fd < 0) { - throw std::runtime_error("Can't open RFKILL control device"); +waybar::util::Rfkill::Rfkill(const enum rfkill_type rfkill_type) : rfkill_type_(rfkill_type) { + fd_ = open("/dev/rfkill", O_RDONLY); + if (fd_ < 0) { + spdlog::error("Can't open RFKILL control device"); return; } + int rc = fcntl(fd_, F_SETFL, O_NONBLOCK); + if (rc < 0) { + spdlog::error("Can't set RFKILL control device to non-blocking: {}", errno); + close(fd_); + fd_ = -1; + return; + } + Glib::signal_io().connect( + sigc::mem_fun(*this, &Rfkill::on_event), fd_, Glib::IO_IN | Glib::IO_ERR | Glib::IO_HUP); +} - memset(&p, 0, sizeof(p)); - p.fd = fd; - p.events = POLLIN | POLLHUP; +waybar::util::Rfkill::~Rfkill() { + if (fd_ >= 0) { + close(fd_); + } +} - while (1) { - n = poll(&p, 1, -1); - if (n < 0) { - throw std::runtime_error("Failed to poll RFKILL control device"); - break; - } +bool waybar::util::Rfkill::on_event(Glib::IOCondition cond) { + if (cond & Glib::IO_IN) { + struct rfkill_event event; + ssize_t len; - if (n == 0) continue; - - len = read(fd, &event, sizeof(event)); + len = read(fd_, &event, sizeof(event)); if (len < 0) { - throw std::runtime_error("Reading of RFKILL events failed"); - break; + spdlog::error("Reading of RFKILL events failed: {}", errno); + return false; } if (len < RFKILL_EVENT_SIZE_V1) { - throw std::runtime_error("Wrong size of RFKILL event"); - continue; + if (errno != EAGAIN) { + spdlog::error("Wrong size of RFKILL event: {}", len); + } + return true; } - if (event.type == rfkill_type_ && event.op == RFKILL_OP_CHANGE) { + if (event.type == rfkill_type_ && (event.op == RFKILL_OP_ADD || event.op == RFKILL_OP_CHANGE)) { state_ = event.soft || event.hard; - break; + on_update.emit(event); } + return true; + } else { + spdlog::error("Failed to poll RFKILL control device"); + return false; } - - close(fd); } bool waybar::util::Rfkill::getState() const { return state_; } From ecc32ddd185b112b101891200d127dc319a58ca5 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 2 Feb 2021 20:01:01 -0800 Subject: [PATCH 158/303] refactor(bluetooth): remove Bluetooth::status_ The string was always overwritten in `update()`; don't need to store temporary value in the class. --- include/modules/bluetooth.hpp | 4 ---- src/modules/bluetooth.cpp | 21 +++++++-------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/include/modules/bluetooth.hpp b/include/modules/bluetooth.hpp index 716df0e..4d7b7c8 100644 --- a/include/modules/bluetooth.hpp +++ b/include/modules/bluetooth.hpp @@ -1,8 +1,5 @@ #pragma once -#include -#include - #include "ALabel.hpp" #include "util/rfkill.hpp" #include "util/sleeper_thread.hpp" @@ -16,7 +13,6 @@ class Bluetooth : public ALabel { auto update() -> void; private: - std::string status_; util::SleeperThread thread_; util::Rfkill rfkill_; }; diff --git a/src/modules/bluetooth.cpp b/src/modules/bluetooth.cpp index 9939cc1..0df404d 100644 --- a/src/modules/bluetooth.cpp +++ b/src/modules/bluetooth.cpp @@ -1,9 +1,9 @@ #include "modules/bluetooth.hpp" +#include + waybar::modules::Bluetooth::Bluetooth(const std::string& id, const Json::Value& config) - : ALabel(config, "bluetooth", id, "{icon}", 10), - status_("disabled"), - rfkill_{RFKILL_TYPE_BLUETOOTH} { + : ALabel(config, "bluetooth", id, "{icon}", 10), rfkill_{RFKILL_TYPE_BLUETOOTH} { rfkill_.on_update.connect(sigc::hide(sigc::mem_fun(*this, &Bluetooth::update))); thread_ = [this] { auto now = std::chrono::system_clock::now(); @@ -15,25 +15,18 @@ waybar::modules::Bluetooth::Bluetooth(const std::string& id, const Json::Value& } auto waybar::modules::Bluetooth::update() -> void { - if (rfkill_.getState()) { - status_ = "disabled"; - } else { - status_ = "enabled"; - } + std::string status = rfkill_.getState() ? "disabled" : "enabled"; label_.set_markup( - fmt::format( - format_, - fmt::arg("status", status_), - fmt::arg("icon", getIcon(0, status_)))); + fmt::format(format_, fmt::arg("status", status), fmt::arg("icon", getIcon(0, status)))); if (tooltipEnabled()) { if (config_["tooltip-format"].isString()) { auto tooltip_format = config_["tooltip-format"].asString(); - auto tooltip_text = fmt::format(tooltip_format, status_); + auto tooltip_text = fmt::format(tooltip_format, status); label_.set_tooltip_text(tooltip_text); } else { - label_.set_tooltip_text(status_); + label_.set_tooltip_text(status); } } } From 52dd3d2446a99ff822ae4fd913bdab3dc2c06d1c Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 2 Feb 2021 20:10:27 -0800 Subject: [PATCH 159/303] refactor(bluetooth): remove `interval` and timer thread The timer thread was always reading the same value from Rfkill state. --- include/modules/bluetooth.hpp | 4 +--- man/waybar-bluetooth.5.scd | 6 ------ src/modules/bluetooth.cpp | 7 ------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/include/modules/bluetooth.hpp b/include/modules/bluetooth.hpp index 4d7b7c8..87845c9 100644 --- a/include/modules/bluetooth.hpp +++ b/include/modules/bluetooth.hpp @@ -2,7 +2,6 @@ #include "ALabel.hpp" #include "util/rfkill.hpp" -#include "util/sleeper_thread.hpp" namespace waybar::modules { @@ -13,8 +12,7 @@ class Bluetooth : public ALabel { auto update() -> void; private: - util::SleeperThread thread_; - util::Rfkill rfkill_; + util::Rfkill rfkill_; }; } // namespace waybar::modules diff --git a/man/waybar-bluetooth.5.scd b/man/waybar-bluetooth.5.scd index 0cd9386..d4ecb1d 100644 --- a/man/waybar-bluetooth.5.scd +++ b/man/waybar-bluetooth.5.scd @@ -12,11 +12,6 @@ The *bluetooth* module displays information about the status of the device's blu Addressed by *bluetooth* -*interval*: ++ - typeof: integer ++ - default: 60 ++ - The interval in which the bluetooth state gets updated. - *format*: ++ typeof: string ++ default: *{icon}* ++ @@ -88,7 +83,6 @@ Addressed by *bluetooth* "bluetooth": { "format": "{icon}", "format-alt": "bluetooth: {status}", - "interval": 30, "format-icons": { "enabled": "", "disabled": "" diff --git a/src/modules/bluetooth.cpp b/src/modules/bluetooth.cpp index 0df404d..8852684 100644 --- a/src/modules/bluetooth.cpp +++ b/src/modules/bluetooth.cpp @@ -5,13 +5,6 @@ waybar::modules::Bluetooth::Bluetooth(const std::string& id, const Json::Value& config) : ALabel(config, "bluetooth", id, "{icon}", 10), rfkill_{RFKILL_TYPE_BLUETOOTH} { rfkill_.on_update.connect(sigc::hide(sigc::mem_fun(*this, &Bluetooth::update))); - thread_ = [this] { - auto now = std::chrono::system_clock::now(); - auto timeout = std::chrono::floor(now + interval_); - auto diff = std::chrono::seconds(timeout.time_since_epoch().count() % interval_.count()); - thread_.sleep_until(timeout - diff); - dp.emit(); - }; } auto waybar::modules::Bluetooth::update() -> void { From 6d5afdaa5fee87304fceb4b9d978b992bad32126 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 2 Feb 2021 20:56:00 -0800 Subject: [PATCH 160/303] fix(network): don't block the main thread on rfkill update Moving rfkill to the main event loop had unexpected side-effects. Notably, the network module mutex can block all the main thread events for several seconds while the network worker thread is sleeping. Instead of waiting for the mutex let's hope that the worker thread succeeds and schedule timer thread wakeup just in case. --- src/modules/network.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 41bc9d5..a8aaffa 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -213,11 +213,11 @@ void waybar::modules::Network::worker() { }; #ifdef WANT_RFKILL rfkill_.on_update.connect([this](auto &) { - std::lock_guard lock(mutex_); - if (ifid_ > 0) { - getInfo(); - dp.emit(); - } + /* If we are here, it's likely that the network thread already holds the mutex and will be + * holding it for a next few seconds. + * Let's delegate the update to the timer thread instead of blocking the main thread. + */ + thread_timer_.wake_up(); }); #else spdlog::warn("Waybar has been built without rfkill support."); From e786ea601ed0aba54338bb7ea1563f2f3ebd5ae0 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 10 Feb 2021 08:22:22 -0800 Subject: [PATCH 161/303] fix(rfkill): handle EAGAIN correctly --- src/util/rfkill.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/rfkill.cpp b/src/util/rfkill.cpp index d3eb516..7400135 100644 --- a/src/util/rfkill.cpp +++ b/src/util/rfkill.cpp @@ -56,14 +56,15 @@ bool waybar::util::Rfkill::on_event(Glib::IOCondition cond) { len = read(fd_, &event, sizeof(event)); if (len < 0) { + if (errno == EAGAIN) { + return true; + } spdlog::error("Reading of RFKILL events failed: {}", errno); return false; } if (len < RFKILL_EVENT_SIZE_V1) { - if (errno != EAGAIN) { - spdlog::error("Wrong size of RFKILL event: {}", len); - } + spdlog::error("Wrong size of RFKILL event: {} < {}", len, RFKILL_EVENT_SIZE_V1); return true; } From d8706af2ea7cb0f668cc26c449b3a9cc46516ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Fri, 12 Feb 2021 20:15:38 +0100 Subject: [PATCH 162/303] Terminate custom module scripts on exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Fixes #358.) Subprocesses created for custom module scripts were previously left running when the parent Waybar process exited. This patch sets the parent-death signal of child processes (PR_SET_PDEATHSIG on Linux, PROC_PDEATHSIG_CTL on FreeBSD) to SIGTERM. Caveats: * This uses Linux-specific or FreeBSD-specific calls. I don’t know if this project targets other systems? * There is a possibility that Waybar exits after calling `fork()`, but before calling `prctl` to set the parent-death signal. In this case, the child will not receive the SIGTERM signal and will continue to run. I did not handle this case as I consider it quite unlikely, since module scripts are usually launched only when Waybar starts. Please let me know if you think it needs to be handled. Testing: * With `htop` open, run Waybar v0.9.5 with a custom module that has an `exec` script. Terminate the Waybar process and notice that the script’s subprocess stays alive and is now a child of the init process. * Run Waybar with this patch and follow the same steps as above. Notice that this time the script’s subprocess terminates when the parent exits. --- include/util/command.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/util/command.hpp b/include/util/command.hpp index 5265558..3a38da3 100644 --- a/include/util/command.hpp +++ b/include/util/command.hpp @@ -5,6 +5,13 @@ #include #include +#ifdef __linux__ +#include +#endif +#ifdef __FreeBSD__ +#include +#endif + #include extern std::mutex reap_mtx; @@ -77,6 +84,18 @@ inline FILE* open(const std::string& cmd, int& pid) { // Reset sigmask err = pthread_sigmask(SIG_UNBLOCK, &mask, nullptr); if (err != 0) spdlog::error("pthread_sigmask in open failed: {}", strerror(err)); + // Kill child if Waybar exits + int deathsig = SIGTERM; +#ifdef __linux__ + if (prctl(PR_SET_PDEATHSIG, deathsig) != 0) { + spdlog::error("prctl(PR_SET_PDEATHSIG) in open failed: {}", strerror(errno)); + } +#endif +#ifdef __FreeBSD__ + if (procctl(P_PID, 0, PROC_PDEATHSIG_CTL, reinterpret_cast(&deathsig)) == -1) { + spdlog::error("procctl(PROC_PDEATHSIG_CTL) in open failed: {}", strerror(errno)); + } +#endif ::close(fd[0]); dup2(fd[1], 1); setpgid(child_pid, child_pid); From 2019028688cb5c03062281854855f05eeb9e606f Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Fri, 19 Feb 2021 14:33:38 +0100 Subject: [PATCH 163/303] Configure systemd.service file to allow reloading This allows `systemctl --user reload waybar` to reload waybar's config as expected. --- resources/waybar.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/waybar.service.in b/resources/waybar.service.in index af5832d..ef0d07e 100644 --- a/resources/waybar.service.in +++ b/resources/waybar.service.in @@ -6,6 +6,7 @@ After=graphical-session.target [Service] ExecStart=@prefix@/bin/waybar +ExecReload=kill -SIGUSR2 $MAINPID Restart=on-failure [Install] From 943ba3a2da2730d536a2f6409dfe61a8523239a6 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 9 Feb 2021 19:24:46 -0800 Subject: [PATCH 164/303] fix: schedule output destruction on idle callback Defer destruction of bars for the output to the next iteration of the event loop to avoid deleting objects referenced by currently executed code. --- include/client.hpp | 1 + src/client.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/client.hpp b/include/client.hpp index 5965f7c..ec3866a 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -51,6 +51,7 @@ class Client { static void handleOutputDescription(void *, struct zxdg_output_v1 *, const char *); void handleMonitorAdded(Glib::RefPtr monitor); void handleMonitorRemoved(Glib::RefPtr monitor); + void handleDeferredMonitorRemoval(Glib::RefPtr monitor); Json::Value config_; Glib::RefPtr style_context_; diff --git a/src/client.cpp b/src/client.cpp index fcfcd98..1c48c81 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -179,6 +179,16 @@ void waybar::Client::handleMonitorAdded(Glib::RefPtr monitor) { void waybar::Client::handleMonitorRemoved(Glib::RefPtr monitor) { spdlog::debug("Output removed: {} {}", monitor->get_manufacturer(), monitor->get_model()); + /* This event can be triggered from wl_display_roundtrip called by GTK or our code. + * Defer destruction of bars for the output to the next iteration of the event loop to avoid + * deleting objects referenced by currently executed code. + */ + Glib::signal_idle().connect_once( + sigc::bind(sigc::mem_fun(*this, &Client::handleDeferredMonitorRemoval), monitor), + Glib::PRIORITY_HIGH_IDLE); +} + +void waybar::Client::handleDeferredMonitorRemoval(Glib::RefPtr monitor) { for (auto it = bars.begin(); it != bars.end();) { if ((*it)->output->monitor == monitor) { auto output_name = (*it)->output->name; From 08ea5ebe1f7f2a3cdeba8f8bbeebcd8539fee359 Mon Sep 17 00:00:00 2001 From: Genesis Date: Tue, 2 Feb 2021 23:33:33 +0100 Subject: [PATCH 165/303] Add cpu frequency --- include/modules/cpu.hpp | 2 ++ man/waybar-cpu.5.scd | 6 ++++++ src/modules/cpu/bsd.cpp | 4 ++++ src/modules/cpu/common.cpp | 21 ++++++++++++++++++++- src/modules/cpu/linux.cpp | 21 +++++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/modules/cpu.hpp b/include/modules/cpu.hpp index 7a70336..6a9b586 100644 --- a/include/modules/cpu.hpp +++ b/include/modules/cpu.hpp @@ -22,7 +22,9 @@ class Cpu : public ALabel { private: uint16_t getCpuLoad(); std::tuple getCpuUsage(); + std::tuple getCpuFrequency(); std::vector> parseCpuinfo(); + std::vector parseCpuFrequencies(); std::vector> prev_times_; diff --git a/man/waybar-cpu.5.scd b/man/waybar-cpu.5.scd index c8b12e2..fbf6206 100644 --- a/man/waybar-cpu.5.scd +++ b/man/waybar-cpu.5.scd @@ -79,6 +79,12 @@ The *cpu* module displays the current cpu utilization. *{usage}*: Current cpu usage. +*{avg_frequency}*: Current cpu average frequency (based on all cores) in GHz. + +*{max_frequency}*: Current cpu max frequency (based on the core with the highest frequency) in GHz. + +*{min_frequency}*: Current cpu min frequency (based on the core with the lowest frequency) in GHz. + # EXAMPLE ``` diff --git a/src/modules/cpu/bsd.cpp b/src/modules/cpu/bsd.cpp index 73ab1e8..10f1838 100644 --- a/src/modules/cpu/bsd.cpp +++ b/src/modules/cpu/bsd.cpp @@ -95,3 +95,7 @@ std::vector> waybar::modules::Cpu::parseCpuinfo() { free(cp_time); return cpuinfo; } + +std::vector waybar::modules::Cpu::parseCpuFrequencies() { + throw std::runtime_error("Cpu frequency is not implemented on BSD."); +} diff --git a/src/modules/cpu/common.cpp b/src/modules/cpu/common.cpp index e86d10a..74f1e40 100644 --- a/src/modules/cpu/common.cpp +++ b/src/modules/cpu/common.cpp @@ -12,6 +12,7 @@ auto waybar::modules::Cpu::update() -> void { // TODO: as creating dynamic fmt::arg arrays is buggy we have to calc both auto cpu_load = getCpuLoad(); auto [cpu_usage, tooltip] = getCpuUsage(); + auto [max_frequency, min_frequency, avg_frequency] = getCpuFrequency(); if (tooltipEnabled()) { label_.set_tooltip_text(tooltip); } @@ -25,7 +26,12 @@ auto waybar::modules::Cpu::update() -> void { event_box_.hide(); } else { event_box_.show(); - label_.set_markup(fmt::format(format, fmt::arg("load", cpu_load), fmt::arg("usage", cpu_usage))); + label_.set_markup(fmt::format(format, + fmt::arg("load", cpu_load), + fmt::arg("usage", cpu_usage), + fmt::arg("max_frequency", max_frequency), + fmt::arg("min_frequency", min_frequency), + fmt::arg("avg_frequency", avg_frequency))); } // Call parent update @@ -64,3 +70,16 @@ std::tuple waybar::modules::Cpu::getCpuUsage() { prev_times_ = curr_times; return {usage, tooltip}; } + +std::tuple waybar::modules::Cpu::getCpuFrequency() { + std::vector frequencies = parseCpuFrequencies(); + auto [min, max] = std::minmax_element(std::begin(frequencies), std::end(frequencies)); + float avg_frequency = std::accumulate(std::begin(frequencies), std::end(frequencies), 0.0) / frequencies.size(); + + // Round frequencies with double decimal precision to get GHz + float max_frequency = std::ceil(*max / 10.0) / 100.0; + float min_frequency = std::ceil(*min / 10.0) / 100.0; + avg_frequency = std::ceil(avg_frequency / 10.0) / 100.0; + + return { max_frequency, min_frequency, avg_frequency }; +} diff --git a/src/modules/cpu/linux.cpp b/src/modules/cpu/linux.cpp index 9f1734f..b69f71a 100644 --- a/src/modules/cpu/linux.cpp +++ b/src/modules/cpu/linux.cpp @@ -27,3 +27,24 @@ std::vector> waybar::modules::Cpu::parseCpuinfo() { } return cpuinfo; } + +std::vector waybar::modules::Cpu::parseCpuFrequencies() { + const std::string file_path_ = "/proc/cpuinfo"; + std::ifstream info(file_path_); + if (!info.is_open()) { + throw std::runtime_error("Can't open " + file_path_); + } + std::vector frequencies; + std::string line; + while (getline(info, line)) { + if (line.substr(0, 7).compare("cpu MHz") != 0) { + continue; + } + + std::string frequency_str = line.substr(line.find(":") + 2); + float frequency = std::strtol(frequency_str.c_str(), nullptr, 10); + frequencies.push_back(frequency); + } + info.close(); + return frequencies; +} From 99643ba2e615daf27ae3d8662fc0cd3b122cc664 Mon Sep 17 00:00:00 2001 From: Genesis Date: Sun, 21 Feb 2021 21:57:55 +0100 Subject: [PATCH 166/303] Stub parseCpuFrequencies on *BSD platforms --- src/modules/cpu/bsd.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/cpu/bsd.cpp b/src/modules/cpu/bsd.cpp index 10f1838..a92252f 100644 --- a/src/modules/cpu/bsd.cpp +++ b/src/modules/cpu/bsd.cpp @@ -2,8 +2,10 @@ #include #include +#include #include // malloc #include // sysconf +#include // NAN #if defined(__NetBSD__) || defined(__OpenBSD__) # include @@ -97,5 +99,10 @@ std::vector> waybar::modules::Cpu::parseCpuinfo() { } std::vector waybar::modules::Cpu::parseCpuFrequencies() { - throw std::runtime_error("Cpu frequency is not implemented on BSD."); + static std::vector frequencies; + if (frequencies.empty()) { + spdlog::warn("cpu/bsd: parseCpuFrequencies is not implemented, expect garbage in {*_frequency}"); + frequencies.push_back(NAN); + } + return frequencies; } From 1573e1eb971877f54738f4b5c51dd1c613c1eb80 Mon Sep 17 00:00:00 2001 From: nullobsi Date: Fri, 26 Feb 2021 13:29:58 -0800 Subject: [PATCH 167/303] change variable instead of substr(len) --- src/modules/mpd/mpd.cpp | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index ab82224..6a828c3 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -143,26 +143,18 @@ void waybar::modules::MPD::setLabel() { std::string repeatIcon = getOptionIcon("repeat", repeatActivated); bool singleActivated = mpd_status_get_single(status_.get()); std::string singleIcon = getOptionIcon("single", singleActivated); - - auto artistLen = config_["artist-len"].isInt() ? - config_["artist-len"].asInt() : artist.size(); - - auto albumArtistLen = config_["album-artist-len"].isInt() ? - config_["album-artist-len"].asInt() : album_artist.size(); - - auto albumLen = config_["album-len"].isInt() ? - config_["album-len"].asInt() : album.size(); - - auto titleLen = config_["title-len"].isInt() ? - config_["title-len"].asInt() : title.size(); + if (config_["artist-len"].isInt()) artist = artist.substr(0, config_["artist-len"].asInt()); + if (config_["album-artist-len"].isInt()) album_artist = album_artist.substr(0, config_["album-artist-len"].asInt()); + if (config_["album-len"].isInt()) album = album.substr(0, config_["album-len"].asInt()); + if (config_["title-len"].isInt()) title = title.substr(0,config_["title-len"].asInt()); try { label_.set_markup( fmt::format(format, - fmt::arg("artist", Glib::Markup::escape_text(artist.substr(0, artistLen)).raw()), - fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist.substr(0, albumArtistLen)).raw()), - fmt::arg("album", Glib::Markup::escape_text(album.substr(0, albumLen)).raw()), - fmt::arg("title", Glib::Markup::escape_text(title.substr(0, titleLen)).raw()), + fmt::arg("artist", Glib::Markup::escape_text(artist).raw()), + fmt::arg("albumArtist", Glib::Markup::escape_text(album_artist).raw()), + fmt::arg("album", Glib::Markup::escape_text(album).raw()), + fmt::arg("title", Glib::Markup::escape_text(title).raw()), fmt::arg("date", Glib::Markup::escape_text(date).raw()), fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), @@ -183,10 +175,10 @@ void waybar::modules::MPD::setLabel() { : "MPD (connected)"; try { auto tooltip_text = fmt::format(tooltip_format, - fmt::arg("artist", artist.substr(0, artistLen).raw()), - fmt::arg("albumArtist", album_artist.substr(0, albumArtistLen).raw()), - fmt::arg("album", album.substr(0, albumLen).raw()), - fmt::arg("title", title.substr(0, titleLen).raw()), + fmt::arg("artist", artist.raw()), + fmt::arg("albumArtist", album_artist.raw()), + fmt::arg("album", album.raw()), + fmt::arg("title", title.raw()), fmt::arg("date", date), fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), From a49b12b66b4ff2d8de12ead98caf822d9eb35308 Mon Sep 17 00:00:00 2001 From: Antonin Reitz Date: Fri, 12 Mar 2021 20:58:51 +0100 Subject: [PATCH 168/303] Fix CPU load values --- include/modules/cpu.hpp | 3 +-- src/modules/cpu/common.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/modules/cpu.hpp b/include/modules/cpu.hpp index 7a70336..d5b79e0 100644 --- a/include/modules/cpu.hpp +++ b/include/modules/cpu.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include @@ -20,7 +19,7 @@ class Cpu : public ALabel { auto update() -> void; private: - uint16_t getCpuLoad(); + double getCpuLoad(); std::tuple getCpuUsage(); std::vector> parseCpuinfo(); diff --git a/src/modules/cpu/common.cpp b/src/modules/cpu/common.cpp index e86d10a..03befe4 100644 --- a/src/modules/cpu/common.cpp +++ b/src/modules/cpu/common.cpp @@ -32,10 +32,10 @@ auto waybar::modules::Cpu::update() -> void { ALabel::update(); } -uint16_t waybar::modules::Cpu::getCpuLoad() { +double waybar::modules::Cpu::getCpuLoad() { double load[1]; if (getloadavg(load, 1) != -1) { - return load[0] * 100 / sysconf(_SC_NPROCESSORS_ONLN); + return load[0]; } throw std::runtime_error("Can't get Cpu load"); } From 354de5f13f407ca17e09bdc2aa98dde0821bb758 Mon Sep 17 00:00:00 2001 From: lunik1 Date: Sat, 13 Mar 2021 15:17:11 +0000 Subject: [PATCH 169/303] style: add styling to disk module --- resources/style.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/style.css b/resources/style.css index 920bb52..952f368 100644 --- a/resources/style.css +++ b/resources/style.css @@ -69,6 +69,7 @@ window#waybar.chromium { #battery, #cpu, #memory, +#disk, #temperature, #backlight, #network, @@ -142,6 +143,10 @@ label:focus { background-color: #9b59b6; } +#disk { + background-color: #964B00; +} + #backlight { background-color: #90b1b1; } From b4ee994515e17ffff22e5575316e5b8e57b8cdf1 Mon Sep 17 00:00:00 2001 From: Martin Pittermann Date: Tue, 23 Mar 2021 00:26:45 +0100 Subject: [PATCH 170/303] Add style for battery state "plugged" --- resources/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/style.css b/resources/style.css index 920bb52..e124306 100644 --- a/resources/style.css +++ b/resources/style.css @@ -107,7 +107,7 @@ window#waybar.chromium { color: #000000; } -#battery.charging { +#battery.charging, #battery.plugged { color: #ffffff; background-color: #26A65B; } From f4ad5d36ec0d64f55a541ef4e04500462e2c25ec Mon Sep 17 00:00:00 2001 From: Artur Sinila Date: Wed, 17 Mar 2021 17:07:06 +0300 Subject: [PATCH 171/303] meson.build: add missing waybar-sway-language manpage --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 373ec86..23af767 100644 --- a/meson.build +++ b/meson.build @@ -315,6 +315,7 @@ if scdoc.found() 'waybar-network.5.scd', 'waybar-pulseaudio.5.scd', 'waybar-river-tags.5.scd', + 'waybar-sway-language.5.scd', 'waybar-sway-mode.5.scd', 'waybar-sway-window.5.scd', 'waybar-sway-workspaces.5.scd', From c85021228832cbea002ef38a468b84bbaf36f41c Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Sun, 28 Mar 2021 20:07:35 +0300 Subject: [PATCH 172/303] Use the correct battery status when multiple batteries are present --- src/modules/battery.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 8577469..49e23de 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -135,6 +135,16 @@ void waybar::modules::Battery::refreshBatteries() { } } +// Unknown > Full > Not charging > Discharging > Charging +static bool status_gt(const std::string& a, const std::string& b) { + if (a == b) return false; + else if (a == "Unknown") return true; + else if (a == "Full" && b != "Unknown") return true; + else if (a == "Not charging" && b != "Unknown" && b != "Full") return true; + else if (a == "Discharging" && b != "Unknown" && b != "Full" && b != "Not charging") return true; + return false; +} + const std::tuple waybar::modules::Battery::getInfos() { std::lock_guard guard(battery_list_mutex_); @@ -160,7 +170,9 @@ const std::tuple waybar::modules::Battery::g std::ifstream(bat / full_path) >> energy_full; auto full_design_path = fs::exists(bat / "charge_full_design") ? "charge_full_design" : "energy_full_design"; std::ifstream(bat / full_design_path) >> energy_full_design; - if (_status != "Unknown") { + + // Show the "smallest" status among all batteries + if (status_gt(status, _status)) { status = _status; } total_power += power_now; From 729a4fe37e899143cf9ae2e3bf88c5d574714489 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 15 Apr 2021 16:09:45 +0200 Subject: [PATCH 173/303] chore: v0.9.6 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 23af767..39706ba 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project( 'waybar', 'cpp', 'c', - version: '0.9.5', + version: '0.9.6', license: 'MIT', meson_version: '>= 0.49.0', default_options : [ From f8f1e791a30a5b44a43a2d4bf673d837724c5396 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Thu, 15 Apr 2021 14:30:29 -0400 Subject: [PATCH 174/303] [Module CPU] fix crash due to empty frequencies. On some systems (eg: ARM) the supported frequencies of the CPU are not properly reported by /proc/cpuinfo so if that fails try to retrieve them from /sys/devices/system/cpu/cpufreq/policy[0-9]/cpuinfo_[max|min]_freq. --- src/modules/cpu/linux.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/modules/cpu/linux.cpp b/src/modules/cpu/linux.cpp index b69f71a..6d638a9 100644 --- a/src/modules/cpu/linux.cpp +++ b/src/modules/cpu/linux.cpp @@ -1,3 +1,4 @@ +#include #include "modules/cpu.hpp" std::vector> waybar::modules::Cpu::parseCpuinfo() { @@ -46,5 +47,31 @@ std::vector waybar::modules::Cpu::parseCpuFrequencies() { frequencies.push_back(frequency); } info.close(); + + if (frequencies.size() <= 0) { + std::string cpufreq_dir = "/sys/devices/system/cpu/cpufreq"; + if (std::filesystem::exists(cpufreq_dir)) { + std::vector frequency_files = { + "/cpuinfo_min_freq", + "/cpuinfo_max_freq" + }; + for (auto& p: std::filesystem::directory_iterator(cpufreq_dir)) { + for (auto freq_file: frequency_files) { + std::string freq_file_path = p.path().string() + freq_file; + if (std::filesystem::exists(freq_file_path)) { + std::string freq_value; + std::ifstream freq(freq_file_path); + if (freq.is_open()) { + getline(freq, freq_value); + float frequency = std::strtol(freq_value.c_str(), nullptr, 10); + frequencies.push_back(frequency / 1000); + freq.close(); + } + } + } + } + } + } + return frequencies; } From 5300461c79de4c38ec652a5e26eb05ab2bbff335 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 15 Apr 2021 21:17:48 +0200 Subject: [PATCH 175/303] chore: v0.9.7 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 39706ba..2bb4e49 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project( 'waybar', 'cpp', 'c', - version: '0.9.6', + version: '0.9.7', license: 'MIT', meson_version: '>= 0.49.0', default_options : [ From ba278985e86315731871611996382f31d0e526c2 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 18 Apr 2021 21:34:29 +0300 Subject: [PATCH 176/303] Add ignore-list param to wlr/taskbar --- include/modules/wlr/taskbar.hpp | 7 +++++++ man/waybar-wlr-taskbar.5.scd | 9 ++++++++- src/modules/wlr/taskbar.cpp | 31 ++++++++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/include/modules/wlr/taskbar.hpp b/include/modules/wlr/taskbar.hpp index 7085d79..bb65066 100644 --- a/include/modules/wlr/taskbar.hpp +++ b/include/modules/wlr/taskbar.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include @@ -61,6 +62,7 @@ class Task Gtk::Label text_before_; Gtk::Label text_after_; bool button_visible_; + bool ignored_; bool with_icon_; std::string format_before_; @@ -132,10 +134,14 @@ class Taskbar : public waybar::AModule std::vector tasks_; std::vector> icon_themes_; + std::unordered_set ignore_list_; struct zwlr_foreign_toplevel_manager_v1 *manager_; struct wl_seat *seat_; + protected: + + public: /* Callbacks for global registration */ void register_manager(struct wl_registry*, uint32_t name, uint32_t version); @@ -155,6 +161,7 @@ class Taskbar : public waybar::AModule bool all_outputs() const; std::vector> icon_themes() const; + const std::unordered_set& ignore_list() const; }; } /* namespace waybar::modules::wlr */ diff --git a/man/waybar-wlr-taskbar.5.scd b/man/waybar-wlr-taskbar.5.scd index a2bff26..0e86238 100644 --- a/man/waybar-wlr-taskbar.5.scd +++ b/man/waybar-wlr-taskbar.5.scd @@ -68,6 +68,10 @@ Addressed by *wlr/taskbar* typeof: string ++ Command to execute when the module is updated. +*ignore-list*: ++ + typeof: array ++ + List of app_id to be invisible. + # FORMAT REPLACEMENTS *{icon}*: The icon of the application. @@ -98,7 +102,10 @@ Addressed by *wlr/taskbar* "icon-theme": "Numix-Circle", "tooltip-format": "{title}", "on-click": "activate", - "on-click-middle": "close" + "on-click-middle": "close", + "ignore-list": [ + "Alacritty" + ] } ``` diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index ef46f36..932a95e 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -277,7 +277,7 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar, bar_{bar}, config_{config}, tbar_{tbar}, handle_{tl_handle}, seat_{seat}, id_{global_id++}, content_{bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0}, - button_visible_{false} + button_visible_{false}, ignored_{false} { zwlr_foreign_toplevel_handle_v1_add_listener(handle_, &toplevel_handle_impl, this); @@ -383,6 +383,21 @@ void Task::handle_app_id(const char *app_id) { app_id_ = app_id; + if (tbar_->ignore_list().count(app_id)) { + ignored_ = true; + if (button_visible_) { + auto output = gdk_wayland_monitor_get_wl_output(bar_.output->monitor->gobj()); + handle_output_leave(output); + } + } else { + bool is_was_ignored = ignored_; + ignored_ = false; + if (is_was_ignored) { + auto output = gdk_wayland_monitor_get_wl_output(bar_.output->monitor->gobj()); + handle_output_enter(output); + } + } + if (!with_icon_) return; @@ -405,6 +420,11 @@ void Task::handle_output_enter(struct wl_output *output) { spdlog::debug("{} entered output {}", repr(), (void*)output); + if (ignored_) { + spdlog::debug("{} is ignored", repr()); + return; + } + if (!button_visible_ && (tbar_->all_outputs() || tbar_->show_output(output))) { /* The task entered the output of the current bar make the button visible */ tbar_->add_button(button_); @@ -694,6 +714,14 @@ Taskbar::Taskbar(const std::string &id, const waybar::Bar &bar, const Json::Valu icon_themes_.push_back(it); } + + // Load ignore-list + if (config_["ignore-list"].isArray()) { + for (auto& app_name : config_["ignore-list"]) { + ignore_list_.emplace(app_name.asString()); + } + } + icon_themes_.push_back(Gtk::IconTheme::get_default()); } @@ -829,5 +857,6 @@ std::vector> Taskbar::icon_themes() const { return icon_themes_; } +const std::unordered_set &Taskbar::ignore_list() const { return ignore_list_; } } /* namespace waybar::modules::wlr */ From 5ad3b6018a85be29a88131bfe1e8270589140f5b Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 18 Apr 2021 21:37:58 +0300 Subject: [PATCH 177/303] Remove exceed protected --- include/modules/wlr/taskbar.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/modules/wlr/taskbar.hpp b/include/modules/wlr/taskbar.hpp index bb65066..891ad55 100644 --- a/include/modules/wlr/taskbar.hpp +++ b/include/modules/wlr/taskbar.hpp @@ -139,9 +139,6 @@ class Taskbar : public waybar::AModule struct zwlr_foreign_toplevel_manager_v1 *manager_; struct wl_seat *seat_; - protected: - - public: /* Callbacks for global registration */ void register_manager(struct wl_registry*, uint32_t name, uint32_t version); From fc89b01ba68b13321e2254158247b7022dc370f5 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 20 Apr 2021 08:25:48 +0200 Subject: [PATCH 178/303] feat: implement mpd volume format template Allow the user to show the current volume from MPD status via the `format` and/or `tooltip-format` configuration options. The values are provided by libmpdclient and are integers, generally between 0-100 (without %). Values above 100 are also possible, as mpd output plugins like `pulse` support volumes above 100%. Signed-off-by: Sefa Eyeoglu --- man/waybar-mpd.5.scd | 2 ++ resources/config | 2 +- src/modules/mpd/mpd.cpp | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/man/waybar-mpd.5.scd b/man/waybar-mpd.5.scd index b8e9664..044af98 100644 --- a/man/waybar-mpd.5.scd +++ b/man/waybar-mpd.5.scd @@ -172,6 +172,8 @@ Addressed by *mpd* *{date}*: The date of the current song +*{volume}*: The current volume in percent + *{elapsedTime}*: The current position of the current song. To format as a date/time (see example configuration) *{totalTime}*: The length of the current song. To format as a date/time (see example configuration) diff --git a/resources/config b/resources/config index f3c0a77..13dc94c 100644 --- a/resources/config +++ b/resources/config @@ -27,7 +27,7 @@ "format": "{}" }, "mpd": { - "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ ", + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", "format-disconnected": "Disconnected ", "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", "unknown-tag": "N/A", diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index 6a828c3..0a7c970 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -100,7 +100,7 @@ void waybar::modules::MPD::setLabel() { auto format = format_; Glib::ustring artist, album_artist, album, title; std::string date; - int song_pos = 0, queue_length = 0; + int song_pos = 0, queue_length = 0, volume = 0; std::chrono::seconds elapsedTime, totalTime; std::string stateIcon = ""; @@ -130,6 +130,7 @@ void waybar::modules::MPD::setLabel() { title = getTag(MPD_TAG_TITLE); date = getTag(MPD_TAG_DATE); song_pos = mpd_status_get_song_pos(status_.get()); + volume = mpd_status_get_volume(status_.get()); queue_length = mpd_status_get_queue_length(status_.get()); elapsedTime = std::chrono::seconds(mpd_status_get_elapsed_time(status_.get())); totalTime = std::chrono::seconds(mpd_status_get_total_time(status_.get())); @@ -156,6 +157,7 @@ void waybar::modules::MPD::setLabel() { fmt::arg("album", Glib::Markup::escape_text(album).raw()), fmt::arg("title", Glib::Markup::escape_text(title).raw()), fmt::arg("date", Glib::Markup::escape_text(date).raw()), + fmt::arg("volume", volume), fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), fmt::arg("songPosition", song_pos), @@ -180,6 +182,7 @@ void waybar::modules::MPD::setLabel() { fmt::arg("album", album.raw()), fmt::arg("title", title.raw()), fmt::arg("date", date), + fmt::arg("volume", volume), fmt::arg("elapsedTime", elapsedTime), fmt::arg("totalTime", totalTime), fmt::arg("songPosition", song_pos), From b16c8972c70d536df0e579beee8c9054f0990d6b Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Sun, 21 Mar 2021 11:42:25 +0100 Subject: [PATCH 179/303] Add option to rewrite sway/window title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rewrites window title according to config option "rewrite". "rewrite" is an object where keys are regular expressions and values are rewrite rules if the expression matches. Rules may contain references to captures of the expression. Regex and replacement follow ECMA-script rules. If no regex matches, the title is left unchanged. example: "sway/window": { "rewrite": { "(.*) - Mozilla Firefox": " $1", "(.*) - zsh": " $1", } } --- include/modules/sway/window.hpp | 1 + src/modules/sway/window.cpp | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/modules/sway/window.hpp b/include/modules/sway/window.hpp index 40aaa1a..0f7ae31 100644 --- a/include/modules/sway/window.hpp +++ b/include/modules/sway/window.hpp @@ -22,6 +22,7 @@ class Window : public ALabel, public sigc::trackable { std::tuple getFocusedNode(const Json::Value& nodes, std::string& output); void getTree(); + std::string rewriteTitle(const std::string& title); const Bar& bar_; std::string window_; diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index d8f113f..3b424c2 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -1,5 +1,6 @@ #include "modules/sway/window.hpp" #include +#include namespace waybar::modules::sway { @@ -56,7 +57,7 @@ auto Window::update() -> void { bar_.window.get_style_context()->remove_class("solo"); bar_.window.get_style_context()->remove_class("empty"); } - label_.set_markup(fmt::format(format_, fmt::arg("title", window_), + label_.set_markup(fmt::format(format_, fmt::arg("title", rewriteTitle(window_)), fmt::arg("app_id", app_id_))); if (tooltipEnabled()) { label_.set_tooltip_text(window_); @@ -131,4 +132,23 @@ void Window::getTree() { } } +std::string Window::rewriteTitle(const std::string& title) +{ + const auto& rules = config_["rewrite"]; + if (!rules.isObject()) { + return title; + } + + for (auto it = rules.begin(); it != rules.end(); ++it) { + if (it.key().isString() && it->isString()) { + const std::regex rule{it.key().asString()}; + if (std::regex_match(title, rule)) { + return std::regex_replace(title, rule, it->asString()); + } + } + } + + return title; +} + } // namespace waybar::modules::sway From af3c868a5b63b1e77b56801ca558f76afcc21ed6 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Wed, 21 Apr 2021 12:15:25 +0200 Subject: [PATCH 180/303] Catch exception on erroneous rules std::regex and std::regex_replace may throw an std::regex_error if the expression or replacement contain errors. Log this error and carry on with the next rule, so that the title is shown even if the config contains errors. --- src/modules/sway/window.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index 3b424c2..0491039 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -141,9 +141,15 @@ std::string Window::rewriteTitle(const std::string& title) for (auto it = rules.begin(); it != rules.end(); ++it) { if (it.key().isString() && it->isString()) { - const std::regex rule{it.key().asString()}; - if (std::regex_match(title, rule)) { - return std::regex_replace(title, rule, it->asString()); + try { + // malformated regexes will cause an exception. + // in this case, log error and try the next rule. + const std::regex rule{it.key().asString()}; + if (std::regex_match(title, rule)) { + return std::regex_replace(title, rule, it->asString()); + } + } catch (const std::regex_error& e) { + spdlog::error("Invalid rule {}: {}", it.key().asString(), e.what()); } } } From 7cdf178f8d7c3caec57b57bd2f539e4982d83a9a Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Wed, 21 Apr 2021 12:18:33 +0200 Subject: [PATCH 181/303] Document changes in manpage Add section on rewrite rules and extend example --- man/waybar-sway-window.5.scd | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/man/waybar-sway-window.5.scd b/man/waybar-sway-window.5.scd index 40250e6..ea06069 100644 --- a/man/waybar-sway-window.5.scd +++ b/man/waybar-sway-window.5.scd @@ -66,12 +66,32 @@ Addressed by *sway/window* default: true ++ Option to disable tooltip on hover. +*rewrite*: ++ + typeof: object ++ + Rules to rewrite window title. See *rewrite rules*. + +# REWRITE RULES + +*rewrite* is an object where keys are regular expressions and values are +rewrite rules if the expression matches. Rules may contain references to +captures of the expression. + +Regular expression and replacement follow ECMA-script rules. + +If no expression matches, the title is left unchanged. + +Invalid expressions (e.g., mismatched parentheses) are skipped. + # EXAMPLES ``` "sway/window": { "format": "{}", - "max-length": 50 + "max-length": 50, + "rewrite": { + "(.*) - Mozilla Firefox": "🌎 $1", + "(.*) - zsh": "> [$1]" + } } ``` From 2213380dc0c89b104b92183249c48c27a2b16f72 Mon Sep 17 00:00:00 2001 From: David96 Date: Sun, 25 Apr 2021 11:19:35 +0200 Subject: [PATCH 182/303] [modules/pulseaudio] fix bluetooth class for PipeWire apparently, pipewire-pulse slightly changed the naming of the sink. --- src/modules/pulseaudio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 7f4f3b6..3fbe956 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -210,7 +210,8 @@ auto waybar::modules::Pulseaudio::update() -> void { std::string tooltip_format; if (!alt_) { std::string format_name = "format"; - if (monitor_.find("a2dp_sink") != std::string::npos) { + if (monitor_.find("a2dp_sink") != std::string::npos || // PulseAudio + monitor_.find("a2dp-sink") != std::string::npos) { // PipeWire format_name = format_name + "-bluetooth"; label_.get_style_context()->add_class("bluetooth"); } else { From 7e13e26c29f2e7090d3d92a7016a0cf2b2af6746 Mon Sep 17 00:00:00 2001 From: Gabe Gorelick Date: Sun, 25 Apr 2021 22:00:24 -0400 Subject: [PATCH 183/303] [modules/battery] allow format-discharging-full `format-discharging-full` has been impossible since #923 made it impossible to be full and discharging at the same time. This should fix that by only making `format-charging-full` impossible. Whether or not that should be allowed is a good question, but beyond the scope of this change. Fixes #1031 --- src/modules/battery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 49e23de..e598858 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -216,7 +216,7 @@ const std::tuple waybar::modules::Battery::g capacity = 100.f; } uint8_t cap = round(capacity); - if (cap == 100) { + if (cap == 100 && status == "Charging") { // If we've reached 100% just mark as full as some batteries can stay // stuck reporting they're still charging but not yet done status = "Full"; From a03283d65f0dff17b5e69258c5cc206bdfd5f8c6 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Mon, 26 Apr 2021 20:26:43 +0200 Subject: [PATCH 184/303] rewriteTitle: allow multiple sequential rewrites --- src/modules/sway/window.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index 0491039..b677958 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -132,13 +132,14 @@ void Window::getTree() { } } -std::string Window::rewriteTitle(const std::string& title) -{ +std::string Window::rewriteTitle(const std::string& title) { const auto& rules = config_["rewrite"]; if (!rules.isObject()) { return title; } + std::string res = title; + for (auto it = rules.begin(); it != rules.end(); ++it) { if (it.key().isString() && it->isString()) { try { @@ -146,7 +147,7 @@ std::string Window::rewriteTitle(const std::string& title) // in this case, log error and try the next rule. const std::regex rule{it.key().asString()}; if (std::regex_match(title, rule)) { - return std::regex_replace(title, rule, it->asString()); + res = std::regex_replace(res, rule, it->asString()); } } catch (const std::regex_error& e) { spdlog::error("Invalid rule {}: {}", it.key().asString(), e.what()); @@ -154,7 +155,7 @@ std::string Window::rewriteTitle(const std::string& title) } } - return title; + return res; } } // namespace waybar::modules::sway From 71d7596b6f5537a5572a2588320d85e37fa5f670 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 30 Apr 2021 14:23:49 +0200 Subject: [PATCH 185/303] fix: bluetooth status tooltip --- src/modules/bluetooth.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/bluetooth.cpp b/src/modules/bluetooth.cpp index 8852684..1540c05 100644 --- a/src/modules/bluetooth.cpp +++ b/src/modules/bluetooth.cpp @@ -16,7 +16,7 @@ auto waybar::modules::Bluetooth::update() -> void { if (tooltipEnabled()) { if (config_["tooltip-format"].isString()) { auto tooltip_format = config_["tooltip-format"].asString(); - auto tooltip_text = fmt::format(tooltip_format, status); + auto tooltip_text = fmt::format(tooltip_format, status, fmt::arg("status", status)); label_.set_tooltip_text(tooltip_text); } else { label_.set_tooltip_text(status); From b25b7d29fcd8c80b49bba5a02a69825811719699 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 30 Apr 2021 14:25:26 +0200 Subject: [PATCH 186/303] Update spdlog.wrap --- subprojects/spdlog.wrap | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/subprojects/spdlog.wrap b/subprojects/spdlog.wrap index c30450e..daddfd6 100644 --- a/subprojects/spdlog.wrap +++ b/subprojects/spdlog.wrap @@ -1,13 +1,11 @@ [wrap-file] -directory = spdlog-1.8.1 - -source_url = https://github.com/gabime/spdlog/archive/v1.8.1.tar.gz -source_filename = v1.8.1.tar.gz -source_hash = 5197b3147cfcfaa67dd564db7b878e4a4b3d9f3443801722b3915cdeced656cb - -patch_url = https://github.com/mesonbuild/spdlog/releases/download/1.8.1-1/spdlog.zip -patch_filename = spdlog-1.8.1-1-wrap.zip -patch_hash = 76844292a8e912aec78450618271a311841b33b17000988f215ddd6c64dd71b3 +directory = spdlog-1.8.5 +source_url = https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz +source_filename = v1.8.5.tar.gz +source_hash = 944d0bd7c763ac721398dca2bb0f3b5ed16f67cef36810ede5061f35a543b4b8 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/spdlog/1.8.5/1/get_zip +patch_filename = spdlog-1.8.5-1-wrap.zip +patch_hash = 3c38f275d5792b1286391102594329e98b17737924b344f98312ab09929b74be [provide] spdlog = spdlog_dep From cdce3e03ea9c22ef8825d53001b84520e3e32c98 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 30 Apr 2021 14:25:48 +0200 Subject: [PATCH 187/303] Update meson.build --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2bb4e49..e80448e 100644 --- a/meson.build +++ b/meson.build @@ -80,7 +80,7 @@ is_openbsd = host_machine.system() == 'openbsd' thread_dep = dependency('threads') fmt = dependency('fmt', version : ['>=5.3.0'], fallback : ['fmt', 'fmt_dep']) -spdlog = dependency('spdlog', version : ['>=1.8.0'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=true']) +spdlog = dependency('spdlog', version : ['>=1.8.5'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=true']) wayland_client = dependency('wayland-client') wayland_cursor = dependency('wayland-cursor') wayland_protos = dependency('wayland-protocols') From f3a6e2d49481ac761b3e4886cfad4c2d721ded1b Mon Sep 17 00:00:00 2001 From: Max1Truc Date: Mon, 10 May 2021 21:00:14 +0200 Subject: [PATCH 188/303] fix: incorrect battery percentage on Pinebook Pro --- src/modules/battery.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index e598858..67223c4 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -164,13 +164,25 @@ const std::tuple waybar::modules::Battery::g std::ifstream(bat / "status") >> _status; auto rate_path = fs::exists(bat / "current_now") ? "current_now" : "power_now"; std::ifstream(bat / rate_path) >> power_now; - auto now_path = fs::exists(bat / "charge_now") ? "charge_now" : "energy_now"; + + std::string now_path; + if (fs::exists(bat / "charge_now")) { + now_path = "charge_now"; + } else if (fs::exists(bat / "energy_now")) { + now_path = "energy_now"; + } else { + now_path = "capacity"; + } std::ifstream(bat / now_path) >> energy_now; auto full_path = fs::exists(bat / "charge_full") ? "charge_full" : "energy_full"; std::ifstream(bat / full_path) >> energy_full; auto full_design_path = fs::exists(bat / "charge_full_design") ? "charge_full_design" : "energy_full_design"; std::ifstream(bat / full_design_path) >> energy_full_design; + if (now_path == "capacity") { + energy_now = energy_now * energy_full / 100; + } + // Show the "smallest" status among all batteries if (status_gt(status, _status)) { status = _status; @@ -245,7 +257,7 @@ const std::string waybar::modules::Battery::getAdapterStatus(uint8_t capacity) c } const std::string waybar::modules::Battery::formatTimeRemaining(float hoursRemaining) { - hoursRemaining = std::fabs(hoursRemaining); + hoursRemaining = std::fabs(hoursRemaining); uint16_t full_hours = static_cast(hoursRemaining); uint16_t minutes = static_cast(60 * (hoursRemaining - full_hours)); auto format = std::string("{H} h {M} min"); From 4d067619a8f72aebd64042db9d686c6ef15a0a3e Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Sat, 15 May 2021 15:46:23 +0100 Subject: [PATCH 189/303] =?UTF-8?q?Fix=20power=20calculation=20when=20batt?= =?UTF-8?q?ery=20units=20are=20in=20=CE=BCA=20instead=20of=20=CE=BCW?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/battery.cpp | 45 +++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 67223c4..2656769 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -162,25 +162,36 @@ const std::tuple waybar::modules::Battery::g uint32_t energy_full_design; std::string _status; std::ifstream(bat / "status") >> _status; - auto rate_path = fs::exists(bat / "current_now") ? "current_now" : "power_now"; - std::ifstream(bat / rate_path) >> power_now; - std::string now_path; - if (fs::exists(bat / "charge_now")) { - now_path = "charge_now"; - } else if (fs::exists(bat / "energy_now")) { - now_path = "energy_now"; + // Some battery will report current and charge in μA/μAh. + // Scale these by the voltage to get μW/μWh. + if (fs::exists(bat / "current_now")) { + uint32_t voltage_now; + uint32_t current_now; + uint32_t charge_now; + uint32_t charge_full; + uint32_t charge_full_design; + std::ifstream(bat / "voltage_now") >> voltage_now; + std::ifstream(bat / "current_now") >> current_now; + std::ifstream(bat / "charge_full") >> charge_full; + std::ifstream(bat / "charge_full_design") >> charge_full_design; + if (fs::exists(bat / "charge_now")) + std::ifstream(bat / "charge_now") >> charge_now; + else { + // charge_now is missing on some systems, estimate using capacity. + uint32_t capacity; + std::ifstream(bat / "capacity") >> capacity; + charge_now = (capacity * charge_full) / 100; + } + power_now = ((uint64_t)current_now * (uint64_t)voltage_now) / 1000000; + energy_now = ((uint64_t)charge_now * (uint64_t)voltage_now) / 1000000; + energy_full = ((uint64_t)charge_full * (uint64_t)voltage_now) / 1000000; + energy_full_design = ((uint64_t)charge_full_design * (uint64_t)voltage_now) / 1000000; } else { - now_path = "capacity"; - } - std::ifstream(bat / now_path) >> energy_now; - auto full_path = fs::exists(bat / "charge_full") ? "charge_full" : "energy_full"; - std::ifstream(bat / full_path) >> energy_full; - auto full_design_path = fs::exists(bat / "charge_full_design") ? "charge_full_design" : "energy_full_design"; - std::ifstream(bat / full_design_path) >> energy_full_design; - - if (now_path == "capacity") { - energy_now = energy_now * energy_full / 100; + std::ifstream(bat / "power_now") >> power_now; + std::ifstream(bat / "energy_now") >> energy_now; + std::ifstream(bat / "energy_full") >> energy_full; + std::ifstream(bat / "energy_full_design") >> energy_full_design; } // Show the "smallest" status among all batteries From dbc06abf1826a3c5752a39f1843144a0cc2a87a1 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH 190/303] network: Initialise cidr_ like clearIface() does --- src/modules/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index a8aaffa..8dcfb57 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -86,7 +86,7 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf family_(config["family"] == "ipv6" ? AF_INET6 : AF_INET), efd_(-1), ev_fd_(-1), - cidr_(-1), + cidr_(0), signal_strength_dbm_(0), signal_strength_(0), #ifdef WANT_RFKILL From 9357a6cb8802b3d57a6c140a3d9a9a2068403089 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH 191/303] network: Start the module with some text in the label_ Fix modules starting with no text, but not hidding. Start with some "text" in the module's label_, update() will then update it. Since the text should be different, update() will be able to show or hide the event_box_. This is to work around the case where the module start with no text, but the the event_box_ is shown. --- src/modules/network.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 8dcfb57..e52ed02 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -93,6 +93,13 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf rfkill_{RFKILL_TYPE_WLAN}, #endif frequency_(0) { + + // Start with some "text" in the module's label_, update() will then + // update it. Since the text should be different, update() will be able + // to show or hide the event_box_. This is to work around the case where + // the module start with no text, but the the event_box_ is shown. + label_.set_markup(""); + auto down_octets = read_netstat(BANDWIDTH_CATEGORY, BANDWIDTH_DOWN_TOTAL_KEY); auto up_octets = read_netstat(BANDWIDTH_CATEGORY, BANDWIDTH_UP_TOTAL_KEY); if (down_octets) { From 63fdf66ad66914354d4ac510f08d51dd25389c36 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH 192/303] network: Read all available messages on ev_sock_ When more than one message is available to read on the ev_sock_ socket, only the first one is read. Make some changes to be able to read all the messages available by setting the socket to non-blocking. This way we can detect when there's nothing left to read and loop back to wait with epoll. --- src/modules/network.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index e52ed02..bd84c1a 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -160,6 +160,9 @@ void waybar::modules::Network::createEventSocket() { if (nl_connect(ev_sock_, NETLINK_ROUTE) != 0) { throw std::runtime_error("Can't connect network socket"); } + if (nl_socket_set_nonblocking(ev_sock_)) { + throw std::runtime_error("Can't set non-blocking on network socket"); + } nl_socket_add_membership(ev_sock_, RTNLGRP_LINK); if (family_ == AF_INET) { nl_socket_add_membership(ev_sock_, RTNLGRP_IPV4_IFADDR); @@ -235,7 +238,23 @@ void waybar::modules::Network::worker() { int ec = epoll_wait(efd_, events.data(), EPOLL_MAX, -1); if (ec > 0) { for (auto i = 0; i < ec; i++) { - if (events[i].data.fd != nl_socket_get_fd(ev_sock_) || nl_recvmsgs_default(ev_sock_) < 0) { + if (events[i].data.fd == nl_socket_get_fd(ev_sock_)) { + int rc = 0; + // Read as many message as possible, until the socket blocks + while (true) { + errno = 0; + rc = nl_recvmsgs_default(ev_sock_); + if (rc == -NLE_AGAIN || errno == EAGAIN) { + rc = 0; + break; + } + } + if (rc < 0) { + spdlog::error("nl_recvmsgs_default error: {}", nl_geterror(-rc)); + thread_.stop(); + break; + } + } else { thread_.stop(); break; } From c9bbaa7241bb40f06bed523c54faa9a8643f7ec2 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH 193/303] network: Rework initial interface search by using a dump Instead of using an alternative way to list all links in order to choose one when an "interface" is in the configuration, we can ask for a dump of all interface an reuse the handleEvents() function. This patch also start to rework the handleEvents() function to grab more information out of each event, like the interface name. --- include/modules/network.hpp | 6 ++ src/modules/network.cpp | 130 ++++++++++++++++++++++++------------ 2 files changed, 95 insertions(+), 41 deletions(-) diff --git a/include/modules/network.hpp b/include/modules/network.hpp index 539f458..2d3a1ff 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -28,8 +28,11 @@ class Network : public ALabel { static const uint8_t EPOLL_MAX = 200; static int handleEvents(struct nl_msg*, void*); + static int handleEventsDone(struct nl_msg*, void*); static int handleScan(struct nl_msg*, void*); + void askForStateDump(void); + void worker(); void createInfoSocket(); void createEventSocket(); @@ -59,6 +62,9 @@ class Network : public ALabel { int nl80211_id_; std::mutex mutex_; + bool want_link_dump_; + bool dump_in_progress_; + unsigned long long bandwidth_down_total_; unsigned long long bandwidth_up_total_; diff --git a/src/modules/network.cpp b/src/modules/network.cpp index bd84c1a..65d82b6 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -86,6 +86,8 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf family_(config["family"] == "ipv6" ? AF_INET6 : AF_INET), efd_(-1), ev_fd_(-1), + want_link_dump_(false), + dump_in_progress_(false), cidr_(0), signal_strength_dbm_(0), signal_strength_(0), @@ -114,6 +116,11 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf bandwidth_up_total_ = 0; } + if (config_["interface"].isString()) { + // Look for an interface that match "interface" + want_link_dump_ = true; + } + createEventSocket(); createInfoSocket(); auto default_iface = getPreferredIface(-1, false); @@ -125,6 +132,10 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf getInterfaceAddress(); } dp.emit(); + // Ask for a dump of interfaces and then addresses to populate our + // information. First the interface dump, and once done, the callback + // will be called again which will ask for addresses dump. + askForStateDump(); worker(); } @@ -155,6 +166,7 @@ void waybar::modules::Network::createEventSocket() { ev_sock_ = nl_socket_alloc(); nl_socket_disable_seq_check(ev_sock_); nl_socket_modify_cb(ev_sock_, NL_CB_VALID, NL_CB_CUSTOM, handleEvents, this); + nl_socket_modify_cb(ev_sock_, NL_CB_FINISH, NL_CB_CUSTOM, handleEventsDone, this); auto groups = RTMGRP_LINK | (family_ == AF_INET ? RTMGRP_IPV4_IFADDR : RTMGRP_IPV6_IFADDR); nl_join_groups(ev_sock_, groups); // Deprecated if (nl_connect(ev_sock_, NETLINK_ROUTE) != 0) { @@ -590,28 +602,8 @@ bool waybar::modules::Network::checkInterface(struct ifinfomsg *rtif, std::strin int waybar::modules::Network::getPreferredIface(int skip_idx, bool wait) const { int ifid = -1; if (config_["interface"].isString()) { - ifid = if_nametoindex(config_["interface"].asCString()); - if (ifid > 0) { - return ifid; - } else { - // Try with wildcard - struct ifaddrs *ifaddr, *ifa; - int success = getifaddrs(&ifaddr); - if (success != 0) { - return -1; - } - ifa = ifaddr; - ifid = -1; - while (ifa != nullptr) { - if (wildcardMatch(config_["interface"].asString(), ifa->ifa_name)) { - ifid = if_nametoindex(ifa->ifa_name); - break; - } - ifa = ifa->ifa_next; - } - freeifaddrs(ifaddr); - return ifid; - } + // Using link dump instead + return -1; } // getExternalInterface may need some delay to detect external interface for (uint8_t tries = 0; tries < MAX_RETRY; tries += 1) { @@ -656,6 +648,55 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { std::lock_guard lock(net->mutex_); auto nh = nlmsg_hdr(msg); auto ifi = static_cast(NLMSG_DATA(nh)); + bool is_del_event = false; + + switch (nh->nlmsg_type) { + case RTM_DELLINK: + is_del_event = true; + case RTM_NEWLINK: { + struct ifinfomsg *ifi = static_cast(NLMSG_DATA(nh)); + ssize_t attrlen = IFLA_PAYLOAD(nh); + struct rtattr *ifla = IFLA_RTA(ifi); + const char *ifname = NULL; + size_t ifname_len = 0; + + if (net->ifid_ != -1 && ifi->ifi_index != net->ifid_) { + return NL_OK; + } + + for (; RTA_OK(ifla, attrlen); ifla = RTA_NEXT(ifla, attrlen)) { + switch (ifla->rta_type) { + case IFLA_IFNAME: + ifname = static_cast(RTA_DATA(ifla)); + ifname_len = RTA_PAYLOAD(ifla) - 1; // minus \0 + break; + } + } + + if (!is_del_event && net->ifid_ == -1) { + // Checking if it's an interface we care about. + std::string new_ifname (ifname, ifname_len); + if (net->checkInterface(ifi, new_ifname)) { + spdlog::debug("network: selecting new interface {}/{}", new_ifname, ifi->ifi_index); + + net->ifname_ = new_ifname; + net->ifid_ = ifi->ifi_index; + net->getInterfaceAddress(); + net->thread_timer_.wake_up(); + } + } else if (is_del_event && net->ifid_ >= 0) { + // Our interface has been deleted, start looking/waiting for one we care. + spdlog::debug("network: interface {}/{} deleted", net->ifname_, net->ifid_); + + net->clearIface(); + // Check for a new interface and get info + net->checkNewInterface(ifi); + net->dp.emit(); + } + return NL_OK; + } + } + if (nh->nlmsg_type == RTM_DELADDR) { // Check for valid interface if (ifi->ifi_index == net->ifid_) { @@ -671,25 +712,6 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { } return NL_OK; } - } else if (nh->nlmsg_type == RTM_NEWLINK || nh->nlmsg_type == RTM_DELLINK) { - char ifname[IF_NAMESIZE]; - if_indextoname(ifi->ifi_index, ifname); - // Check for valid interface - if (ifi->ifi_index != net->ifid_ && net->checkInterface(ifi, ifname)) { - net->ifname_ = ifname; - net->ifid_ = ifi->ifi_index; - // Get Iface and WIFI info - net->getInterfaceAddress(); - net->thread_timer_.wake_up(); - return NL_OK; - } else if (ifi->ifi_index == net->ifid_ && - (!(ifi->ifi_flags & IFF_RUNNING) || !(ifi->ifi_flags & IFF_UP) || - !net->checkInterface(ifi, ifname))) { - net->clearIface(); - // Check for a new interface and get info - net->checkNewInterface(ifi); - return NL_OK; - } } else { char ifname[IF_NAMESIZE]; if_indextoname(ifi->ifi_index, ifname); @@ -713,6 +735,32 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { return NL_SKIP; } +void waybar::modules::Network::askForStateDump(void) { + /* We need to wait until the current dump is done before sending new + * messages. handleEventsDone() is called when a dump is done. */ + if (dump_in_progress_) + return; + + struct rtgenmsg rt_hdr = { + .rtgen_family = AF_UNSPEC, + }; + + if (want_link_dump_) { + nl_send_simple(ev_sock_, RTM_GETLINK, NLM_F_DUMP, + &rt_hdr, sizeof (rt_hdr)); + want_link_dump_ = false; + dump_in_progress_ = true; + + } +} + +int waybar::modules::Network::handleEventsDone(struct nl_msg *msg, void *data) { + auto net = static_cast(data); + net->dump_in_progress_ = false; + net->askForStateDump(); + return NL_OK; +} + int waybar::modules::Network::handleScan(struct nl_msg *msg, void *data) { auto net = static_cast(data); auto gnlh = static_cast(nlmsg_data(nlmsg_hdr(msg))); From 0fc7ef6685321e1b7d966c21c508e94e6fbf3692 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH 194/303] network: Rework address lookup to use only events In order to get the IP address of an interface, we can get the information out of NEWADDR events without needed to call getifaddrs(). And when now events are expected, we can requests a dump of all addresses and handle addresses changes the same way via handleEvents() only. --- include/modules/network.hpp | 3 +- src/modules/network.cpp | 176 ++++++++++++++++++------------------ 2 files changed, 87 insertions(+), 92 deletions(-) diff --git a/include/modules/network.hpp b/include/modules/network.hpp index 2d3a1ff..cc8b3f5 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -2,7 +2,6 @@ #include #include -#include #include #include #include @@ -37,7 +36,6 @@ class Network : public ALabel { void createInfoSocket(); void createEventSocket(); int getExternalInterface(int skip_idx = -1) const; - void getInterfaceAddress(); int netlinkRequest(void*, uint32_t, uint32_t groups = 0) const; int netlinkResponse(void*, uint32_t, uint32_t groups = 0) const; void parseEssid(struct nlattr**); @@ -63,6 +61,7 @@ class Network : public ALabel { std::mutex mutex_; bool want_link_dump_; + bool want_addr_dump_; bool dump_in_progress_; unsigned long long bandwidth_down_total_; diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 65d82b6..f4cee78 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -87,6 +87,7 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf efd_(-1), ev_fd_(-1), want_link_dump_(false), + want_addr_dump_(false), dump_in_progress_(false), cidr_(0), signal_strength_dbm_(0), @@ -118,7 +119,9 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf if (config_["interface"].isString()) { // Look for an interface that match "interface" + // and then find the address associated with it. want_link_dump_ = true; + want_addr_dump_ = true; } createEventSocket(); @@ -129,7 +132,7 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf char ifname[IF_NAMESIZE]; if_indextoname(default_iface, ifname); ifname_ = ifname; - getInterfaceAddress(); + want_addr_dump_ = true; } dp.emit(); // Ask for a dump of interfaces and then addresses to populate our @@ -502,55 +505,6 @@ out: return ifidx; } -void waybar::modules::Network::getInterfaceAddress() { - struct ifaddrs *ifaddr, *ifa; - cidr_ = 0; - int success = getifaddrs(&ifaddr); - if (success != 0) { - return; - } - ifa = ifaddr; - while (ifa != nullptr) { - if (ifa->ifa_addr != nullptr && ifa->ifa_addr->sa_family == family_ && - ifa->ifa_name == ifname_) { - char ipaddr[INET6_ADDRSTRLEN]; - char netmask[INET6_ADDRSTRLEN]; - unsigned int cidr = 0; - if (family_ == AF_INET) { - ipaddr_ = inet_ntop(AF_INET, - &reinterpret_cast(ifa->ifa_addr)->sin_addr, - ipaddr, - INET_ADDRSTRLEN); - auto net_addr = reinterpret_cast(ifa->ifa_netmask); - netmask_ = inet_ntop(AF_INET, &net_addr->sin_addr, netmask, INET_ADDRSTRLEN); - unsigned int cidrRaw = net_addr->sin_addr.s_addr; - while (cidrRaw) { - cidr += cidrRaw & 1; - cidrRaw >>= 1; - } - } else { - ipaddr_ = inet_ntop(AF_INET6, - &reinterpret_cast(ifa->ifa_addr)->sin6_addr, - ipaddr, - INET6_ADDRSTRLEN); - auto net_addr = reinterpret_cast(ifa->ifa_netmask); - netmask_ = inet_ntop(AF_INET6, &net_addr->sin6_addr, netmask, INET6_ADDRSTRLEN); - for (size_t i = 0; i < sizeof(net_addr->sin6_addr.s6_addr); ++i) { - unsigned char cidrRaw = net_addr->sin6_addr.s6_addr[i]; - while (cidrRaw) { - cidr += cidrRaw & 1; - cidrRaw >>= 1; - } - } - } - cidr_ = cidr; - break; - } - ifa = ifa->ifa_next; - } - freeifaddrs(ifaddr); -} - int waybar::modules::Network::netlinkRequest(void *req, uint32_t reqlen, uint32_t groups) const { struct sockaddr_nl sa = {}; sa.nl_family = AF_NETLINK; @@ -635,7 +589,8 @@ void waybar::modules::Network::checkNewInterface(struct ifinfomsg *rtif) { char ifname[IF_NAMESIZE]; if_indextoname(new_iface, ifname); ifname_ = ifname; - getInterfaceAddress(); + want_addr_dump_ = true; + askForStateDump(); thread_timer_.wake_up(); } else { ifid_ = -1; @@ -647,7 +602,6 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { auto net = static_cast(data); std::lock_guard lock(net->mutex_); auto nh = nlmsg_hdr(msg); - auto ifi = static_cast(NLMSG_DATA(nh)); bool is_del_event = false; switch (nh->nlmsg_type) { @@ -681,8 +635,12 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->ifname_ = new_ifname; net->ifid_ = ifi->ifi_index; - net->getInterfaceAddress(); net->thread_timer_.wake_up(); + /* An address for this new interface should be received via an + * RTM_NEWADDR event either because we ask for a dump of both links + * and addrs, or because this interface has just been created and + * the addr will be sent after the RTM_NEWLINK event. + * So we don't need to do anything. */ } } else if (is_del_event && net->ifid_ >= 0) { // Our interface has been deleted, start looking/waiting for one we care. @@ -693,46 +651,78 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->checkNewInterface(ifi); net->dp.emit(); } - return NL_OK; + break; + } + + case RTM_DELADDR: + is_del_event = true; + case RTM_NEWADDR: { + struct ifaddrmsg *ifa = static_cast(NLMSG_DATA(nh)); + ssize_t attrlen = IFA_PAYLOAD(nh); + struct rtattr *ifa_rta = IFA_RTA(ifa); + + if ((int)ifa->ifa_index != net->ifid_) { + return NL_OK; + } + + if (ifa->ifa_family != net->family_) { + return NL_OK; + } + + // We ignore address mark as scope for the link or host, + // which should leave scope global addresses. + if (ifa->ifa_scope >= RT_SCOPE_LINK) { + return NL_OK; + } + + for (; RTA_OK(ifa_rta, attrlen); ifa_rta = RTA_NEXT(ifa_rta, attrlen)) { + switch (ifa_rta->rta_type) { + case IFA_ADDRESS: { + char ipaddr[INET6_ADDRSTRLEN]; + if (!is_del_event) { + net->ipaddr_ = inet_ntop(ifa->ifa_family, RTA_DATA(ifa_rta), + ipaddr, sizeof (ipaddr)); + net->cidr_ = ifa->ifa_prefixlen; + switch (ifa->ifa_family) { + case AF_INET: { + struct in_addr netmask; + netmask.s_addr = htonl(~0 << (32 - ifa->ifa_prefixlen)); + net->netmask_ = inet_ntop(ifa->ifa_family, &netmask, + ipaddr, sizeof (ipaddr)); + } + case AF_INET6: { + struct in6_addr netmask; + for (int i = 0; i < 16; i++) { + int v = (i + 1) * 8 - ifa->ifa_prefixlen; + if (v < 0) v = 0; + if (v > 8) v = 8; + netmask.s6_addr[i] = ~0 << v; + } + net->netmask_ = inet_ntop(ifa->ifa_family, &netmask, + ipaddr, sizeof (ipaddr)); + } + } + spdlog::debug("network: {}, new addr {}/{}", net->ifname_, net->ipaddr_, net->cidr_); + } else { + net->ipaddr_.clear(); + net->cidr_ = 0; + net->netmask_.clear(); + spdlog::debug("network: {} addr deleted {}/{}", + net->ifname_, + inet_ntop(ifa->ifa_family, RTA_DATA(ifa_rta), + ipaddr, sizeof (ipaddr)), + ifa->ifa_prefixlen); + } + net->dp.emit(); + break; + } + } + } + break; } } - if (nh->nlmsg_type == RTM_DELADDR) { - // Check for valid interface - if (ifi->ifi_index == net->ifid_) { - net->ipaddr_.clear(); - net->netmask_.clear(); - net->cidr_ = 0; - if (!(ifi->ifi_flags & IFF_RUNNING)) { - net->clearIface(); - // Check for a new interface and get info - net->checkNewInterface(ifi); - } else { - net->dp.emit(); - } - return NL_OK; - } - } else { - char ifname[IF_NAMESIZE]; - if_indextoname(ifi->ifi_index, ifname); - // Auto detected network can also be assigned here - if (ifi->ifi_index != net->ifid_ && net->checkInterface(ifi, ifname)) { - // If iface is different, clear data - if (ifi->ifi_index != net->ifid_) { - net->clearIface(); - } - net->ifname_ = ifname; - net->ifid_ = ifi->ifi_index; - } - // Check for valid interface - if (ifi->ifi_index == net->ifid_) { - // Get Iface and WIFI info - net->getInterfaceAddress(); - net->thread_timer_.wake_up(); - return NL_OK; - } - } - return NL_SKIP; + return NL_OK; } void waybar::modules::Network::askForStateDump(void) { @@ -751,6 +741,12 @@ void waybar::modules::Network::askForStateDump(void) { want_link_dump_ = false; dump_in_progress_ = true; + } else if (want_addr_dump_) { + rt_hdr.rtgen_family = family_; + nl_send_simple(ev_sock_, RTM_GETADDR, NLM_F_DUMP, + &rt_hdr, sizeof (rt_hdr)); + want_addr_dump_ = false; + dump_in_progress_ = true; } } From 0bb436f9493424d63e66a39e2dc2f5e6e2ada9a3 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH 195/303] network: Rework interface auto detection, handle route change events Last part of the rework of handleEvents(), this time we take the getExternalInterface() function and add it to the handleEvents() function. That way, waybar can react immediately when a new "external interface" is available and doesn't need to probe. Also that avoid to have two different functions consuming from the same socket and we don't need to recode some of the functions that are already available via libnl (to send and receive messages). --- include/modules/network.hpp | 9 +- src/modules/network.cpp | 356 +++++++++++++++--------------------- 2 files changed, 146 insertions(+), 219 deletions(-) diff --git a/include/modules/network.hpp b/include/modules/network.hpp index cc8b3f5..964597a 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -35,17 +34,12 @@ class Network : public ALabel { void worker(); void createInfoSocket(); void createEventSocket(); - int getExternalInterface(int skip_idx = -1) const; - int netlinkRequest(void*, uint32_t, uint32_t groups = 0) const; - int netlinkResponse(void*, uint32_t, uint32_t groups = 0) const; void parseEssid(struct nlattr**); void parseSignal(struct nlattr**); void parseFreq(struct nlattr**); bool associatedOrJoined(struct nlattr**); - bool checkInterface(struct ifinfomsg* rtif, std::string name); - int getPreferredIface(int skip_idx = -1, bool wait = true) const; + bool checkInterface(std::string name); auto getInfo() -> void; - void checkNewInterface(struct ifinfomsg* rtif); const std::string getNetworkState() const; void clearIface(); bool wildcardMatch(const std::string& pattern, const std::string& text) const; @@ -60,6 +54,7 @@ class Network : public ALabel { int nl80211_id_; std::mutex mutex_; + bool want_route_dump_; bool want_link_dump_; bool want_addr_dump_; bool dump_in_progress_; diff --git a/src/modules/network.cpp b/src/modules/network.cpp index f4cee78..508af91 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -86,6 +86,7 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf family_(config["family"] == "ipv6" ? AF_INET6 : AF_INET), efd_(-1), ev_fd_(-1), + want_route_dump_(false), want_link_dump_(false), want_addr_dump_(false), dump_in_progress_(false), @@ -117,7 +118,11 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf bandwidth_up_total_ = 0; } - if (config_["interface"].isString()) { + if (!config_["interface"].isString()) { + // "interface" isn't configure, then try to guess the external + // interface currently used for internet. + want_route_dump_ = true; + } else { // Look for an interface that match "interface" // and then find the address associated with it. want_link_dump_ = true; @@ -126,14 +131,7 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf createEventSocket(); createInfoSocket(); - auto default_iface = getPreferredIface(-1, false); - if (default_iface != -1) { - ifid_ = default_iface; - char ifname[IF_NAMESIZE]; - if_indextoname(default_iface, ifname); - ifname_ = ifname; - want_addr_dump_ = true; - } + dp.emit(); // Ask for a dump of interfaces and then addresses to populate our // information. First the interface dump, and once done, the callback @@ -184,6 +182,14 @@ void waybar::modules::Network::createEventSocket() { } else { nl_socket_add_membership(ev_sock_, RTNLGRP_IPV6_IFADDR); } + if (!config_["interface"].isString()) { + if (family_ == AF_INET) { + nl_socket_add_membership(ev_sock_, RTNLGRP_IPV4_ROUTE); + } else { + nl_socket_add_membership(ev_sock_, RTNLGRP_IPV6_ROUTE); + } + } + efd_ = epoll_create1(EPOLL_CLOEXEC); if (efd_ < 0) { throw std::runtime_error("Can't create epoll"); @@ -383,196 +389,16 @@ auto waybar::modules::Network::update() -> void { ALabel::update(); } -// Based on https://gist.github.com/Yawning/c70d804d4b8ae78cc698 -int waybar::modules::Network::getExternalInterface(int skip_idx) const { - static const uint32_t route_buffer_size = 8192; - struct nlmsghdr * hdr = nullptr; - struct rtmsg * rt = nullptr; - char resp[route_buffer_size] = {0}; - int ifidx = -1; - - /* Prepare request. */ - constexpr uint32_t reqlen = NLMSG_SPACE(sizeof(*rt)); - char req[reqlen] = {0}; - - /* Build the RTM_GETROUTE request. */ - hdr = reinterpret_cast(req); - hdr->nlmsg_len = NLMSG_LENGTH(sizeof(*rt)); - hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; - hdr->nlmsg_type = RTM_GETROUTE; - rt = static_cast(NLMSG_DATA(hdr)); - rt->rtm_family = family_; - rt->rtm_table = RT_TABLE_MAIN; - - /* Issue the query. */ - if (netlinkRequest(req, reqlen) < 0) { - goto out; - } - - /* Read the response(s). - * - * WARNING: All the packets generated by the request must be consumed (as in, - * consume responses till NLMSG_DONE/NLMSG_ERROR is encountered). - */ - do { - auto len = netlinkResponse(resp, route_buffer_size); - if (len < 0) { - goto out; - } - - /* Parse the response payload into netlink messages. */ - for (hdr = reinterpret_cast(resp); NLMSG_OK(hdr, len); - hdr = NLMSG_NEXT(hdr, len)) { - if (hdr->nlmsg_type == NLMSG_DONE) { - goto out; - } - if (hdr->nlmsg_type == NLMSG_ERROR) { - /* Even if we found the interface index, something is broken with the - * netlink socket, so return an error. - */ - ifidx = -1; - goto out; - } - - /* If we found the correct answer, skip parsing the attributes. */ - if (ifidx != -1) { - continue; - } - - /* Find the message(s) concerting the main routing table, each message - * corresponds to a single routing table entry. - */ - rt = static_cast(NLMSG_DATA(hdr)); - if (rt->rtm_table != RT_TABLE_MAIN) { - continue; - } - - /* Parse all the attributes for a single routing table entry. */ - struct rtattr *attr = RTM_RTA(rt); - uint64_t attrlen = RTM_PAYLOAD(hdr); - bool has_gateway = false; - bool has_destination = false; - int temp_idx = -1; - for (; RTA_OK(attr, attrlen); attr = RTA_NEXT(attr, attrlen)) { - /* Determine if this routing table entry corresponds to the default - * route by seeing if it has a gateway, and if a destination addr is - * set, that it is all 0s. - */ - switch (attr->rta_type) { - case RTA_GATEWAY: - /* The gateway of the route. - * - * If someone every needs to figure out the gateway address as well, - * it's here as the attribute payload. - */ - has_gateway = true; - break; - case RTA_DST: { - /* The destination address. - * Should be either missing, or maybe all 0s. Accept both. - */ - const uint32_t nr_zeroes = (family_ == AF_INET) ? 4 : 16; - unsigned char c = 0; - size_t dstlen = RTA_PAYLOAD(attr); - if (dstlen != nr_zeroes) { - break; - } - for (uint32_t i = 0; i < dstlen; i += 1) { - c |= *((unsigned char *)RTA_DATA(attr) + i); - } - has_destination = (c == 0); - break; - } - case RTA_OIF: - /* The output interface index. */ - temp_idx = *static_cast(RTA_DATA(attr)); - break; - default: - break; - } - } - /* If this is the default route, and we know the interface index, - * we can stop parsing this message. - */ - if (has_gateway && !has_destination && temp_idx != -1 && temp_idx != skip_idx) { - ifidx = temp_idx; - break; - } - } - } while (true); - -out: - return ifidx; -} - -int waybar::modules::Network::netlinkRequest(void *req, uint32_t reqlen, uint32_t groups) const { - struct sockaddr_nl sa = {}; - sa.nl_family = AF_NETLINK; - sa.nl_groups = groups; - struct iovec iov = {req, reqlen}; - struct msghdr msg = { - .msg_name = &sa, - .msg_namelen = sizeof(sa), - .msg_iov = &iov, - .msg_iovlen = 1, - }; - return sendmsg(nl_socket_get_fd(ev_sock_), &msg, 0); -} - -int waybar::modules::Network::netlinkResponse(void *resp, uint32_t resplen, uint32_t groups) const { - struct sockaddr_nl sa = {}; - sa.nl_family = AF_NETLINK; - sa.nl_groups = groups; - struct iovec iov = {resp, resplen}; - struct msghdr msg = { - .msg_name = &sa, - .msg_namelen = sizeof(sa), - .msg_iov = &iov, - .msg_iovlen = 1, - }; - auto ret = recvmsg(nl_socket_get_fd(ev_sock_), &msg, 0); - if (msg.msg_flags & MSG_TRUNC) { - return -1; - } - return ret; -} - -bool waybar::modules::Network::checkInterface(struct ifinfomsg *rtif, std::string name) { +bool waybar::modules::Network::checkInterface(std::string name) { if (config_["interface"].isString()) { return config_["interface"].asString() == name || wildcardMatch(config_["interface"].asString(), name); } - // getExternalInterface may need some delay to detect external interface - for (uint8_t tries = 0; tries < MAX_RETRY; tries += 1) { - auto external_iface = getExternalInterface(); - if (external_iface > 0) { - return external_iface == rtif->ifi_index; - } - std::this_thread::sleep_for(std::chrono::milliseconds(500)); - } return false; } -int waybar::modules::Network::getPreferredIface(int skip_idx, bool wait) const { - int ifid = -1; - if (config_["interface"].isString()) { - // Using link dump instead - return -1; - } - // getExternalInterface may need some delay to detect external interface - for (uint8_t tries = 0; tries < MAX_RETRY; tries += 1) { - ifid = getExternalInterface(skip_idx); - if (ifid > 0) { - return ifid; - } - if (wait) { - std::this_thread::sleep_for(std::chrono::milliseconds(500)); - } - } - return -1; -} - void waybar::modules::Network::clearIface() { + ifid_ = -1; essid_.clear(); ipaddr_.clear(); netmask_.clear(); @@ -582,22 +408,6 @@ void waybar::modules::Network::clearIface() { frequency_ = 0; } -void waybar::modules::Network::checkNewInterface(struct ifinfomsg *rtif) { - auto new_iface = getPreferredIface(rtif->ifi_index); - if (new_iface != -1) { - ifid_ = new_iface; - char ifname[IF_NAMESIZE]; - if_indextoname(new_iface, ifname); - ifname_ = ifname; - want_addr_dump_ = true; - askForStateDump(); - thread_timer_.wake_up(); - } else { - ifid_ = -1; - dp.emit(); - } -} - int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { auto net = static_cast(data); std::lock_guard lock(net->mutex_); @@ -627,10 +437,16 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { } } - if (!is_del_event && net->ifid_ == -1) { + if (!is_del_event && ifi->ifi_index == net->ifid_) { + // Update inferface information + if (net->ifname_.empty()) { + std::string new_ifname (ifname, ifname_len); + net->ifname_ = new_ifname; + } + } else if (!is_del_event && net->ifid_ == -1) { // Checking if it's an interface we care about. std::string new_ifname (ifname, ifname_len); - if (net->checkInterface(ifi, new_ifname)) { + if (net->checkInterface(new_ifname)) { spdlog::debug("network: selecting new interface {}/{}", new_ifname, ifi->ifi_index); net->ifname_ = new_ifname; @@ -647,8 +463,6 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { spdlog::debug("network: interface {}/{} deleted", net->ifname_, net->ifid_); net->clearIface(); - // Check for a new interface and get info - net->checkNewInterface(ifi); net->dp.emit(); } break; @@ -720,6 +534,117 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { } break; } + + case RTM_DELROUTE: + is_del_event = true; + case RTM_NEWROUTE: { + // Based on https://gist.github.com/Yawning/c70d804d4b8ae78cc698 + // to find the interface used to reach the outside world + + struct rtmsg *rtm = static_cast(NLMSG_DATA(nh)); + ssize_t attrlen = RTM_PAYLOAD(nh); + struct rtattr *attr = RTM_RTA(rtm); + bool has_gateway = false; + bool has_destination = false; + int temp_idx = -1; + + /* If we found the correct answer, skip parsing the attributes. */ + if (!is_del_event && net->ifid_ != -1) { + return NL_OK; + } + + /* Find the message(s) concerting the main routing table, each message + * corresponds to a single routing table entry. + */ + if (rtm->rtm_table != RT_TABLE_MAIN) { + return NL_OK; + } + + /* Parse all the attributes for a single routing table entry. */ + for (; RTA_OK(attr, attrlen); attr = RTA_NEXT(attr, attrlen)) { + /* Determine if this routing table entry corresponds to the default + * route by seeing if it has a gateway, and if a destination addr is + * set, that it is all 0s. + */ + switch(attr->rta_type) { + case RTA_GATEWAY: + /* The gateway of the route. + * + * If someone every needs to figure out the gateway address as well, + * it's here as the attribute payload. + */ + has_gateway = true; + break; + case RTA_DST: { + /* The destination address. + * Should be either missing, or maybe all 0s. Accept both. + */ + const uint32_t nr_zeroes = (net->family_ == AF_INET) ? 4 : 16; + unsigned char c = 0; + size_t dstlen = RTA_PAYLOAD(attr); + if (dstlen != nr_zeroes) { + break; + } + for (uint32_t i = 0; i < dstlen; i += 1) { + c |= *((unsigned char *)RTA_DATA(attr) + i); + } + has_destination = (c == 0); + break; + } + case RTA_OIF: + /* The output interface index. */ + temp_idx = *static_cast(RTA_DATA(attr)); + break; + default: + break; + } + + /* If this is the default route, and we know the interface index, + * we can stop parsing this message. + */ + if (has_gateway && !has_destination && temp_idx != -1) { + if (!is_del_event) { + net->ifid_ = temp_idx; + + spdlog::debug("network: new default route via if{}", temp_idx); + + /* Ask ifname associated with temp_idx as well as carrier status */ + struct ifinfomsg ifinfo_hdr = { + .ifi_family = AF_UNSPEC, + .ifi_index = temp_idx, + }; + int err; + err = nl_send_simple(net->ev_sock_, RTM_GETLINK, NLM_F_REQUEST, + &ifinfo_hdr, sizeof (ifinfo_hdr)); + if (err < 0) { + spdlog::error("network: failed to ask link info: {}", err); + /* Ask for a dump of all links instead */ + net->want_link_dump_ = true; + } + + /* Also ask for the address. Asking for a addresses of a specific + * interface doesn't seems to work so ask for a dump of all + * addresses. */ + net->want_addr_dump_ = true; + net->askForStateDump(); + net->thread_timer_.wake_up(); + } else if (is_del_event && temp_idx == net->ifid_) { + spdlog::debug("network: default route deleted {}/if{}", + net->ifname_, temp_idx); + + net->ifname_.clear(); + net->clearIface(); + net->dp.emit(); + /* Ask for a dump of all routes in case another one is already + * setup. If there's none, there'll be an event with new one + * later. */ + net->want_route_dump_ = true; + net->askForStateDump(); + } + } + } + break; + } } return NL_OK; @@ -735,7 +660,14 @@ void waybar::modules::Network::askForStateDump(void) { .rtgen_family = AF_UNSPEC, }; - if (want_link_dump_) { + if (want_route_dump_) { + rt_hdr.rtgen_family = family_; + nl_send_simple(ev_sock_, RTM_GETROUTE, NLM_F_DUMP, + &rt_hdr, sizeof (rt_hdr)); + want_route_dump_ = false; + dump_in_progress_ = true; + + } else if (want_link_dump_) { nl_send_simple(ev_sock_, RTM_GETLINK, NLM_F_DUMP, &rt_hdr, sizeof (rt_hdr)); want_link_dump_ = false; From c1427ff8072aa9573a09941fbaa1c45af5005d89 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH 196/303] network: Handle carrier information IFLA_CARRIER allows to know when a cable is plugged to the Ethernet card or when the WiFi is connected. If there's no carrier, the interface will be considered disconnected. --- include/modules/network.hpp | 1 + src/modules/network.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/modules/network.hpp b/include/modules/network.hpp index 964597a..2523dc2 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -64,6 +64,7 @@ class Network : public ALabel { std::string state_; std::string essid_; + bool carrier_; std::string ifname_; std::string ipaddr_; std::string netmask_; diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 508af91..6102a43 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -292,6 +292,7 @@ const std::string waybar::modules::Network::getNetworkState() const { #endif return "disconnected"; } + if (!carrier_) return "disconnected"; if (ipaddr_.empty()) return "linked"; if (essid_.empty()) return "ethernet"; return "wifi"; @@ -402,6 +403,7 @@ void waybar::modules::Network::clearIface() { essid_.clear(); ipaddr_.clear(); netmask_.clear(); + carrier_ = false; cidr_ = 0; signal_strength_dbm_ = 0; signal_strength_ = 0; @@ -423,6 +425,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { struct rtattr *ifla = IFLA_RTA(ifi); const char *ifname = NULL; size_t ifname_len = 0; + bool carrier = false; if (net->ifid_ != -1 && ifi->ifi_index != net->ifid_) { return NL_OK; @@ -434,6 +437,10 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { ifname = static_cast(RTA_DATA(ifla)); ifname_len = RTA_PAYLOAD(ifla) - 1; // minus \0 break; + case IFLA_CARRIER: { + carrier = *(char*)RTA_DATA(ifla) == 1; + break; + } } } @@ -443,6 +450,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { std::string new_ifname (ifname, ifname_len); net->ifname_ = new_ifname; } + net->carrier_ = carrier; } else if (!is_del_event && net->ifid_ == -1) { // Checking if it's an interface we care about. std::string new_ifname (ifname, ifname_len); @@ -451,6 +459,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->ifname_ = new_ifname; net->ifid_ = ifi->ifi_index; + net->carrier_ = carrier; net->thread_timer_.wake_up(); /* An address for this new interface should be received via an * RTM_NEWADDR event either because we ask for a dump of both links From c65ec9e14fa3509c2da67551e14add961f9850ce Mon Sep 17 00:00:00 2001 From: Yonatan Avhar Date: Fri, 21 May 2021 15:54:48 +0300 Subject: [PATCH 197/303] Add options to use a .json extension for the config filename --- src/client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client.cpp b/src/client.cpp index 1c48c81..f6330c3 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -207,9 +207,13 @@ std::tuple waybar::Client::getConfigs( const std::string &config, const std::string &style) const { auto config_file = config.empty() ? getValidPath({ "$XDG_CONFIG_HOME/waybar/config", + "$XDG_CONFIG_HOME/waybar/config.json", "$HOME/.config/waybar/config", + "$HOME/.config/waybar/config.json", "$HOME/waybar/config", + "$HOME/waybar/config.json", "/etc/xdg/waybar/config", + "/etc/xdg/waybar/config.json", SYSCONFDIR "/xdg/waybar/config", "./resources/config", }) From 99918205ede41e80fc5e55e0b2582ae3fc613e21 Mon Sep 17 00:00:00 2001 From: Yonatan Avhar Date: Fri, 21 May 2021 17:53:43 +0300 Subject: [PATCH 198/303] Correct .json to .jsonc --- src/client.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index f6330c3..ced9e49 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -207,13 +207,13 @@ std::tuple waybar::Client::getConfigs( const std::string &config, const std::string &style) const { auto config_file = config.empty() ? getValidPath({ "$XDG_CONFIG_HOME/waybar/config", - "$XDG_CONFIG_HOME/waybar/config.json", + "$XDG_CONFIG_HOME/waybar/config.jsonc", "$HOME/.config/waybar/config", - "$HOME/.config/waybar/config.json", + "$HOME/.config/waybar/config.jsonc", "$HOME/waybar/config", - "$HOME/waybar/config.json", + "$HOME/waybar/config.jsonc", "/etc/xdg/waybar/config", - "/etc/xdg/waybar/config.json", + "/etc/xdg/waybar/config.jsonc", SYSCONFDIR "/xdg/waybar/config", "./resources/config", }) From 729553d3bc8eeb3c7a5370692174d9962d242e9b Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 17 Jan 2021 01:05:18 -0800 Subject: [PATCH 199/303] feat(bar): add config flag for pointer event passthrough --- include/bar.hpp | 1 + src/bar.cpp | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/include/bar.hpp b/include/bar.hpp index d6cd895..6bf8c52 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -44,6 +44,7 @@ class BarSurface { virtual void setExclusiveZone(bool enable) = 0; virtual void setLayer(bar_layer layer) = 0; virtual void setMargins(const struct bar_margins &margins) = 0; + virtual void setPassThrough(bool enable) = 0; virtual void setPosition(const std::string_view &position) = 0; virtual void setSize(uint32_t width, uint32_t height) = 0; virtual void commit(){}; diff --git a/src/bar.cpp b/src/bar.cpp index 1dbd69a..3361ebf 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -33,6 +33,7 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { gtk_layer_set_monitor(window_.gobj(), output.monitor->gobj()); gtk_layer_set_namespace(window_.gobj(), "waybar"); + window.signal_map_event().connect_notify(sigc::mem_fun(*this, &GLSSurfaceImpl::onMap)); window.signal_configure_event().connect_notify( sigc::mem_fun(*this, &GLSSurfaceImpl::onConfigure)); } @@ -62,6 +63,18 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { gtk_layer_set_layer(window_.gobj(), layer); } + void setPassThrough(bool enable) override { + passthrough_ = enable; + auto gdk_window = window_.get_window(); + if (gdk_window) { + Cairo::RefPtr region; + if (enable) { + region = Cairo::Region::create(); + } + gdk_window->input_shape_combine_region(region, 0, 0); + } + } + void setPosition(const std::string_view& position) override { auto unanchored = GTK_LAYER_SHELL_EDGE_BOTTOM; vertical_ = false; @@ -93,8 +106,11 @@ struct GLSSurfaceImpl : public BarSurface, public sigc::trackable { std::string output_name_; uint32_t width_; uint32_t height_; + bool passthrough_ = false; bool vertical_ = false; + void onMap(GdkEventAny* ev) { setPassThrough(passthrough_); } + void onConfigure(GdkEventConfigure* ev) { /* * GTK wants new size for the window. @@ -182,6 +198,20 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { } } + void setPassThrough(bool enable) override { + passthrough_ = enable; + /* GTK overwrites any region changes applied directly to the wl_surface, + * thus the same GTK region API as in the GLS impl has to be used. */ + auto gdk_window = window_.get_window(); + if (gdk_window) { + Cairo::RefPtr region; + if (enable) { + region = Cairo::Region::create(); + } + gdk_window->input_shape_combine_region(region, 0, 0); + } + } + void setPosition(const std::string_view& position) override { anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; if (position == "bottom") { @@ -230,6 +260,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { uint32_t height_ = 0; uint8_t anchor_ = HORIZONTAL_ANCHOR | ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; bool exclusive_zone_ = true; + bool passthrough_ = false; struct bar_margins margins_; zwlr_layer_shell_v1_layer layer_ = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; @@ -262,6 +293,7 @@ struct RawSurfaceImpl : public BarSurface, public sigc::trackable { setSurfaceSize(width_, height_); setExclusiveZone(exclusive_zone_); + setPassThrough(passthrough_); commit(); wl_display_roundtrip(client->wl_display); @@ -377,6 +409,14 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) layer_ = bar_layer::OVERLAY; } + bool passthrough = false; + if (config["passthrough"].isBool()) { + passthrough = config["passthrough"].asBool(); + } else if (layer_ == bar_layer::OVERLAY) { + // swaybar defaults: overlay mode does not accept pointer events. + passthrough = true; + } + auto position = config["position"].asString(); if (position == "right" || position == "left") { @@ -386,7 +426,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) box_ = Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0); vertical = true; } - + left_.get_style_context()->add_class("modules-left"); center_.get_style_context()->add_class("modules-center"); right_.get_style_context()->add_class("modules-right"); @@ -454,6 +494,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) surface_impl_->setLayer(layer_); surface_impl_->setExclusiveZone(true); surface_impl_->setMargins(margins_); + surface_impl_->setPassThrough(passthrough); surface_impl_->setPosition(position); surface_impl_->setSize(width, height); From 7aaa3df701cdf660c915efec5ee3145180dac9c7 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 17 Jan 2021 01:40:25 -0800 Subject: [PATCH 200/303] feat(bar): add config flag to disable exclusive zone --- include/bar.hpp | 1 + src/bar.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 6bf8c52..6f3dfcf 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -65,6 +65,7 @@ class Bar { struct waybar_output *output; Json::Value config; struct wl_surface * surface; + bool exclusive = true; bool visible = true; bool vertical = false; Gtk::Window window; diff --git a/src/bar.cpp b/src/bar.cpp index 3361ebf..7d76359 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -409,6 +409,13 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) layer_ = bar_layer::OVERLAY; } + if (config["exclusive"].isBool()) { + exclusive = config["exclusive"].asBool(); + } else if (layer_ == bar_layer::OVERLAY) { + // swaybar defaults: overlay mode does not reserve an exclusive zone + exclusive = false; + } + bool passthrough = false; if (config["passthrough"].isBool()) { passthrough = config["passthrough"].asBool(); @@ -492,7 +499,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) } surface_impl_->setLayer(layer_); - surface_impl_->setExclusiveZone(true); + surface_impl_->setExclusiveZone(exclusive); surface_impl_->setMargins(margins_); surface_impl_->setPassThrough(passthrough); surface_impl_->setPosition(position); @@ -533,7 +540,7 @@ void waybar::Bar::setVisible(bool value) { window.set_opacity(1); surface_impl_->setLayer(layer_); } - surface_impl_->setExclusiveZone(visible); + surface_impl_->setExclusiveZone(exclusive && visible); surface_impl_->commit(); } From da2d603b53d42f68c41055731bd3a4a50dc11f9b Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 21 May 2021 22:38:48 -0700 Subject: [PATCH 201/303] doc: add man for exclusive and passthrough flags --- man/waybar.5.scd.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/man/waybar.5.scd.in b/man/waybar.5.scd.in index 430b9fc..fe11c4a 100644 --- a/man/waybar.5.scd.in +++ b/man/waybar.5.scd.in @@ -68,6 +68,17 @@ Also a minimal example configuration can be found on the at the bottom of this m typeof: string ++ Optional name added as a CSS class, for styling multiple waybars. +*exclusive* ++ + typeof: bool ++ + default: *true* unless the layer is set to *overlay* ++ + Option to request an exclusive zone from the compositor. Disable this to allow drawing application windows underneath or on top of the bar. + +*passthrough* ++ + typeof: bool ++ + default: *false* unless the layer is set to *overlay* ++ + Option to pass any pointer events to the window under the bar. + Intended to be used with either *top* or *overlay* layers and without exclusive zone. + *gtk-layer-shell* ++ typeof: bool ++ default: true ++ From 28dfb0ba41f2d0f97b2f84de77e878c6c24fc29d Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Wed, 26 May 2021 18:28:49 +0100 Subject: [PATCH 202/303] network: Fix use of carrier information Some RTM_NEWLINK messages may not have the IFLA_CARRIER information. This is the case when a WiFi interface report scan result are available. `carrier` is used regardless of if it is present in the message or not. This would result in the interface appearing "disconnected" in waybar when it isn't. This patch now check that `carrier` is available before using it. The same thing could potentially happen to `ifname` so check if it's set before recording it. Fixes: c1427ff (network: Handle carrier information) Fixes #388 --- src/modules/network.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 6102a43..9e0ed39 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -425,7 +425,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { struct rtattr *ifla = IFLA_RTA(ifi); const char *ifname = NULL; size_t ifname_len = 0; - bool carrier = false; + std::optional carrier; if (net->ifid_ != -1 && ifi->ifi_index != net->ifid_) { return NL_OK; @@ -446,11 +446,13 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { if (!is_del_event && ifi->ifi_index == net->ifid_) { // Update inferface information - if (net->ifname_.empty()) { + if (net->ifname_.empty() && ifname != NULL) { std::string new_ifname (ifname, ifname_len); net->ifname_ = new_ifname; } - net->carrier_ = carrier; + if (carrier.has_value()) { + net->carrier_ = carrier.value(); + } } else if (!is_del_event && net->ifid_ == -1) { // Checking if it's an interface we care about. std::string new_ifname (ifname, ifname_len); @@ -459,7 +461,9 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->ifname_ = new_ifname; net->ifid_ = ifi->ifi_index; - net->carrier_ = carrier; + if (carrier.has_value()) { + net->carrier_ = carrier.value(); + } net->thread_timer_.wake_up(); /* An address for this new interface should be received via an * RTM_NEWADDR event either because we ask for a dump of both links From f49a7a1acbe8489f37a88f5c8f7941a44bb90ac7 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Wed, 26 May 2021 18:51:02 +0100 Subject: [PATCH 203/303] network: Update WiFi information when available The module doesn't update the `essid_` as soon as a WiFi interface is connected, but that happens at some point later, depending on "interval" configuration. Fix that by rerunning the get WiFi information thread when the `carrier` state changes. Also, we will clear the state related to WiFi when the connection is drop to avoid stale information. --- src/modules/network.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 9e0ed39..583daae 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -451,6 +451,18 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->ifname_ = new_ifname; } if (carrier.has_value()) { + if (net->carrier_ != *carrier) { + if (*carrier) { + // Ask for WiFi information + net->thread_timer_.wake_up(); + } else { + // clear state related to WiFi connection + net->essid_.clear(); + net->signal_strength_dbm_ = 0; + net->signal_strength_ = 0; + net->frequency_ = 0; + } + } net->carrier_ = carrier.value(); } } else if (!is_del_event && net->ifid_ == -1) { From 999c1b6b81c5fe29c32e1e4450d49d67d0e6570c Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Sat, 5 Jun 2021 14:50:25 +0200 Subject: [PATCH 204/303] sway-language: ignore events with empty layout --- src/modules/sway/language.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index a318647..4d27fb8 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -45,7 +45,9 @@ void Language::onEvent(const struct Ipc::ipc_response& res) { auto payload = parser_.parse(res.payload)["input"]; if (payload["type"].asString() == "keyboard") { auto layout_name = payload["xkb_active_layout_name"].asString().substr(0,2); - lang_ = Glib::Markup::escape_text(layout_name); + if (!layout_name.empty()) { + lang_ = Glib::Markup::escape_text(layout_name); + } } dp.emit(); } catch (const std::exception& e) { From 23b9923eeba13bdba51b601f2c5c7e4f20b8710a Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sun, 30 May 2021 15:56:56 +0100 Subject: [PATCH 205/303] network: Parse whole RTM_NEWROUTE msg before interpreting it The check to figure out if we have the default route should be after the for loop that parses the route attributes, to avoid acting on incomplete information. We are going to use more fields from the message. --- src/modules/network.cpp | 76 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 583daae..3edc4dc 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -623,49 +623,47 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { default: break; } + } - /* If this is the default route, and we know the interface index, - * we can stop parsing this message. - */ - if (has_gateway && !has_destination && temp_idx != -1) { - if (!is_del_event) { - net->ifid_ = temp_idx; + // Check if we have a default route. + if (has_gateway && !has_destination && temp_idx != -1) { + if (!is_del_event) { + net->ifid_ = temp_idx; - spdlog::debug("network: new default route via if{}", temp_idx); + spdlog::debug("network: new default route via if{}", temp_idx); - /* Ask ifname associated with temp_idx as well as carrier status */ - struct ifinfomsg ifinfo_hdr = { - .ifi_family = AF_UNSPEC, - .ifi_index = temp_idx, - }; - int err; - err = nl_send_simple(net->ev_sock_, RTM_GETLINK, NLM_F_REQUEST, - &ifinfo_hdr, sizeof (ifinfo_hdr)); - if (err < 0) { - spdlog::error("network: failed to ask link info: {}", err); - /* Ask for a dump of all links instead */ - net->want_link_dump_ = true; - } - - /* Also ask for the address. Asking for a addresses of a specific - * interface doesn't seems to work so ask for a dump of all - * addresses. */ - net->want_addr_dump_ = true; - net->askForStateDump(); - net->thread_timer_.wake_up(); - } else if (is_del_event && temp_idx == net->ifid_) { - spdlog::debug("network: default route deleted {}/if{}", - net->ifname_, temp_idx); - - net->ifname_.clear(); - net->clearIface(); - net->dp.emit(); - /* Ask for a dump of all routes in case another one is already - * setup. If there's none, there'll be an event with new one - * later. */ - net->want_route_dump_ = true; - net->askForStateDump(); + /* Ask ifname associated with temp_idx as well as carrier status */ + struct ifinfomsg ifinfo_hdr = { + .ifi_family = AF_UNSPEC, + .ifi_index = temp_idx, + }; + int err; + err = nl_send_simple(net->ev_sock_, RTM_GETLINK, NLM_F_REQUEST, + &ifinfo_hdr, sizeof (ifinfo_hdr)); + if (err < 0) { + spdlog::error("network: failed to ask link info: {}", err); + /* Ask for a dump of all links instead */ + net->want_link_dump_ = true; } + + /* Also ask for the address. Asking for a addresses of a specific + * interface doesn't seems to work so ask for a dump of all + * addresses. */ + net->want_addr_dump_ = true; + net->askForStateDump(); + net->thread_timer_.wake_up(); + } else if (is_del_event && temp_idx == net->ifid_) { + spdlog::debug("network: default route deleted {}/if{}", + net->ifname_, temp_idx); + + net->ifname_.clear(); + net->clearIface(); + net->dp.emit(); + /* Ask for a dump of all routes in case another one is already + * setup. If there's none, there'll be an event with new one + * later. */ + net->want_route_dump_ = true; + net->askForStateDump(); } } break; From ce97df34e69689d97adbf481ef65997beb4f3f98 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 5 Jun 2021 15:44:32 +0100 Subject: [PATCH 206/303] network: Also clear ifname in clearIface() Since we reset `ifid_`, clear `ifname_` as well. --- src/modules/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 3edc4dc..e895569 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -400,6 +400,7 @@ bool waybar::modules::Network::checkInterface(std::string name) { void waybar::modules::Network::clearIface() { ifid_ = -1; + ifname_.clear(); essid_.clear(); ipaddr_.clear(); netmask_.clear(); @@ -656,7 +657,6 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { spdlog::debug("network: default route deleted {}/if{}", net->ifname_, temp_idx); - net->ifname_.clear(); net->clearIface(); net->dp.emit(); /* Ask for a dump of all routes in case another one is already From efaac20d8200b2249668773fa96ef40ea66fe4fe Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Wed, 2 Jun 2021 22:15:34 +0100 Subject: [PATCH 207/303] network: Handle ip route priority When there's a new default route with higher priority, switch to it. --- include/modules/network.hpp | 1 + src/modules/network.cpp | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/modules/network.hpp b/include/modules/network.hpp index 2523dc2..009ae5a 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -72,6 +72,7 @@ class Network : public ALabel { int32_t signal_strength_dbm_; uint8_t signal_strength_; uint32_t frequency_; + uint32_t route_priority; util::SleeperThread thread_; util::SleeperThread thread_timer_; diff --git a/src/modules/network.cpp b/src/modules/network.cpp index e895569..de023ef 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -573,11 +573,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { bool has_gateway = false; bool has_destination = false; int temp_idx = -1; - - /* If we found the correct answer, skip parsing the attributes. */ - if (!is_del_event && net->ifid_ != -1) { - return NL_OK; - } + uint32_t priority = 0; /* Find the message(s) concerting the main routing table, each message * corresponds to a single routing table entry. @@ -621,6 +617,9 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { /* The output interface index. */ temp_idx = *static_cast(RTA_DATA(attr)); break; + case RTA_PRIORITY: + priority = *(uint32_t*)RTA_DATA(attr); + break; default: break; } @@ -628,10 +627,16 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { // Check if we have a default route. if (has_gateway && !has_destination && temp_idx != -1) { - if (!is_del_event) { + // Check if this is the first default route we see, or if this new + // route have a higher priority. + if (!is_del_event && ((net->ifid_ == -1) || (priority < net->route_priority))) { + // Clear if's state for the case were there is a higher priority + // route on a different interface. + net->clearIface(); net->ifid_ = temp_idx; + net->route_priority = priority; - spdlog::debug("network: new default route via if{}", temp_idx); + spdlog::debug("network: new default route via if{} metric {}", temp_idx, priority); /* Ask ifname associated with temp_idx as well as carrier status */ struct ifinfomsg ifinfo_hdr = { @@ -653,9 +658,10 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->want_addr_dump_ = true; net->askForStateDump(); net->thread_timer_.wake_up(); - } else if (is_del_event && temp_idx == net->ifid_) { - spdlog::debug("network: default route deleted {}/if{}", - net->ifname_, temp_idx); + } else if (is_del_event && temp_idx == net->ifid_ + && net->route_priority == priority) { + spdlog::debug("network: default route deleted {}/if{} metric {}", + net->ifname_, temp_idx, priority); net->clearIface(); net->dp.emit(); From 33617b67f0c342f15a72da413c4e6b0b46f9e196 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Wed, 2 Jun 2021 22:16:28 +0100 Subject: [PATCH 208/303] network: Fix one case where default route is deleted without notification When an interface's state is change to "down", all the route associated with it are deleted without an RTM_DELROUTE event. So when this happen, reset the module to start looking for a new external interface / default route. Fixes #1117 --- src/modules/network.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index de023ef..ec221a2 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -1,6 +1,7 @@ #include "modules/network.hpp" #include #include +#include #include #include #include @@ -432,6 +433,20 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { return NL_OK; } + // Check if the interface goes "down" and if we want to detect the + // external interface. + if (net->ifid_ != -1 && !(ifi->ifi_flags & IFF_UP) + && !net->config_["interface"].isString()) { + // The current interface is now down, all the routes associated with + // it have been deleted, so start looking for a new default route. + spdlog::debug("network: if{} down", net->ifid_); + net->clearIface(); + net->dp.emit(); + net->want_route_dump_ = true; + net->askForStateDump(); + return NL_OK; + } + for (; RTA_OK(ifla, attrlen); ifla = RTA_NEXT(ifla, attrlen)) { switch (ifla->rta_type) { case IFLA_IFNAME: From 194f4c2f18799633a1877fb79ea82c47f4aa30c7 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Mon, 7 Jun 2021 19:24:38 +0100 Subject: [PATCH 209/303] network: Fix mix use of default and state specific format Whenever the network module is configured with both "format" and "format-$state" and when the module use "format-$state" once, it override the value that was saved from "format". For example, if both "format" and "format-disconnect" are configured, and only those, as soon as the module show information about a disconnected interface, it will keep showing the format for disconnected, even if the interface is connected again later. Fix that by always setting a value to default_format_ in update() and thus use the intended default format when needed. Fixes #1129 --- src/modules/network.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index ec221a2..7d0f638 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -19,6 +19,7 @@ constexpr const char *NETSTAT_FILE = constexpr std::string_view BANDWIDTH_CATEGORY = "IpExt"; constexpr std::string_view BANDWIDTH_DOWN_TOTAL_KEY = "InOctets"; constexpr std::string_view BANDWIDTH_UP_TOTAL_KEY = "OutOctets"; +constexpr const char *DEFAULT_FORMAT = "{ifname}"; std::ifstream netstat(NETSTAT_FILE); std::optional read_netstat(std::string_view category, std::string_view key) { @@ -82,7 +83,7 @@ std::optional read_netstat(std::string_view category, std::s } // namespace waybar::modules::Network::Network(const std::string &id, const Json::Value &config) - : ALabel(config, "network", id, "{ifname}", 60), + : ALabel(config, "network", id, DEFAULT_FORMAT, 60), ifid_(-1), family_(config["family"] == "ipv6" ? AF_INET6 : AF_INET), efd_(-1), @@ -323,6 +324,10 @@ auto waybar::modules::Network::update() -> void { } if (config_["format-" + state].isString()) { default_format_ = config_["format-" + state].asString(); + } else if (config_["format"].isString()) { + default_format_ = config_["format"].asString(); + } else { + default_format_ = DEFAULT_FORMAT; } if (config_["tooltip-format-" + state].isString()) { tooltip_format = config_["tooltip-format-" + state].asString(); From 5da268077cb0e53a5ff46fe9ca2dee8bf8e1c041 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 4 Jun 2021 20:22:16 -0700 Subject: [PATCH 210/303] fix(util): protect std::condition_variable methods from pthread_cancel The changes in GCC 11.x made `std::condition_variable` implementation internals `noexcept`. `noexcept` is known to interact particularly bad with `pthread_cancel`, i.e. `__cxxabiv1::__force_unwind` passing through the `noexcept` call stack frame causes a `std::terminate` call and immediate termination of the program Digging through the GCC ML archives[1] lead me to the idea of patching this with a few pthread_setcancelstate's. As bad as the solution is, it seems to be the best we can do within C++17 limits and without major rework. [1]: https://gcc.gnu.org/legacy-ml/gcc/2017-08/msg00156.html --- include/util/sleeper_thread.hpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/include/util/sleeper_thread.hpp b/include/util/sleeper_thread.hpp index 9adbe8f..d1c6ba0 100644 --- a/include/util/sleeper_thread.hpp +++ b/include/util/sleeper_thread.hpp @@ -8,6 +8,20 @@ namespace waybar::util { +/** + * Defer pthread_cancel until the end of a current scope. + * + * Required to protect a scope where it's unsafe to raise `__forced_unwind` exception. + * An example of these is a call of a method marked as `noexcept`; an attempt to cancel within such + * a method may result in a `std::terminate` call. + */ +class CancellationGuard { + int oldstate; +public: + CancellationGuard() { pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate); } + ~CancellationGuard() { pthread_setcancelstate(oldstate, &oldstate); } +}; + class SleeperThread { public: SleeperThread() = default; @@ -33,14 +47,16 @@ class SleeperThread { bool isRunning() const { return do_run_; } auto sleep_for(std::chrono::system_clock::duration dur) { - std::unique_lock lk(mutex_); + std::unique_lock lk(mutex_); + CancellationGuard cancel_lock; return condvar_.wait_for(lk, dur, [this] { return signal_ || !do_run_; }); } auto sleep_until( std::chrono::time_point time_point) { - std::unique_lock lk(mutex_); + std::unique_lock lk(mutex_); + CancellationGuard cancel_lock; return condvar_.wait_until(lk, time_point, [this] { return signal_ || !do_run_; }); } From 14f626d422a77b51bca4bbbe5282ee6e995169e0 Mon Sep 17 00:00:00 2001 From: Oskar Carl Date: Sun, 24 Jan 2021 17:36:30 +0100 Subject: [PATCH 211/303] Add recursive config includes --- include/client.hpp | 1 + src/client.cpp | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/client.hpp b/include/client.hpp index ec3866a..af6eeef 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -39,6 +39,7 @@ class Client { void handleOutput(struct waybar_output &output); bool isValidOutput(const Json::Value &config, struct waybar_output &output); auto setupConfig(const std::string &config_file) -> void; + auto mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void; auto setupCss(const std::string &css_file) -> void; struct waybar_output & getOutput(void *); std::vector getOutputConfigs(struct waybar_output &output); diff --git a/src/client.cpp b/src/client.cpp index ced9e49..752574d 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -241,7 +241,24 @@ auto waybar::Client::setupConfig(const std::string &config_file) -> void { } std::string str((std::istreambuf_iterator(file)), std::istreambuf_iterator()); util::JsonParser parser; - config_ = parser.parse(str); + Json::Value tmp_config_ = parser.parse(str); + if (tmp_config_["include"].isArray()) { + for (const auto& include : tmp_config_["include"]) { + spdlog::info("Including resource file: {}", include.asString()); + setupConfig(getValidPath({include.asString()})); + } + } + mergeConfig(config_, tmp_config_); +} + +auto waybar::Client::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void { + for (const auto& key : b_config_.getMemberNames()) { + if (a_config_[key].type() == Json::objectValue && b_config_[key].type() == Json::objectValue) { + mergeConfig(a_config_[key], b_config_[key]); + } else { + a_config_[key] = b_config_[key]; + } + } } auto waybar::Client::setupCss(const std::string &css_file) -> void { From e8278431d281e6bfa2cae15c6874963711a1396b Mon Sep 17 00:00:00 2001 From: Oskar Carl Date: Sun, 24 Jan 2021 18:32:05 +0100 Subject: [PATCH 212/303] Proper formatting --- src/client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 752574d..7f3229c 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -241,9 +241,9 @@ auto waybar::Client::setupConfig(const std::string &config_file) -> void { } std::string str((std::istreambuf_iterator(file)), std::istreambuf_iterator()); util::JsonParser parser; - Json::Value tmp_config_ = parser.parse(str); + Json::Value tmp_config_ = parser.parse(str); if (tmp_config_["include"].isArray()) { - for (const auto& include : tmp_config_["include"]) { + for (const auto &include : tmp_config_["include"]) { spdlog::info("Including resource file: {}", include.asString()); setupConfig(getValidPath({include.asString()})); } @@ -252,7 +252,7 @@ auto waybar::Client::setupConfig(const std::string &config_file) -> void { } auto waybar::Client::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void { - for (const auto& key : b_config_.getMemberNames()) { + for (const auto &key : b_config_.getMemberNames()) { if (a_config_[key].type() == Json::objectValue && b_config_[key].type() == Json::objectValue) { mergeConfig(a_config_[key], b_config_[key]); } else { From e62b634f72a9b91a6f2e94ba04a7ac60bcee23cb Mon Sep 17 00:00:00 2001 From: Oskar Carl Date: Mon, 21 Jun 2021 19:29:09 +0200 Subject: [PATCH 213/303] Workaround for circular imports --- include/client.hpp | 2 +- src/client.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index af6eeef..a54bf4b 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -38,7 +38,7 @@ class Client { const std::string getValidPath(const std::vector &paths) const; void handleOutput(struct waybar_output &output); bool isValidOutput(const Json::Value &config, struct waybar_output &output); - auto setupConfig(const std::string &config_file) -> void; + auto setupConfig(const std::string &config_file, int depth) -> void; auto mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void; auto setupCss(const std::string &css_file) -> void; struct waybar_output & getOutput(void *); diff --git a/src/client.cpp b/src/client.cpp index 7f3229c..07c0b23 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -234,7 +234,10 @@ std::tuple waybar::Client::getConfigs( return {config_file, css_file}; } -auto waybar::Client::setupConfig(const std::string &config_file) -> void { +auto waybar::Client::setupConfig(const std::string &config_file, int depth) -> void { + if (depth > 100) { + throw std::runtime_error("Aborting due to likely recursive include in config files"); + } std::ifstream file(config_file); if (!file.is_open()) { throw std::runtime_error("Can't open config file"); @@ -245,7 +248,7 @@ auto waybar::Client::setupConfig(const std::string &config_file) -> void { if (tmp_config_["include"].isArray()) { for (const auto &include : tmp_config_["include"]) { spdlog::info("Including resource file: {}", include.asString()); - setupConfig(getValidPath({include.asString()})); + setupConfig(getValidPath({include.asString()}), ++depth); } } mergeConfig(config_, tmp_config_); @@ -337,7 +340,7 @@ int waybar::Client::main(int argc, char *argv[]) { } wl_display = gdk_wayland_display_get_wl_display(gdk_display->gobj()); auto [config_file, css_file] = getConfigs(config, style); - setupConfig(config_file); + setupConfig(config_file, 0); setupCss(css_file); bindInterfaces(); gtk_app->hold(); From 982d571b2ea0577b70582e2830ab878eb8070ff3 Mon Sep 17 00:00:00 2001 From: Oskar Carl Date: Wed, 23 Jun 2021 23:08:47 +0200 Subject: [PATCH 214/303] Add include man section --- man/waybar.5.scd.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/waybar.5.scd.in b/man/waybar.5.scd.in index fe11c4a..6e6dd13 100644 --- a/man/waybar.5.scd.in +++ b/man/waybar.5.scd.in @@ -85,6 +85,10 @@ Also a minimal example configuration can be found on the at the bottom of this m Option to disable the use of gtk-layer-shell for popups. Only functional if compiled with gtk-layer-shell support. +*include* ++ + typeof: array ++ + Paths to additional configuration files. In case of duplicate options, the including file's value takes precedence. Make sure to avoid circular imports. + # MODULE FORMAT You can use PangoMarkupFormat (See https://developer.gnome.org/pango/stable/PangoMarkupFormat.html#PangoMarkupFormat). From 368e4813de5356332d1167e8200cb5633e772ed6 Mon Sep 17 00:00:00 2001 From: John Helmert III Date: Tue, 29 Jun 2021 21:29:12 -0500 Subject: [PATCH 215/303] libfmt >=8.0.0 compatibility --- include/util/format.hpp | 4 ++++ src/modules/clock.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/util/format.hpp b/include/util/format.hpp index 288d8f0..543a100 100644 --- a/include/util/format.hpp +++ b/include/util/format.hpp @@ -35,7 +35,11 @@ namespace fmt { // The rationale for ignoring it is that the only reason to specify // an alignment and a with is to get a fixed width bar, and ">" is // sufficient in this implementation. +#if FMT_VERSION < 80000 width = parse_nonnegative_int(it, end, ctx); +#else + width = detail::parse_nonnegative_int(it, end, -1); +#endif } return it; } diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 22bedc7..82c5701 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -196,6 +196,9 @@ template <> struct fmt::formatter : fmt::formatter { template auto format(const waybar_time& t, FormatContext& ctx) { +#if FMT_VERSION >= 80000 + auto& tm_format = specs; +#endif return format_to(ctx.out(), "{}", date::format(t.locale, fmt::to_string(tm_format), t.ztime)); } }; From d3c59c42ef9c3878e0086b0e95100a2f832aa088 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 30 Jun 2021 23:28:01 -0700 Subject: [PATCH 216/303] feat(ci): add GitHub CI jobs on Linux --- .github/workflows/linux.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..e550e20 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,25 @@ +name: linux + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + distro: + - alpine + - archlinux + - debian + - fedora + - opensuse + + runs-on: ubuntu-latest + container: + image: alexays/waybar:${{ matrix.distro }} + + steps: + - uses: actions/checkout@v2 + - name: configure + run: meson -Dman-pages=enabled build + - name: build + run: ninja -C build From 2a52efa99a7a9604f9d28b0c1bec8e74643c19cf Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 30 Jun 2021 23:50:37 -0700 Subject: [PATCH 217/303] chore: update fedora dockerfile --- Dockerfiles/fedora | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfiles/fedora b/Dockerfiles/fedora index d75083c..77c77cb 100644 --- a/Dockerfiles/fedora +++ b/Dockerfiles/fedora @@ -1,7 +1,12 @@ # vim: ft=Dockerfile -FROM fedora:32 +FROM fedora:latest -RUN dnf install sway meson git libinput-devel wayland-devel wayland-protocols-devel pugixml-devel egl-wayland-devel mesa-libEGL-devel mesa-libGLES-devel mesa-libgbm-devel libxkbcommon-devel libudev-devel pixman-devel gtkmm30-devel jsoncpp-devel scdoc -y && \ - dnf group install "C Development Tools and Libraries" -y && \ +RUN dnf install -y @c-development git-core meson scdoc 'pkgconfig(date)' \ + 'pkgconfig(dbusmenu-gtk3-0.4)' 'pkgconfig(fmt)' 'pkgconfig(gdk-pixbuf-2.0)' \ + 'pkgconfig(gio-unix-2.0)' 'pkgconfig(gtk-layer-shell-0)' 'pkgconfig(gtkmm-3.0)' \ + 'pkgconfig(jsoncpp)' 'pkgconfig(libinput)' 'pkgconfig(libmpdclient)' \ + 'pkgconfig(libnl-3.0)' 'pkgconfig(libnl-genl-3.0)' 'pkgconfig(libpulse)' \ + 'pkgconfig(libudev)' 'pkgconfig(pugixml)' 'pkgconfig(sigc++-2.0)' 'pkgconfig(spdlog)' \ + 'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' && \ dnf clean all -y From 5420a9104652ece306faefcfe41a6f2191f02295 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 1 Jul 2021 00:13:05 -0700 Subject: [PATCH 218/303] chore: update FreeBSD action to address ntp sync issue --- .github/workflows/freebsd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 7072c49..74422ee 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Test in FreeBSD VM - uses: vmactions/freebsd-vm@v0.0.9 # aka FreeBSD 12.2 + uses: vmactions/freebsd-vm@v0.1.3 # aka FreeBSD 12.2 with: usesh: true prepare: | From 8e1f85e1c30b7431097e7441cfb80db5fccc029b Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 3 Jul 2021 00:27:57 +0200 Subject: [PATCH 219/303] Update archlinux --- Dockerfiles/archlinux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/archlinux b/Dockerfiles/archlinux index 0b618ff..e5a53ef 100644 --- a/Dockerfiles/archlinux +++ b/Dockerfiles/archlinux @@ -1,6 +1,6 @@ # vim: ft=Dockerfile -FROM archlinux/base:latest +FROM archlinux:base-devel RUN pacman -Syu --noconfirm && \ pacman -S git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection --noconfirm From a8edc0886d6524e3df46e58f98bc86184fa05bb1 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 3 Jul 2021 00:28:43 +0200 Subject: [PATCH 220/303] Delete .travis.yml --- .travis.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index abc739c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: cpp - -services: - - docker - -git: - submodules: false - -env: - - distro: debian - - distro: archlinux - - distro: fedora - - distro: alpine - - distro: opensuse - -before_install: - - docker pull alexays/waybar:${distro} - - find . -type f \( -name '*.cpp' -o -name '*.h' \) -print0 | xargs -r0 clang-format -i - -script: - - echo FROM alexays/waybar:${distro} > Dockerfile - - echo ADD . /root >> Dockerfile - - docker build -t waybar . - - docker run waybar /bin/sh -c "cd /root && meson build -Dman-pages=enabled && ninja -C build" - -jobs: - include: - - os: freebsd - compiler: clang - env: - before_install: - - export CPPFLAGS+=-isystem/usr/local/include LDFLAGS+=-L/usr/local/lib # sndio - - sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf - - sudo pkg install -y gtk-layer-shell gtkmm30 jsoncpp libdbusmenu sndio - libfmt libmpdclient libudev-devd meson pulseaudio scdoc spdlog - script: - - meson build -Dman-pages=enabled - - ninja -C build From 569517c53164a8df6bfa2697bd4b7a97f44d0eb6 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 3 Jul 2021 00:55:59 +0200 Subject: [PATCH 221/303] chore: update freebsd-vm to 0.1.4 --- .github/workflows/freebsd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 74422ee..2fde610 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Test in FreeBSD VM - uses: vmactions/freebsd-vm@v0.1.3 # aka FreeBSD 12.2 + uses: vmactions/freebsd-vm@v0.1.4 # aka FreeBSD 12.2 with: usesh: true prepare: | From 78aaa5c1b448dc3d744cd6e8cc1a5ee466774107 Mon Sep 17 00:00:00 2001 From: tiosgz Date: Sat, 10 Jul 2021 20:22:37 +0000 Subject: [PATCH 222/303] Do not fail to parse a multi-bar config --- include/client.hpp | 1 + man/waybar.5.scd.in | 3 ++- src/client.cpp | 48 +++++++++++++++++++++++++++++++++++---------- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index a54bf4b..e7fa1db 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -39,6 +39,7 @@ class Client { void handleOutput(struct waybar_output &output); bool isValidOutput(const Json::Value &config, struct waybar_output &output); auto setupConfig(const std::string &config_file, int depth) -> void; + auto resolveConfigIncludes(Json::Value &config, int depth) -> void; auto mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void; auto setupCss(const std::string &css_file) -> void; struct waybar_output & getOutput(void *); diff --git a/man/waybar.5.scd.in b/man/waybar.5.scd.in index 6e6dd13..0168de3 100644 --- a/man/waybar.5.scd.in +++ b/man/waybar.5.scd.in @@ -86,8 +86,9 @@ Also a minimal example configuration can be found on the at the bottom of this m Only functional if compiled with gtk-layer-shell support. *include* ++ - typeof: array ++ + typeof: string|array ++ Paths to additional configuration files. In case of duplicate options, the including file's value takes precedence. Make sure to avoid circular imports. + For a multi-bar config, specify at least an empty object for each bar also in every file being included. # MODULE FORMAT diff --git a/src/client.cpp b/src/client.cpp index 07c0b23..ff6e7bf 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -245,22 +245,50 @@ auto waybar::Client::setupConfig(const std::string &config_file, int depth) -> v std::string str((std::istreambuf_iterator(file)), std::istreambuf_iterator()); util::JsonParser parser; Json::Value tmp_config_ = parser.parse(str); - if (tmp_config_["include"].isArray()) { - for (const auto &include : tmp_config_["include"]) { - spdlog::info("Including resource file: {}", include.asString()); - setupConfig(getValidPath({include.asString()}), ++depth); + if (tmp_config_.isArray()) { + for (auto &config_part : tmp_config_) { + resolveConfigIncludes(config_part, depth); } + } else { + resolveConfigIncludes(tmp_config_, depth); } mergeConfig(config_, tmp_config_); } -auto waybar::Client::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void { - for (const auto &key : b_config_.getMemberNames()) { - if (a_config_[key].type() == Json::objectValue && b_config_[key].type() == Json::objectValue) { - mergeConfig(a_config_[key], b_config_[key]); - } else { - a_config_[key] = b_config_[key]; +auto waybar::Client::resolveConfigIncludes(Json::Value &config, int depth) -> void { + Json::Value includes = config["include"]; + if (includes.isArray()) { + for (const auto &include : includes) { + spdlog::info("Including resource file: {}", include.asString()); + setupConfig(getValidPath({include.asString()}), ++depth); } + } else if (includes.isString()) { + spdlog::info("Including resource file: {}", includes.asString()); + setupConfig(getValidPath({includes.asString()}), ++depth); + } +} + +auto waybar::Client::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void { + if (!a_config_) { + // For the first config + a_config_ = b_config_; + } else if (a_config_.isObject() && b_config_.isObject()) { + for (const auto &key : b_config_.getMemberNames()) { + if (a_config_[key].isObject() && b_config_[key].isObject()) { + mergeConfig(a_config_[key], b_config_[key]); + } else { + a_config_[key] = b_config_[key]; + } + } + } else if (a_config_.isArray() && b_config_.isArray()) { + // This can happen only on the top-level array of a multi-bar config + for (Json::Value::ArrayIndex i = 0; i < b_config_.size(); i++) { + if (a_config_[i].isObject() && b_config_[i].isObject()) { + mergeConfig(a_config_[i], b_config_[i]); + } + } + } else { + spdlog::error("Cannot merge config, conflicting or invalid JSON types"); } } From 8310700bbb52af17477cedc61ea9f660c7965053 Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 13 Jul 2021 04:33:12 +0300 Subject: [PATCH 223/303] Improve sway/language --- include/modules/sway/ipc/ipc.hpp | 4 + include/modules/sway/language.hpp | 40 +++++++- include/util/string.hpp | 15 +++ man/waybar-sway-language.5.scd | 59 +++--------- meson.build | 4 +- src/modules/sway/language.cpp | 148 +++++++++++++++++++++++++----- 6 files changed, 197 insertions(+), 73 deletions(-) create mode 100644 include/util/string.hpp diff --git a/include/modules/sway/ipc/ipc.hpp b/include/modules/sway/ipc/ipc.hpp index 2c5a7a6..5f23d17 100644 --- a/include/modules/sway/ipc/ipc.hpp +++ b/include/modules/sway/ipc/ipc.hpp @@ -29,4 +29,8 @@ enum ipc_command_type { IPC_EVENT_BINDING = ((1 << 31) | 5), IPC_EVENT_SHUTDOWN = ((1 << 31) | 6), IPC_EVENT_TICK = ((1 << 31) | 7), + + // sway-specific event types + IPC_EVENT_BAR_STATE_UPDATE = ((1<<31) | 20), + IPC_EVENT_INPUT = ((1<<31) | 21), }; diff --git a/include/modules/sway/language.hpp b/include/modules/sway/language.hpp index 7cd6bf6..fb4438b 100644 --- a/include/modules/sway/language.hpp +++ b/include/modules/sway/language.hpp @@ -1,6 +1,11 @@ #pragma once #include +#include + +#include +#include + #include "ALabel.hpp" #include "bar.hpp" #include "client.hpp" @@ -16,13 +21,40 @@ class Language : public ALabel, public sigc::trackable { auto update() -> void; private: + struct Layout { + std::string full_name; + std::string short_name; + std::string variant; + }; + + class XKBContext { + public: + XKBContext(); + ~XKBContext(); + auto next_layout() -> Layout*; + private: + rxkb_context* context_ = nullptr; + rxkb_layout* xkb_layout_ = nullptr; + Layout* layout_ = nullptr; + }; + void onEvent(const struct Ipc::ipc_response&); void onCmd(const struct Ipc::ipc_response&); + + auto set_current_layout(std::string current_layout) -> void; + auto init_layouts_map(const std::vector& used_layouts) -> void; + + const static std::string XKB_LAYOUT_NAMES_KEY; + const static std::string XKB_ACTIVE_LAYOUT_NAME_KEY; - std::string lang_; - util::JsonParser parser_; - std::mutex mutex_; - Ipc ipc_; + Layout layout_; + std::map layouts_map_; + XKBContext xkb_context_; + bool is_variant_displayed; + + util::JsonParser parser_; + std::mutex mutex_; + Ipc ipc_; }; } // namespace waybar::modules::sway diff --git a/include/util/string.hpp b/include/util/string.hpp new file mode 100644 index 0000000..d644b4c --- /dev/null +++ b/include/util/string.hpp @@ -0,0 +1,15 @@ +#include + +const std::string WHITESPACE = " \n\r\t\f\v"; + +std::string ltrim(const std::string s) { + size_t begin = s.find_first_not_of(WHITESPACE); + return (begin == std::string::npos) ? "" : s.substr(begin); +} + +std::string rtrim(const std::string s) { + size_t end = s.find_last_not_of(WHITESPACE); + return (end == std::string::npos) ? "" : s.substr(0, end + 1); +} + +std::string trim(const std::string& s) { return rtrim(ltrim(s)); } diff --git a/man/waybar-sway-language.5.scd b/man/waybar-sway-language.5.scd index 769924f..f7f8830 100644 --- a/man/waybar-sway-language.5.scd +++ b/man/waybar-sway-language.5.scd @@ -15,63 +15,30 @@ Addressed by *sway/language* *format*: ++ typeof: string ++ default: {} ++ - The format, how information should be displayed. On {} data gets inserted. - -*rotate*: ++ - typeof: integer ++ - Positive value to rotate the text label. - -*max-length*: ++ - typeof: integer ++ - The maximum length in character the module should display. - -*min-length*: ++ - typeof: integer ++ - The minimum length in characters the module should take up. - -*align*: ++ - typeof: float ++ - The alignment of the text, where 0 is left-aligned and 1 is right-aligned. If the module is rotated, it will follow the flow of the text. - -*on-click*: ++ - typeof: string ++ - Command to execute when clicked on the module. - -*on-click-middle*: ++ - typeof: string ++ - Command to execute when middle-clicked on the module using mousewheel. - -*on-click-right*: ++ - typeof: string ++ - Command to execute when you right clicked on the module. - -*on-update*: ++ - typeof: string ++ - Command to execute when the module is updated. - -*on-scroll-up*: ++ - typeof: string ++ - Command to execute when scrolling up on the module. - -*on-scroll-down*: ++ - typeof: string ++ - Command to execute when scrolling down on the module. - -*smooth-scrolling-threshold*: ++ - typeof: double ++ - Threshold to be used when scrolling. + The format, how layout should be displayed. *tooltip*: ++ typeof: bool ++ default: true ++ Option to disable tooltip on hover. +# FORMAT REPLACEMENTS + +*{short}*: Short name of layout (e.g. "en"). Equals to {}. + +*{long}*: Long name of layout (e.g. "English (Dvorak)"). + +*{variant}*: Variant of layout (e.g. "Dvorak"). + # EXAMPLES ``` "sway/language": { "format": "{}", - "max-length": 50 +}, + +"sway/language": { + "format": "{short} {variant}", } ``` diff --git a/meson.build b/meson.build index e80448e..1bd1f02 100644 --- a/meson.build +++ b/meson.build @@ -95,6 +95,7 @@ libnlgen = dependency('libnl-genl-3.0', required: get_option('libnl')) libpulse = dependency('libpulse', required: get_option('pulseaudio')) libudev = dependency('libudev', required: get_option('libudev')) libmpdclient = dependency('libmpdclient', required: get_option('mpd')) +xkbregistry = dependency('xkbregistry') libsndio = compiler.find_library('sndio', required: get_option('sndio')) if libsndio.found() @@ -272,7 +273,8 @@ executable( libmpdclient, gtk_layer_shell, libsndio, - tz_dep + tz_dep, + xkbregistry ], include_directories: [include_directories('include')], install: true, diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index 4d27fb8..86a8e1e 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -1,10 +1,24 @@ #include "modules/sway/language.hpp" + +#include #include +#include + +#include +#include +#include + +#include "modules/sway/ipc/ipc.hpp" +#include "util/string.hpp" namespace waybar::modules::sway { +const std::string Language::XKB_LAYOUT_NAMES_KEY = "xkb_layout_names"; +const std::string Language::XKB_ACTIVE_LAYOUT_NAME_KEY = "xkb_active_layout_name"; + Language::Language(const std::string& id, const Json::Value& config) : ALabel(config, "language", id, "{}", 0, true) { + is_variant_displayed = format_.find("{variant}") != std::string::npos; ipc_.subscribe(R"(["input"])"); ipc_.signal_event.connect(sigc::mem_fun(*this, &Language::onEvent)); ipc_.signal_cmd.connect(sigc::mem_fun(*this, &Language::onCmd)); @@ -21,18 +35,31 @@ Language::Language(const std::string& id, const Json::Value& config) } void Language::onCmd(const struct Ipc::ipc_response& res) { + if (res.type != static_cast(IPC_GET_INPUTS)) { + return; + } + try { - auto payload = parser_.parse(res.payload); - //Display current layout of a device with a maximum count of layouts, expecting that all will be OK - Json::Value::ArrayIndex maxId = 0, max = 0; - for(Json::Value::ArrayIndex i = 0; i < payload.size(); i++) { - if(payload[i]["xkb_layout_names"].size() > max) { - max = payload[i]["xkb_layout_names"].size(); - maxId = i; + std::lock_guard lock(mutex_); + auto payload = parser_.parse(res.payload); + std::vector used_layouts; + // Display current layout of a device with a maximum count of layouts, expecting that all will + // be OK + Json::ArrayIndex max_id = 0, max = 0; + for (Json::ArrayIndex i = 0; i < payload.size(); i++) { + auto size = payload[i][XKB_LAYOUT_NAMES_KEY].size(); + if (size > max) { + max = size; + max_id = i; } } - auto layout_name = payload[maxId]["xkb_active_layout_name"].asString().substr(0,2); - lang_ = Glib::Markup::escape_text(layout_name); + + for (const auto& layout : payload[max_id][XKB_LAYOUT_NAMES_KEY]) { + used_layouts.push_back(layout.asString()); + } + + init_layouts_map(used_layouts); + set_current_layout(payload[max_id][XKB_ACTIVE_LAYOUT_NAME_KEY].asString()); dp.emit(); } catch (const std::exception& e) { spdlog::error("Language: {}", e.what()); @@ -40,14 +67,15 @@ void Language::onCmd(const struct Ipc::ipc_response& res) { } void Language::onEvent(const struct Ipc::ipc_response& res) { + if (res.type != static_cast(IPC_EVENT_INPUT)) { + return; + } + try { std::lock_guard lock(mutex_); - auto payload = parser_.parse(res.payload)["input"]; + auto payload = parser_.parse(res.payload)["input"]; if (payload["type"].asString() == "keyboard") { - auto layout_name = payload["xkb_active_layout_name"].asString().substr(0,2); - if (!layout_name.empty()) { - lang_ = Glib::Markup::escape_text(layout_name); - } + set_current_layout(payload[XKB_ACTIVE_LAYOUT_NAME_KEY].asString()); } dp.emit(); } catch (const std::exception& e) { @@ -56,17 +84,93 @@ void Language::onEvent(const struct Ipc::ipc_response& res) { } auto Language::update() -> void { - if (lang_.empty()) { - event_box_.hide(); - } else { - label_.set_markup(fmt::format(format_, lang_)); - if (tooltipEnabled()) { - label_.set_tooltip_text(lang_); - } - event_box_.show(); + auto display_layout = trim(fmt::format(format_, + fmt::arg("short", layout_.short_name), + fmt::arg("long", layout_.full_name), + fmt::arg("variant", layout_.variant))); + label_.set_markup(display_layout); + if (tooltipEnabled()) { + label_.set_tooltip_markup(display_layout); } + + event_box_.show(); + // Call parent update ALabel::update(); } +auto Language::set_current_layout(std::string current_layout) -> void { + layout_ = layouts_map_[current_layout]; +} + +auto Language::init_layouts_map(const std::vector& used_layouts) -> void { + std::map> found_by_short_names; + auto layout = xkb_context_.next_layout(); + for (; layout != nullptr; layout = xkb_context_.next_layout()) { + if (std::find(used_layouts.begin(), used_layouts.end(), layout->full_name) == + used_layouts.end()) { + continue; + } + + if (!is_variant_displayed) { + auto short_name = layout->short_name; + if (found_by_short_names.count(short_name) > 0) { + found_by_short_names[short_name].push_back(layout); + } else { + found_by_short_names[short_name] = {layout}; + } + } + + layouts_map_.emplace(layout->full_name, *layout); + } + + if (is_variant_displayed || found_by_short_names.size() == 0) { + return; + } + + std::map short_name_to_number_map; + for (const auto& used_layout_name : used_layouts) { + auto used_layout = &layouts_map_.find(used_layout_name)->second; + auto layouts_with_same_name_list = found_by_short_names[used_layout->short_name]; + spdlog::info("SIZE: " + std::to_string(layouts_with_same_name_list.size())); + if (layouts_with_same_name_list.size() < 2) { + continue; + } + + if (short_name_to_number_map.count(used_layout->short_name) == 0) { + short_name_to_number_map[used_layout->short_name] = 1; + } + + used_layout->short_name = + used_layout->short_name + std::to_string(short_name_to_number_map[used_layout->short_name]++); + } +} + +Language::XKBContext::XKBContext() { + context_ = rxkb_context_new(RXKB_CONTEXT_NO_DEFAULT_INCLUDES); + rxkb_context_include_path_append_default(context_); + rxkb_context_parse_default_ruleset(context_); +} + +auto Language::XKBContext::next_layout() -> Layout* { + if (xkb_layout_ == nullptr) { + xkb_layout_ = rxkb_layout_first(context_); + } else { + xkb_layout_ = rxkb_layout_next(xkb_layout_); + } + + if (xkb_layout_ == nullptr) { + return nullptr; + } + + auto description = std::string(rxkb_layout_get_description(xkb_layout_)); + auto name = std::string(rxkb_layout_get_name(xkb_layout_)); + auto variant_ = rxkb_layout_get_variant(xkb_layout_); + std::string variant = variant_ == nullptr ? "" : std::string(variant_); + + layout_ = new Layout{description, name, variant}; + return layout_; +} + +Language::XKBContext::~XKBContext() { rxkb_context_unref(context_); } } // namespace waybar::modules::sway From 9cce5ea6b536a0dace941fd233a0c54c3462b9d8 Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 13 Jul 2021 04:49:19 +0300 Subject: [PATCH 224/303] Update dockerfiles --- Dockerfiles/alpine | 2 +- Dockerfiles/archlinux | 2 +- Dockerfiles/debian | 2 +- Dockerfiles/fedora | 2 +- Dockerfiles/opensuse | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfiles/alpine b/Dockerfiles/alpine index 21d1cbb..c0e032f 100644 --- a/Dockerfiles/alpine +++ b/Dockerfiles/alpine @@ -2,4 +2,4 @@ FROM alpine:latest -RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev sndio-dev scdoc +RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev sndio-dev scdoc libxkbcommon diff --git a/Dockerfiles/archlinux b/Dockerfiles/archlinux index e5a53ef..40a1b2e 100644 --- a/Dockerfiles/archlinux +++ b/Dockerfiles/archlinux @@ -3,4 +3,4 @@ FROM archlinux:base-devel RUN pacman -Syu --noconfirm && \ - pacman -S git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection --noconfirm + pacman -S git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection --noconfirm libxkbcommon diff --git a/Dockerfiles/debian b/Dockerfiles/debian index cee1744..f7f6e63 100644 --- a/Dockerfiles/debian +++ b/Dockerfiles/debian @@ -3,5 +3,5 @@ FROM debian:sid RUN apt-get update && \ - apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev && \ + apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon && \ apt-get clean diff --git a/Dockerfiles/fedora b/Dockerfiles/fedora index 77c77cb..470ceb7 100644 --- a/Dockerfiles/fedora +++ b/Dockerfiles/fedora @@ -8,5 +8,5 @@ RUN dnf install -y @c-development git-core meson scdoc 'pkgconfig(date)' \ 'pkgconfig(jsoncpp)' 'pkgconfig(libinput)' 'pkgconfig(libmpdclient)' \ 'pkgconfig(libnl-3.0)' 'pkgconfig(libnl-genl-3.0)' 'pkgconfig(libpulse)' \ 'pkgconfig(libudev)' 'pkgconfig(pugixml)' 'pkgconfig(sigc++-2.0)' 'pkgconfig(spdlog)' \ - 'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' && \ + 'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' 'pkgconfig(xkbcommon)' && \ dnf clean all -y diff --git a/Dockerfiles/opensuse b/Dockerfiles/opensuse index 5b664fb..eb231fd 100644 --- a/Dockerfiles/opensuse +++ b/Dockerfiles/opensuse @@ -4,4 +4,4 @@ FROM opensuse/tumbleweed:latest RUN zypper -n up && \ zypper -n install -t pattern devel_C_C++ && \ - zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc + zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc libxkbcommon From 9c2b5efe7b5f9acd934595fcd8f27d2404ea0668 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 15 Jul 2021 08:52:02 +0200 Subject: [PATCH 225/303] Support per-device icon in pulseaudio --- include/ALabel.hpp | 2 +- include/modules/pulseaudio.hpp | 2 +- man/waybar-pulseaudio.5.scd | 4 ++++ src/ALabel.cpp | 2 +- src/modules/pulseaudio.cpp | 12 +++++++----- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/ALabel.hpp b/include/ALabel.hpp index 5b9ac54..d8a5b50 100644 --- a/include/ALabel.hpp +++ b/include/ALabel.hpp @@ -14,7 +14,7 @@ class ALabel : public AModule { virtual ~ALabel() = default; virtual auto update() -> void; virtual std::string getIcon(uint16_t, const std::string &alt = "", uint16_t max = 0); - virtual std::string getIcon(uint16_t, std::vector &alts, uint16_t max = 0); + virtual std::string getIcon(uint16_t, const std::vector &alts, uint16_t max = 0); protected: Gtk::Label label_; diff --git a/include/modules/pulseaudio.hpp b/include/modules/pulseaudio.hpp index 5f17620..9b36dfe 100644 --- a/include/modules/pulseaudio.hpp +++ b/include/modules/pulseaudio.hpp @@ -24,7 +24,7 @@ class Pulseaudio : public ALabel { static void volumeModifyCb(pa_context*, int, void*); bool handleScroll(GdkEventScroll* e); - const std::string getPortIcon() const; + const std::vector getPulseIcon() const; pa_threaded_mainloop* mainloop_; pa_mainloop_api* mainloop_api_; diff --git a/man/waybar-pulseaudio.5.scd b/man/waybar-pulseaudio.5.scd index d894290..7de1028 100644 --- a/man/waybar-pulseaudio.5.scd +++ b/man/waybar-pulseaudio.5.scd @@ -109,6 +109,9 @@ Additionally you can control the volume by scrolling *up* or *down* while the cu # ICONS: The following strings for *format-icons* are supported. + +- the device name + If they are found in the current PulseAudio port name, the corresponding icons will be selected. - *default* (Shown, when no other port is found) @@ -131,6 +134,7 @@ If they are found in the current PulseAudio port name, the corresponding icons w "format-bluetooth": "{volume}% {icon}", "format-muted": "", "format-icons": { + "alsa_output.pci-0000_00_1f.3.analog-stereo": "", "headphones": "", "handsfree": "", "headset": "", diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 8d9c9b4..dd41a32 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -76,7 +76,7 @@ std::string ALabel::getIcon(uint16_t percentage, const std::string& alt, uint16_ return ""; } -std::string ALabel::getIcon(uint16_t percentage, std::vector& alts, uint16_t max) { +std::string ALabel::getIcon(uint16_t percentage, const std::vector& alts, uint16_t max) { auto format_icons = config_["format-icons"]; if (format_icons.isObject()) { std::string _alt = "default"; diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 3fbe956..a7cdcec 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -194,15 +194,17 @@ static const std::array ports = { "phone", }; -const std::string waybar::modules::Pulseaudio::getPortIcon() const { +const std::vector waybar::modules::Pulseaudio::getPulseIcon() const { + std::vector res = {default_sink_name_}; std::string nameLC = port_name_ + form_factor_; std::transform(nameLC.begin(), nameLC.end(), nameLC.begin(), ::tolower); for (auto const &port : ports) { if (nameLC.find(port) != std::string::npos) { - return port; + res.push_back(port); + return res; } } - return port_name_; + return res; } auto waybar::modules::Pulseaudio::update() -> void { @@ -252,7 +254,7 @@ auto waybar::modules::Pulseaudio::update() -> void { fmt::arg("format_source", format_source), fmt::arg("source_volume", source_volume_), fmt::arg("source_desc", source_desc_), - fmt::arg("icon", getIcon(volume_, getPortIcon())))); + fmt::arg("icon", getIcon(volume_, getPulseIcon())))); getState(volume_); if (tooltipEnabled()) { @@ -267,7 +269,7 @@ auto waybar::modules::Pulseaudio::update() -> void { fmt::arg("format_source", format_source), fmt::arg("source_volume", source_volume_), fmt::arg("source_desc", source_desc_), - fmt::arg("icon", getIcon(volume_, getPortIcon())))); + fmt::arg("icon", getIcon(volume_, getPulseIcon())))); } else { label_.set_tooltip_text(desc_); } From 948eba92a540b52443b1e0b0a414b7ec6de83cab Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 13 Jul 2021 04:49:19 +0300 Subject: [PATCH 226/303] Update dockerfiles --- Dockerfiles/alpine | 2 +- Dockerfiles/archlinux | 2 +- Dockerfiles/debian | 2 +- Dockerfiles/fedora | 2 +- Dockerfiles/opensuse | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfiles/alpine b/Dockerfiles/alpine index 21d1cbb..c0e032f 100644 --- a/Dockerfiles/alpine +++ b/Dockerfiles/alpine @@ -2,4 +2,4 @@ FROM alpine:latest -RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev sndio-dev scdoc +RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev sndio-dev scdoc libxkbcommon diff --git a/Dockerfiles/archlinux b/Dockerfiles/archlinux index e5a53ef..40a1b2e 100644 --- a/Dockerfiles/archlinux +++ b/Dockerfiles/archlinux @@ -3,4 +3,4 @@ FROM archlinux:base-devel RUN pacman -Syu --noconfirm && \ - pacman -S git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection --noconfirm + pacman -S git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection --noconfirm libxkbcommon diff --git a/Dockerfiles/debian b/Dockerfiles/debian index cee1744..f7f6e63 100644 --- a/Dockerfiles/debian +++ b/Dockerfiles/debian @@ -3,5 +3,5 @@ FROM debian:sid RUN apt-get update && \ - apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev && \ + apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon && \ apt-get clean diff --git a/Dockerfiles/fedora b/Dockerfiles/fedora index 77c77cb..470ceb7 100644 --- a/Dockerfiles/fedora +++ b/Dockerfiles/fedora @@ -8,5 +8,5 @@ RUN dnf install -y @c-development git-core meson scdoc 'pkgconfig(date)' \ 'pkgconfig(jsoncpp)' 'pkgconfig(libinput)' 'pkgconfig(libmpdclient)' \ 'pkgconfig(libnl-3.0)' 'pkgconfig(libnl-genl-3.0)' 'pkgconfig(libpulse)' \ 'pkgconfig(libudev)' 'pkgconfig(pugixml)' 'pkgconfig(sigc++-2.0)' 'pkgconfig(spdlog)' \ - 'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' && \ + 'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' 'pkgconfig(xkbcommon)' && \ dnf clean all -y diff --git a/Dockerfiles/opensuse b/Dockerfiles/opensuse index 5b664fb..eb231fd 100644 --- a/Dockerfiles/opensuse +++ b/Dockerfiles/opensuse @@ -4,4 +4,4 @@ FROM opensuse/tumbleweed:latest RUN zypper -n up && \ zypper -n install -t pattern devel_C_C++ && \ - zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc + zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc libxkbcommon From 2506c0104a12e017721849ff9b5541b5675e4c7a Mon Sep 17 00:00:00 2001 From: Anakael Date: Fri, 16 Jul 2021 11:37:58 +0300 Subject: [PATCH 227/303] Update Dockerfiles/fedora Co-authored-by: Aleksei Bavshin --- Dockerfiles/fedora | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/fedora b/Dockerfiles/fedora index 470ceb7..a61dcd3 100644 --- a/Dockerfiles/fedora +++ b/Dockerfiles/fedora @@ -8,5 +8,5 @@ RUN dnf install -y @c-development git-core meson scdoc 'pkgconfig(date)' \ 'pkgconfig(jsoncpp)' 'pkgconfig(libinput)' 'pkgconfig(libmpdclient)' \ 'pkgconfig(libnl-3.0)' 'pkgconfig(libnl-genl-3.0)' 'pkgconfig(libpulse)' \ 'pkgconfig(libudev)' 'pkgconfig(pugixml)' 'pkgconfig(sigc++-2.0)' 'pkgconfig(spdlog)' \ - 'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' 'pkgconfig(xkbcommon)' && \ + 'pkgconfig(wayland-client)' 'pkgconfig(wayland-cursor)' 'pkgconfig(wayland-protocols)' 'pkgconfig(xkbregistry)' && \ dnf clean all -y From 86a43b904214613b2470db65746367b7721bd929 Mon Sep 17 00:00:00 2001 From: Roosembert Palacios Date: Tue, 20 Jul 2021 10:11:55 +0200 Subject: [PATCH 228/303] pulseaudio: Control currently running sink In a system with multiple sinks, the default sink may not always be the once currently being used. It is more useful to control the currently active sink rather than an unused one. This patch does not make any difference if the system only uses the default sink. Signed-off-by: Roosembert Palacios --- include/modules/pulseaudio.hpp | 3 ++- src/modules/pulseaudio.cpp | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/include/modules/pulseaudio.hpp b/include/modules/pulseaudio.hpp index 5f17620..f636c00 100644 --- a/include/modules/pulseaudio.hpp +++ b/include/modules/pulseaudio.hpp @@ -38,7 +38,8 @@ class Pulseaudio : public ALabel { std::string form_factor_; std::string desc_; std::string monitor_; - std::string default_sink_name_; + std::string current_sink_name_; + bool current_sink_running_; // SOURCE uint32_t source_idx_{0}; uint16_t source_volume_; diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 3fbe956..c0299fc 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -151,8 +151,24 @@ void waybar::modules::Pulseaudio::sourceInfoCb(pa_context * /*context*/, const p */ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context * /*context*/, const pa_sink_info *i, int /*eol*/, void *data) { + if (i == nullptr) + return; + auto pa = static_cast(data); - if (i != nullptr && pa->default_sink_name_ == i->name) { + if (pa->current_sink_name_ == i->name) { + if (i->state != PA_SINK_RUNNING) { + pa->current_sink_running_ = false; + } else { + pa->current_sink_running_ = true; + } + } + + if (!pa->current_sink_running_ && i->state == PA_SINK_RUNNING) { + pa->current_sink_name_ = i->name; + pa->current_sink_running_ = true; + } + + if (pa->current_sink_name_ == i->name) { pa->pa_volume_ = i->volume; float volume = static_cast(pa_cvolume_avg(&(pa->pa_volume_))) / float{PA_VOLUME_NORM}; pa->sink_idx_ = i->index; @@ -175,11 +191,11 @@ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context * /*context*/, const pa_ void waybar::modules::Pulseaudio::serverInfoCb(pa_context *context, const pa_server_info *i, void *data) { auto pa = static_cast(data); - pa->default_sink_name_ = i->default_sink_name; + pa->current_sink_name_ = i->default_sink_name; pa->default_source_name_ = i->default_source_name; - pa_context_get_sink_info_by_name(context, i->default_sink_name, sinkInfoCb, data); - pa_context_get_source_info_by_name(context, i->default_source_name, sourceInfoCb, data); + pa_context_get_sink_info_list(context, sinkInfoCb, data); + pa_context_get_source_info_list(context, sourceInfoCb, data); } static const std::array ports = { From 6f2bfd43bf2a92ffefd880c6923af757b6565665 Mon Sep 17 00:00:00 2001 From: Lars Christensen Date: Tue, 20 Jul 2021 15:25:05 +0200 Subject: [PATCH 229/303] Fix pulseaudio icon name compilation error --- src/modules/pulseaudio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index bd90375..cf42780 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -211,7 +211,7 @@ static const std::array ports = { }; const std::vector waybar::modules::Pulseaudio::getPulseIcon() const { - std::vector res = {default_sink_name_}; + std::vector res = {default_source_name_}; std::string nameLC = port_name_ + form_factor_; std::transform(nameLC.begin(), nameLC.end(), nameLC.begin(), ::tolower); for (auto const &port : ports) { From 6dfa31fb1778da2989a28179304f9e1ccf1e3e4e Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Sun, 7 Feb 2021 15:05:11 -0500 Subject: [PATCH 230/303] Basic keyboard state module --- README.md | 2 + include/factory.hpp | 3 ++ include/modules/keyboard_state.hpp | 31 +++++++++++++ meson.build | 7 +++ meson_options.txt | 1 + src/factory.cpp | 5 ++ src/modules/keyboard_state.cpp | 73 ++++++++++++++++++++++++++++++ 7 files changed, 122 insertions(+) create mode 100644 include/modules/keyboard_state.hpp create mode 100644 src/modules/keyboard_state.cpp diff --git a/README.md b/README.md index b104ade..37c0cfc 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ libappindicator-gtk3 [Tray module] libdbusmenu-gtk3 [Tray module] libmpdclient [MPD module] libsndio [sndio module] +libevdev [KeyboardState module] ``` **Build dependencies** @@ -86,6 +87,7 @@ sudo apt install \ clang-tidy \ gobject-introspection \ libdbusmenu-gtk3-dev \ + libevdev-dev \ libfmt-dev \ libgirepository1.0-dev \ libgtk-3-dev \ diff --git a/include/factory.hpp b/include/factory.hpp index 1cae68c..4b9f32a 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -38,6 +38,9 @@ #ifdef HAVE_LIBUDEV #include "modules/backlight.hpp" #endif +#ifdef HAVE_LIBEVDEV +#include "modules/keyboard_state.hpp" +#endif #ifdef HAVE_LIBPULSE #include "modules/pulseaudio.hpp" #endif diff --git a/include/modules/keyboard_state.hpp b/include/modules/keyboard_state.hpp new file mode 100644 index 0000000..99ed602 --- /dev/null +++ b/include/modules/keyboard_state.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include +#if FMT_VERSION < 60000 +#include +#else +#include +#endif +#include "ALabel.hpp" +#include "util/sleeper_thread.hpp" + +extern "C" { +#include +} + +namespace waybar::modules { + +class KeyboardState : public ALabel { + public: + KeyboardState(const std::string&, const Json::Value&); + ~KeyboardState(); + auto update() -> void; + + private: + std::string dev_path_; + int fd_; + libevdev* dev_; + util::SleeperThread thread_; +}; + +} // namespace waybar::modules diff --git a/meson.build b/meson.build index e80448e..7ac6fd6 100644 --- a/meson.build +++ b/meson.build @@ -94,6 +94,7 @@ libnl = dependency('libnl-3.0', required: get_option('libnl')) libnlgen = dependency('libnl-genl-3.0', required: get_option('libnl')) libpulse = dependency('libpulse', required: get_option('pulseaudio')) libudev = dependency('libudev', required: get_option('libudev')) +libevdev = dependency('libevdev', required: get_option('libevdev')) libmpdclient = dependency('libmpdclient', required: get_option('mpd')) libsndio = compiler.find_library('sndio', required: get_option('sndio')) @@ -215,6 +216,11 @@ if libudev.found() and (is_linux or libepoll.found()) src_files += 'src/modules/backlight.cpp' endif +if libevdev.found() and (is_linux or libepoll.found()) + add_project_arguments('-DHAVE_LIBEVDEV', language: 'cpp') + src_files += 'src/modules/keyboard_state.cpp' +endif + if libmpdclient.found() add_project_arguments('-DHAVE_LIBMPDCLIENT', language: 'cpp') src_files += 'src/modules/mpd/mpd.cpp' @@ -270,6 +276,7 @@ executable( libudev, libepoll, libmpdclient, + libevdev, gtk_layer_shell, libsndio, tz_dep diff --git a/meson_options.txt b/meson_options.txt index cb5581b..fefb3dc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,7 @@ option('libcxx', type : 'boolean', value : false, description : 'Build with Clang\'s libc++ instead of libstdc++ on Linux.') option('libnl', type: 'feature', value: 'auto', description: 'Enable libnl support for network related features') option('libudev', type: 'feature', value: 'auto', description: 'Enable libudev support for udev related features') +option('libevdev', type: 'feature', value: 'auto', description: 'Enable libevdev support for evdev related features') option('pulseaudio', type: 'feature', value: 'auto', description: 'Enable support for pulseaudio') option('systemd', type: 'feature', value: 'auto', description: 'Install systemd user service unit') option('dbusmenu-gtk', type: 'feature', value: 'auto', description: 'Enable support for tray') diff --git a/src/factory.cpp b/src/factory.cpp index 1f90789..cab2307 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -70,6 +70,11 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { return new waybar::modules::Backlight(id, config_[name]); } #endif +#ifdef HAVE_LIBEVDEV + if (ref == "keyboard_state") { + return new waybar::modules::KeyboardState(id, config_[name]); + } +#endif #ifdef HAVE_LIBPULSE if (ref == "pulseaudio") { return new waybar::modules::Pulseaudio(id, config_[name]); diff --git a/src/modules/keyboard_state.cpp b/src/modules/keyboard_state.cpp new file mode 100644 index 0000000..ea9ae57 --- /dev/null +++ b/src/modules/keyboard_state.cpp @@ -0,0 +1,73 @@ +#include "modules/keyboard_state.hpp" +#include + +extern "C" { +#include +#include +#include +} + +waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Json::Value& config) + : ALabel(config, "keyboard_state", id, "{temperatureC}", 1) { + if (config_["device-path"].isString()) { + dev_path_ = config_["device-path"].asString(); + } else { + dev_path_ = ""; + } + + fd_ = open(dev_path_.c_str(), O_NONBLOCK | O_CLOEXEC | O_RDONLY); + if (fd_ < 0) { + throw std::runtime_error("Can't open " + dev_path_); + } + int err = libevdev_new_from_fd(fd_, &dev_); + if (err < 0) { + throw std::runtime_error("Can't create libevdev device"); + } + if (!libevdev_has_event_type(dev_, EV_LED)) { + throw std::runtime_error("Device doesn't support LED events"); + } + if (!libevdev_has_event_code(dev_, EV_LED, LED_NUML) || !libevdev_has_event_code(dev_, EV_LED, LED_CAPSL)) { + throw std::runtime_error("Device doesn't support num lock or caps lock events"); + } + + thread_ = [this] { + dp.emit(); + thread_.sleep_for(interval_); + }; +} + +waybar::modules::KeyboardState::~KeyboardState() { + libevdev_free(dev_); + int err = close(fd_); + if (err < 0) { + // Not much we can do, so ignore it. + } +} + +auto waybar::modules::KeyboardState::update() -> void { + int err = LIBEVDEV_READ_STATUS_SUCCESS; + while (err == LIBEVDEV_READ_STATUS_SUCCESS) { + input_event ev; + err = libevdev_next_event(dev_, LIBEVDEV_READ_FLAG_NORMAL, &ev); + while (err == LIBEVDEV_READ_STATUS_SYNC) { + err = libevdev_next_event(dev_, LIBEVDEV_READ_FLAG_SYNC, &ev); + } + } + if (err != -EAGAIN) { + throw std::runtime_error("Failed to sync evdev device"); + } + + int numl = libevdev_get_event_value(dev_, EV_LED, LED_NUML); + //int capsl = libevdev_get_event_value(dev_, EV_LED, LED_CAPSL); + + std::string text; + if (numl) { + text = fmt::format(format_, "num lock enabled"); + label_.set_markup(text); + } else { + text = fmt::format(format_, "num lock disabled"); + label_.set_markup(text); + } + + ALabel::update(); +} From 642e28166b784244fda45cc90832b75951969372 Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Sun, 7 Feb 2021 18:46:39 -0500 Subject: [PATCH 231/303] Add more configuaration --- include/modules/keyboard_state.hpp | 22 ++++++++-- resources/config | 13 +++++- src/factory.cpp | 2 +- src/modules/keyboard_state.cpp | 70 ++++++++++++++++++++++++------ 4 files changed, 89 insertions(+), 18 deletions(-) diff --git a/include/modules/keyboard_state.hpp b/include/modules/keyboard_state.hpp index 99ed602..0873ad5 100644 --- a/include/modules/keyboard_state.hpp +++ b/include/modules/keyboard_state.hpp @@ -6,8 +6,10 @@ #else #include #endif -#include "ALabel.hpp" +#include "AModule.hpp" +#include "bar.hpp" #include "util/sleeper_thread.hpp" +#include extern "C" { #include @@ -15,16 +17,30 @@ extern "C" { namespace waybar::modules { -class KeyboardState : public ALabel { +class KeyboardState : public AModule { public: - KeyboardState(const std::string&, const Json::Value&); + KeyboardState(const std::string&, const waybar::Bar&, const Json::Value&); ~KeyboardState(); auto update() -> void; private: + const Bar& bar_; + Gtk::Box box_; + Gtk::Label numlock_label_; + Gtk::Label capslock_label_; + Gtk::Label scrolllock_label_; + + std::string numlock_format_; + std::string capslock_format_; + std::string scrolllock_format_; + const std::chrono::seconds interval_; + std::string icon_locked_; + std::string icon_unlocked_; + std::string dev_path_; int fd_; libevdev* dev_; + util::SleeperThread thread_; }; diff --git a/resources/config b/resources/config index 13dc94c..e7c91c0 100644 --- a/resources/config +++ b/resources/config @@ -6,7 +6,7 @@ // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-center": ["sway/window"], - "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "sway/language", "battery", "battery#bat2", "clock", "tray"], + "modules-right": ["keyboard_state", "mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "sway/language", "battery", "battery#bat2", "clock", "tray"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, @@ -23,6 +23,16 @@ // "default": "" // } // }, + "keyboard_state": { + "numlock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + }, + "capslock": true, + "device-path": "/dev/input/by-path/platform-i8042-serio-0-event-kbd" + }, "sway/mode": { "format": "{}" }, @@ -145,3 +155,4 @@ // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name } } + diff --git a/src/factory.cpp b/src/factory.cpp index cab2307..6a0147d 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -72,7 +72,7 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { #endif #ifdef HAVE_LIBEVDEV if (ref == "keyboard_state") { - return new waybar::modules::KeyboardState(id, config_[name]); + return new waybar::modules::KeyboardState(id, bar_, config_[name]); } #endif #ifdef HAVE_LIBPULSE diff --git a/src/modules/keyboard_state.cpp b/src/modules/keyboard_state.cpp index ea9ae57..b51617f 100644 --- a/src/modules/keyboard_state.cpp +++ b/src/modules/keyboard_state.cpp @@ -7,8 +7,44 @@ extern "C" { #include } -waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Json::Value& config) - : ALabel(config, "keyboard_state", id, "{temperatureC}", 1) { +waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar& bar, const Json::Value& config) + : AModule(config, "keyboard_state", id, false, !config["disable-scroll"].asBool()), + bar_(bar), + box_(bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0), + numlock_label_(""), + capslock_label_(""), + numlock_format_(config_["format"].isString() ? config_["format"].asString() + : config_["format"]["numlock"].isString() ? config_["format"]["numlock"].asString() + : "{name} {icon}"), + capslock_format_(config_["format"].isString() ? config_["format"].asString() + : config_["format"]["capslock"].isString() ? config_["format"]["capslock"].asString() + : "{name} {icon}"), + scrolllock_format_(config_["format"].isString() ? config_["format"].asString() + : config_["format"]["scrolllock"].isString() ? config_["format"]["scrolllock"].asString() + : "{name} {icon}"), + interval_(std::chrono::seconds(config_["interval"].isUInt() ? config_["interval"].asUInt() : 1)), + icon_locked_(config_["format-icons"]["locked"].isString() + ? config_["format-icons"]["locked"].asString() + : "locked"), + icon_unlocked_(config_["format-icons"]["unlocked"].isString() + ? config_["format-icons"]["unlocked"].asString() + : "unlocked") + { + box_.set_name("keyboard_state"); + if (config_["numlock"].asBool()) { + box_.pack_end(numlock_label_, false, false, 0); + } + if (config_["capslock"].asBool()) { + box_.pack_end(capslock_label_, false, false, 0); + } + if (config_["scrolllock"].asBool()) { + box_.pack_end(scrolllock_label_, false, false, 0); + } + if (!id.empty()) { + box_.get_style_context()->add_class(id); + } + event_box_.add(box_); + if (config_["device-path"].isString()) { dev_path_ = config_["device-path"].asString(); } else { @@ -26,8 +62,10 @@ waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Json: if (!libevdev_has_event_type(dev_, EV_LED)) { throw std::runtime_error("Device doesn't support LED events"); } - if (!libevdev_has_event_code(dev_, EV_LED, LED_NUML) || !libevdev_has_event_code(dev_, EV_LED, LED_CAPSL)) { - throw std::runtime_error("Device doesn't support num lock or caps lock events"); + if (!libevdev_has_event_code(dev_, EV_LED, LED_NUML) + || !libevdev_has_event_code(dev_, EV_LED, LED_CAPSL) + || !libevdev_has_event_code(dev_, EV_LED, LED_SCROLLL)) { + throw std::runtime_error("Device doesn't support num lock, caps lock, or scroll lock events"); } thread_ = [this] { @@ -58,16 +96,22 @@ auto waybar::modules::KeyboardState::update() -> void { } int numl = libevdev_get_event_value(dev_, EV_LED, LED_NUML); - //int capsl = libevdev_get_event_value(dev_, EV_LED, LED_CAPSL); + int capsl = libevdev_get_event_value(dev_, EV_LED, LED_CAPSL); + int scrolll = libevdev_get_event_value(dev_, EV_LED, LED_SCROLLL); std::string text; - if (numl) { - text = fmt::format(format_, "num lock enabled"); - label_.set_markup(text); - } else { - text = fmt::format(format_, "num lock disabled"); - label_.set_markup(text); - } + text = fmt::format(numlock_format_, + fmt::arg("icon", numl ? icon_locked_ : icon_unlocked_), + fmt::arg("name", "Num")); + numlock_label_.set_markup(text); + text = fmt::format(capslock_format_, + fmt::arg("icon", capsl ? icon_locked_ : icon_unlocked_), + fmt::arg("name", "Caps")); + capslock_label_.set_markup(text); + text = fmt::format(scrolllock_format_, + fmt::arg("icon", scrolll ? icon_locked_ : icon_unlocked_), + fmt::arg("name", "Scroll")); + scrolllock_label_.set_markup(text); - ALabel::update(); + AModule::update(); } From 40e6360722acc32ea1b266f361666a4cc64d9608 Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Sun, 7 Feb 2021 18:57:12 -0500 Subject: [PATCH 232/303] Update css class when locked/unlocked --- src/modules/keyboard_state.cpp | 35 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/modules/keyboard_state.cpp b/src/modules/keyboard_state.cpp index b51617f..516502f 100644 --- a/src/modules/keyboard_state.cpp +++ b/src/modules/keyboard_state.cpp @@ -99,19 +99,28 @@ auto waybar::modules::KeyboardState::update() -> void { int capsl = libevdev_get_event_value(dev_, EV_LED, LED_CAPSL); int scrolll = libevdev_get_event_value(dev_, EV_LED, LED_SCROLLL); - std::string text; - text = fmt::format(numlock_format_, - fmt::arg("icon", numl ? icon_locked_ : icon_unlocked_), - fmt::arg("name", "Num")); - numlock_label_.set_markup(text); - text = fmt::format(capslock_format_, - fmt::arg("icon", capsl ? icon_locked_ : icon_unlocked_), - fmt::arg("name", "Caps")); - capslock_label_.set_markup(text); - text = fmt::format(scrolllock_format_, - fmt::arg("icon", scrolll ? icon_locked_ : icon_unlocked_), - fmt::arg("name", "Scroll")); - scrolllock_label_.set_markup(text); + struct { + bool state; + Gtk::Label& label; + const std::string& format; + const char* name; + } label_states[] = { + {(bool) numl, numlock_label_, numlock_format_, "Num"}, + {(bool) capsl, capslock_label_, capslock_format_, "Caps"}, + {(bool) scrolll, scrolllock_label_, scrolllock_format_, "Scroll"}, + }; + for (auto& label_state : label_states) { + std::string text; + text = fmt::format(label_state.format, + fmt::arg("icon", label_state.state ? icon_locked_ : icon_unlocked_), + fmt::arg("name", label_state.name)); + label_state.label.set_markup(text); + if (label_state.state) { + label_state.label.get_style_context()->add_class("locked"); + } else { + label_state.label.get_style_context()->remove_class("locked"); + } + } AModule::update(); } From 6fdbc27998e16daafa637427c6ecddc53abc31ce Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Sun, 7 Feb 2021 19:06:55 -0500 Subject: [PATCH 233/303] Add default style --- resources/config | 2 +- resources/style.css | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/resources/config b/resources/config index e7c91c0..a83edf1 100644 --- a/resources/config +++ b/resources/config @@ -6,7 +6,7 @@ // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-center": ["sway/window"], - "modules-right": ["keyboard_state", "mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "sway/language", "battery", "battery#bat2", "clock", "tray"], + "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard_state", "sway/language", "battery", "battery#bat2", "clock", "tray"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, diff --git a/resources/style.css b/resources/style.css index 63ea871..c1ac5ad 100644 --- a/resources/style.css +++ b/resources/style.css @@ -228,3 +228,19 @@ label:focus { margin: 0 5px; min-width: 16px; } + +#keyboard_state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard_state > label { + padding: 0 5px; +} + +#keyboard_state > label.locked { + background: rgba(0, 0, 0, 0.2); +} From 08e886ebc681849e7b241db71ad7e76a9d0dec43 Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Sun, 7 Feb 2021 21:05:34 -0500 Subject: [PATCH 234/303] Search for device automatically if none given --- include/modules/keyboard_state.hpp | 3 +- resources/config | 5 +-- src/modules/keyboard_state.cpp | 69 +++++++++++++++++++++--------- 3 files changed, 52 insertions(+), 25 deletions(-) diff --git a/include/modules/keyboard_state.hpp b/include/modules/keyboard_state.hpp index 0873ad5..d6d98de 100644 --- a/include/modules/keyboard_state.hpp +++ b/include/modules/keyboard_state.hpp @@ -24,6 +24,8 @@ class KeyboardState : public AModule { auto update() -> void; private: + static auto openDevice(const std::string&) -> std::pair; + const Bar& bar_; Gtk::Box box_; Gtk::Label numlock_label_; @@ -37,7 +39,6 @@ class KeyboardState : public AModule { std::string icon_locked_; std::string icon_unlocked_; - std::string dev_path_; int fd_; libevdev* dev_; diff --git a/resources/config b/resources/config index a83edf1..465f694 100644 --- a/resources/config +++ b/resources/config @@ -25,13 +25,12 @@ // }, "keyboard_state": { "numlock": true, + "capslock": true, "format": "{name} {icon}", "format-icons": { "locked": "", "unlocked": "" - }, - "capslock": true, - "device-path": "/dev/input/by-path/platform-i8042-serio-0-event-kbd" + } }, "sway/mode": { "format": "{}" diff --git a/src/modules/keyboard_state.cpp b/src/modules/keyboard_state.cpp index 516502f..9a7802f 100644 --- a/src/modules/keyboard_state.cpp +++ b/src/modules/keyboard_state.cpp @@ -1,5 +1,6 @@ #include "modules/keyboard_state.hpp" #include +#include extern "C" { #include @@ -28,8 +29,9 @@ waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar& : "locked"), icon_unlocked_(config_["format-icons"]["unlocked"].isString() ? config_["format-icons"]["unlocked"].asString() - : "unlocked") - { + : "unlocked"), + fd_(0), + dev_(nullptr) { box_.set_name("keyboard_state"); if (config_["numlock"].asBool()) { box_.pack_end(numlock_label_, false, false, 0); @@ -46,26 +48,28 @@ waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar& event_box_.add(box_); if (config_["device-path"].isString()) { - dev_path_ = config_["device-path"].asString(); + std::string dev_path = config_["device-path"].asString(); + std::tie(fd_, dev_) = openDevice(dev_path); } else { - dev_path_ = ""; - } - - fd_ = open(dev_path_.c_str(), O_NONBLOCK | O_CLOEXEC | O_RDONLY); - if (fd_ < 0) { - throw std::runtime_error("Can't open " + dev_path_); - } - int err = libevdev_new_from_fd(fd_, &dev_); - if (err < 0) { - throw std::runtime_error("Can't create libevdev device"); - } - if (!libevdev_has_event_type(dev_, EV_LED)) { - throw std::runtime_error("Device doesn't support LED events"); - } - if (!libevdev_has_event_code(dev_, EV_LED, LED_NUML) - || !libevdev_has_event_code(dev_, EV_LED, LED_CAPSL) - || !libevdev_has_event_code(dev_, EV_LED, LED_SCROLLL)) { - throw std::runtime_error("Device doesn't support num lock, caps lock, or scroll lock events"); + DIR* dev_dir = opendir("/dev/input"); + if (dev_dir == nullptr) { + throw std::runtime_error("Failed to open /dev/input"); + } + dirent *ep; + while ((ep = readdir(dev_dir))) { + if (ep->d_type != DT_CHR) continue; + std::string dev_path = std::string("/dev/input/") + ep->d_name; + try { + std::tie(fd_, dev_) = openDevice(dev_path); + spdlog::info("Found device {} at '{}'", libevdev_get_name(dev_), dev_path); + break; + } catch (const std::runtime_error& e) { + continue; + } + } + if (dev_ == nullptr) { + throw std::runtime_error("Failed to find keyboard device"); + } } thread_ = [this] { @@ -82,6 +86,29 @@ waybar::modules::KeyboardState::~KeyboardState() { } } +auto waybar::modules::KeyboardState::openDevice(const std::string& path) -> std::pair { + int fd = open(path.c_str(), O_NONBLOCK | O_CLOEXEC | O_RDONLY); + if (fd < 0) { + throw std::runtime_error("Can't open " + path); + } + + libevdev* dev; + int err = libevdev_new_from_fd(fd, &dev); + if (err < 0) { + throw std::runtime_error("Can't create libevdev device"); + } + if (!libevdev_has_event_type(dev, EV_LED)) { + throw std::runtime_error("Device doesn't support LED events"); + } + if (!libevdev_has_event_code(dev, EV_LED, LED_NUML) + || !libevdev_has_event_code(dev, EV_LED, LED_CAPSL) + || !libevdev_has_event_code(dev, EV_LED, LED_SCROLLL)) { + throw std::runtime_error("Device doesn't support num lock, caps lock, or scroll lock events"); + } + + return std::make_pair(fd, dev); +} + auto waybar::modules::KeyboardState::update() -> void { int err = LIBEVDEV_READ_STATUS_SUCCESS; while (err == LIBEVDEV_READ_STATUS_SUCCESS) { From 99138ffdcd6e3620a9952d7ca1ceb7b0fc5edfb1 Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Thu, 15 Apr 2021 17:41:15 -0400 Subject: [PATCH 235/303] Add man page for keyboard_state module --- man/waybar-keyboard-state.5.scd | 80 +++++++++++++++++++++++++++++++++ man/waybar.5.scd.in | 1 + meson.build | 1 + 3 files changed, 82 insertions(+) create mode 100644 man/waybar-keyboard-state.5.scd diff --git a/man/waybar-keyboard-state.5.scd b/man/waybar-keyboard-state.5.scd new file mode 100644 index 0000000..8e9ca5e --- /dev/null +++ b/man/waybar-keyboard-state.5.scd @@ -0,0 +1,80 @@ +waybar-keyboard-state(5) + +# NAME + +waybar - keyboard_state module + +# DESCRIPTION + +The *keyboard_state* module displays the state of number lock, caps lock, and scroll lock. + +# CONFIGURATION + +*interval*: ++ + typeof: integer ++ + default: 1 ++ + The interval, in seconds, to poll the keyboard state. + +*format*: ++ + typeof: string|object ++ + default: {name} {icon} ++ + The format, how information should be displayed. If a string, the same format is used for all keyboard states. If an object, the fields "numlock", "capslock", and "scrolllock" each specify the format for the corresponding state. Any unspecified states use the default format. + +*format-icons*: ++ + typeof: object ++ + default: {"locked": "locked", "unlocked": "unlocked"} ++ + Based on the keyboard state, the corresponding icon gets selected. The same set of icons is used for number, caps, and scroll lock, but the icon is selected from the set independently for each. See *icons*. + +*numlock*: ++ + typeof: bool ++ + default: false ++ + Display the number lock state. + +*capslock*: ++ + typeof: bool ++ + default: false ++ + Display the caps lock state. + +*scrolllock*: ++ + typeof: bool ++ + default: false ++ + Display the scroll lock state. + +*device-path*: ++ + typeof: string ++ + default: chooses first valid input device ++ + Which libevdev input device to show the state of. Libevdev devices can be found in /dev/input. The device should support number lock, caps lock, and scroll lock events. + +# FORMAT REPLACEMENTS + +*{name}*: Caps, Num, or Scroll. + +*{icon}*: Icon, as defined in *format-icons*. + +# ICONS + +The following *format-icons* can be set. + +- *locked*: Will be shown when the keyboard state is locked. Default "locked". +- *unlocked*: Will be shown when the keyboard state is not locked. Default "unlocked" + +# EXAMPLE: + +``` +"keyboard_state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } +} +``` + +# STYLE + +- *#keyboard_state* +- *#keyboard_state label* +- *#keyboard_state label.locked* + diff --git a/man/waybar.5.scd.in b/man/waybar.5.scd.in index 0168de3..9dc6925 100644 --- a/man/waybar.5.scd.in +++ b/man/waybar.5.scd.in @@ -208,6 +208,7 @@ Valid options for the "rotate" property are: 0, 90, 180 and 270. - *waybar-custom(5)* - *waybar-disk(5)* - *waybar-idle-inhibitor(5)* +- *waybar-keyboard-state(5)* - *waybar-memory(5)* - *waybar-mpd(5)* - *waybar-network(5)* diff --git a/meson.build b/meson.build index 7ac6fd6..f3b50f7 100644 --- a/meson.build +++ b/meson.build @@ -317,6 +317,7 @@ if scdoc.found() 'waybar-custom.5.scd', 'waybar-disk.5.scd', 'waybar-idle-inhibitor.5.scd', + 'waybar-keyboard-state.5.scd', 'waybar-memory.5.scd', 'waybar-mpd.5.scd', 'waybar-network.5.scd', From 9880c6929f64284aa088a8a662ac3c636176b685 Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Tue, 20 Jul 2021 21:24:43 -0400 Subject: [PATCH 236/303] Install libevdev in FreeBSD workflow --- .github/workflows/freebsd.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 2fde610..f02c9b5 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -15,8 +15,9 @@ jobs: export CPPFLAGS=-isystem/usr/local/include LDFLAGS=-L/usr/local/lib # sndio sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf pkg install -y git # subprojects/date - pkg install -y gtk-layer-shell gtkmm30 jsoncpp libdbusmenu sndio \ - libfmt libmpdclient libudev-devd meson pkgconf pulseaudio scdoc spdlog + pkg install -y evdev-proto gtk-layer-shell gtkmm30 jsoncpp libdbusmenu \ + libevdev libfmt libmpdclient libudev-devd meson pkgconf pulseaudio \ + scdoc sndio spdlog run: | meson build -Dman-pages=enabled ninja -C build From 311c5779ea7729474343490817974a6c89d6fe0c Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Tue, 20 Jul 2021 23:01:39 -0400 Subject: [PATCH 237/303] Remove unused variable --- include/modules/keyboard_state.hpp | 1 - src/modules/keyboard_state.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/include/modules/keyboard_state.hpp b/include/modules/keyboard_state.hpp index d6d98de..1793bfe 100644 --- a/include/modules/keyboard_state.hpp +++ b/include/modules/keyboard_state.hpp @@ -26,7 +26,6 @@ class KeyboardState : public AModule { private: static auto openDevice(const std::string&) -> std::pair; - const Bar& bar_; Gtk::Box box_; Gtk::Label numlock_label_; Gtk::Label capslock_label_; diff --git a/src/modules/keyboard_state.cpp b/src/modules/keyboard_state.cpp index 9a7802f..ca72144 100644 --- a/src/modules/keyboard_state.cpp +++ b/src/modules/keyboard_state.cpp @@ -10,7 +10,6 @@ extern "C" { waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar& bar, const Json::Value& config) : AModule(config, "keyboard_state", id, false, !config["disable-scroll"].asBool()), - bar_(bar), box_(bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0), numlock_label_(""), capslock_label_(""), From 1440ed29d45f978164f37dd86c3e0e0bcaadef85 Mon Sep 17 00:00:00 2001 From: Michael Swiger Date: Tue, 20 Jul 2021 22:29:34 -0700 Subject: [PATCH 238/303] Fix blurry tray icons for HiDPI displays --- src/modules/sni/item.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index abf9556..6fca472 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -1,4 +1,5 @@ #include "modules/sni/item.hpp" +#include #include #include #include @@ -252,33 +253,42 @@ Glib::RefPtr Item::extractPixBuf(GVariant* variant) { } void Item::updateImage() { + auto scale_factor = image.get_scale_factor(); + auto scaled_icon_size = icon_size * scale_factor; + image.set_from_icon_name("image-missing", Gtk::ICON_SIZE_MENU); - image.set_pixel_size(icon_size); + image.set_pixel_size(scaled_icon_size); if (!icon_name.empty()) { try { // Try to find icons specified by path and filename std::ifstream temp(icon_name); if (temp.is_open()) { auto pixbuf = Gdk::Pixbuf::create_from_file(icon_name); + if (pixbuf->gobj() != nullptr) { // An icon specified by path and filename may be the wrong size for // the tray - // Keep the aspect ratio and scale to make the height equal to icon_size + // Keep the aspect ratio and scale to make the height equal to scaled_icon_size // If people have non square icons, assume they want it to grow in width not height - int width = icon_size * pixbuf->get_width() / pixbuf->get_height(); + int width = scaled_icon_size * pixbuf->get_width() / pixbuf->get_height(); - pixbuf = pixbuf->scale_simple(width, icon_size, Gdk::InterpType::INTERP_BILINEAR); - image.set(pixbuf); + pixbuf = pixbuf->scale_simple(width, scaled_icon_size, Gdk::InterpType::INTERP_BILINEAR); + + auto surface = Gdk::Cairo::create_surface_from_pixbuf(pixbuf, 0, image.get_window()); + image.set(surface); } } else { - image.set(getIconByName(icon_name, icon_size)); + auto icon_by_name = getIconByName(icon_name, scaled_icon_size); + auto surface = Gdk::Cairo::create_surface_from_pixbuf(icon_by_name, 0, image.get_window()); + image.set(surface); } } catch (Glib::Error& e) { spdlog::error("Item '{}': {}", id, static_cast(e.what())); } } else if (icon_pixmap) { // An icon extracted may be the wrong size for the tray - icon_pixmap = icon_pixmap->scale_simple(icon_size, icon_size, Gdk::InterpType::INTERP_BILINEAR); + icon_pixmap = icon_pixmap->scale_simple(icon_size, scaled_icon_size, Gdk::InterpType::INTERP_BILINEAR); + auto surface = Gdk::Cairo::create_surface_from_pixbuf(icon_pixmap, 0, image.get_window()); image.set(icon_pixmap); } } From 67d482d28b46ee6f89d69016ec3451bbe8653f11 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Jul 2021 09:23:52 +0200 Subject: [PATCH 239/303] Update opensuse --- Dockerfiles/opensuse | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfiles/opensuse b/Dockerfiles/opensuse index eb231fd..1015e5c 100644 --- a/Dockerfiles/opensuse +++ b/Dockerfiles/opensuse @@ -3,5 +3,7 @@ FROM opensuse/tumbleweed:latest RUN zypper -n up && \ + zypper -n addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo && \ + zypper -n refresh && \ zypper -n install -t pattern devel_C_C++ && \ zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc libxkbcommon From 1f5c07a07f5f35dd531177ad1e86251b0a6565a4 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Jul 2021 09:27:54 +0200 Subject: [PATCH 240/303] Update debian --- Dockerfiles/debian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/debian b/Dockerfiles/debian index f7f6e63..7c9e0b0 100644 --- a/Dockerfiles/debian +++ b/Dockerfiles/debian @@ -3,5 +3,5 @@ FROM debian:sid RUN apt-get update && \ - apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon && \ + apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev && \ apt-get clean From 7f5fd1ac8648d1301c2840d328567c120317b285 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Jul 2021 09:30:47 +0200 Subject: [PATCH 241/303] Update opensuse --- Dockerfiles/opensuse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/opensuse b/Dockerfiles/opensuse index 1015e5c..a88aa7d 100644 --- a/Dockerfiles/opensuse +++ b/Dockerfiles/opensuse @@ -3,7 +3,7 @@ FROM opensuse/tumbleweed:latest RUN zypper -n up && \ - zypper -n addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo && \ + zypper addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo | echo 'a' && \ zypper -n refresh && \ zypper -n install -t pattern devel_C_C++ && \ zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc libxkbcommon From 7729ca34275bbc7a2bcd382a14f5be6cc74396e9 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Jul 2021 10:28:56 +0200 Subject: [PATCH 242/303] Update debian --- Dockerfiles/debian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/debian b/Dockerfiles/debian index 7c9e0b0..32d7a6f 100644 --- a/Dockerfiles/debian +++ b/Dockerfiles/debian @@ -3,5 +3,5 @@ FROM debian:sid RUN apt-get update && \ - apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev && \ + apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev libxkbregistry0 && \ apt-get clean From 929fc16994c413923af31d8b4a3d302315943a47 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 23 Jun 2021 00:27:30 -0700 Subject: [PATCH 243/303] fix(tray): ignore unused WindowId property --- include/modules/sni/item.hpp | 1 - src/modules/sni/item.cpp | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index 3cbd0b7..11402c1 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -30,7 +30,6 @@ class Item : public sigc::trackable { std::string status; std::string title; - int32_t window_id; std::string icon_name; Glib::RefPtr icon_pixmap; Glib::RefPtr icon_theme; diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 6fca472..0ccba19 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -105,8 +105,6 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { title = get_variant(value); } else if (name == "Status") { status = get_variant(value); - } else if (name == "WindowId") { - window_id = get_variant(value); } else if (name == "IconName") { icon_name = get_variant(value); } else if (name == "IconPixmap") { From 4b6253e81001e285c7e09a7196b3dad98d9aa783 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 23 Jun 2021 00:27:42 -0700 Subject: [PATCH 244/303] refactor(tray): infer changed properties from signal name Comparing two GVariants is too expensive; let's collect the set of properties updated by each signal and apply them unconditionally. --- include/modules/sni/item.hpp | 5 +++- src/modules/sni/item.cpp | 46 ++++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index 11402c1..fbb5163 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -11,6 +11,9 @@ #include #include +#include +#include + namespace waybar::modules::SNI { class Item : public sigc::trackable { @@ -64,7 +67,7 @@ class Item : public sigc::trackable { Glib::RefPtr proxy_; Glib::RefPtr cancellable_; - bool update_pending_; + std::set update_pending_; }; } // namespace waybar::modules::SNI diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 0ccba19..d3eed4a 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -1,8 +1,11 @@ #include "modules/sni/item.hpp" + #include #include #include + #include +#include template <> struct fmt::formatter : formatter { @@ -40,8 +43,7 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf object_path(op), icon_size(16), effective_icon_size(0), - icon_theme(Gtk::IconTheme::create()), - update_pending_(false) { + icon_theme(Gtk::IconTheme::create()) { if (config["icon-size"].isUInt()) { icon_size = config["icon-size"].asUInt(); } @@ -148,8 +150,6 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { } void Item::getUpdatedProperties() { - update_pending_ = false; - auto params = Glib::VariantContainerBase::create_tuple( {Glib::Variant::create(SNI_INTERFACE_NAME)}); proxy_->call("org.freedesktop.DBus.Properties.GetAll", @@ -166,10 +166,7 @@ void Item::processUpdatedProperties(Glib::RefPtr& _result) { auto properties = properties_variant.get(); for (const auto& [name, value] : properties) { - Glib::VariantBase old_value; - proxy_->get_cached_property(old_value, name); - if (!old_value || !value.equal(old_value)) { - proxy_->set_cached_property(name, value); + if (update_pending_.count(name.raw())) { setProperty(name, const_cast(value)); } } @@ -181,18 +178,37 @@ void Item::processUpdatedProperties(Glib::RefPtr& _result) { } catch (const std::exception& err) { spdlog::warn("Failed to update properties: {}", err.what()); } + update_pending_.clear(); } +/** + * Mapping from a signal name to a set of possibly changed properties. + * Commented signals are not handled by the tray module at the moment. + */ +static const std::map> signal2props = { + {"NewTitle", {"Title"}}, + {"NewIcon", {"IconName", "IconPixmap"}}, + // {"NewAttentionIcon", {"AttentionIconName", "AttentionIconPixmap", "AttentionMovieName"}}, + // {"NewOverlayIcon", {"OverlayIconName", "OverlayIconPixmap"}}, + {"NewIconThemePath", {"IconThemePath"}}, + {"NewToolTip", {"ToolTip"}}, + {"NewStatus", {"Status"}}, + // {"XAyatanaNewLabel", {"XAyatanaLabel"}}, +}; + void Item::onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name, const Glib::VariantContainerBase& arguments) { spdlog::trace("Tray item '{}' got signal {}", id, signal_name); - if (!update_pending_ && signal_name.compare(0, 3, "New") == 0) { - /* Debounce signals and schedule update of all properties. - * Based on behavior of Plasma dataengine for StatusNotifierItem. - */ - update_pending_ = true; - Glib::signal_timeout().connect_once(sigc::mem_fun(*this, &Item::getUpdatedProperties), - UPDATE_DEBOUNCE_TIME); + auto changed = signal2props.find(signal_name.raw()); + if (changed != signal2props.end()) { + if (update_pending_.empty()) { + /* Debounce signals and schedule update of all properties. + * Based on behavior of Plasma dataengine for StatusNotifierItem. + */ + Glib::signal_timeout().connect_once(sigc::mem_fun(*this, &Item::getUpdatedProperties), + UPDATE_DEBOUNCE_TIME); + } + update_pending_.insert(changed->second.begin(), changed->second.end()); } } From 84a8f79bbe18ec17036f7816d29cc6c5df20b0de Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 23 Jun 2021 23:47:35 -0700 Subject: [PATCH 245/303] feat(tray): implement tooltips (text only) for tray items --- include/modules/sni/item.hpp | 6 ++++++ src/modules/sni/item.cpp | 24 ++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index fbb5163..fc4596e 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -16,6 +16,11 @@ namespace waybar::modules::SNI { +struct ToolTip { + Glib::ustring icon_name; + Glib::ustring text; +}; + class Item : public sigc::trackable { public: Item(const std::string&, const std::string&, const Json::Value&); @@ -41,6 +46,7 @@ class Item : public sigc::trackable { std::string attention_movie_name; std::string icon_theme_path; std::string menu; + ToolTip tooltip; DbusmenuGtkMenu* dbus_menu = nullptr; Gtk::Menu* gtk_menu = nullptr; /** diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index d3eed4a..f092183 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -81,7 +82,6 @@ void Item::proxyReady(Glib::RefPtr& result) { return; } this->updateImage(); - // this->event_box.set_tooltip_text(this->title); } catch (const Glib::Error& err) { spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what()); @@ -91,10 +91,24 @@ void Item::proxyReady(Glib::RefPtr& result) { } template -T get_variant(Glib::VariantBase& value) { +T get_variant(const Glib::VariantBase& value) { return Glib::VariantBase::cast_dynamic>(value).get(); } +template <> +ToolTip get_variant(const Glib::VariantBase& value) { + ToolTip result; + // Unwrap (sa(iiay)ss) + auto container = value.cast_dynamic(value); + result.icon_name = get_variant(container.get_child(0)); + result.text = get_variant(container.get_child(2)); + auto description = get_variant(container.get_child(3)); + if (!description.empty()) { + 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, name, value); @@ -122,7 +136,10 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { } else if (name == "AttentionMovieName") { attention_movie_name = get_variant(value); } else if (name == "ToolTip") { - // TODO: tooltip + tooltip = get_variant(value); + if (!tooltip.text.empty()) { + event_box.set_tooltip_markup(tooltip.text); + } } else if (name == "IconThemePath") { icon_theme_path = get_variant(value); if (!icon_theme_path.empty()) { @@ -172,7 +189,6 @@ void Item::processUpdatedProperties(Glib::RefPtr& _result) { } this->updateImage(); - // this->event_box.set_tooltip_text(this->title); } catch (const Glib::Error& err) { spdlog::warn("Failed to update properties: {}", err.what()); } catch (const std::exception& err) { From 1418f96e4653aad2e8f0be25453ac022632cbe32 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 30 Jun 2021 22:17:27 -0700 Subject: [PATCH 246/303] feat(tray): fallback to Title for items without ToolTip --- src/modules/sni/item.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index f092183..d4c4872 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -119,6 +119,9 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { id = get_variant(value); } else if (name == "Title") { title = get_variant(value); + if (tooltip.text.empty()) { + event_box.set_tooltip_markup(title); + } } else if (name == "Status") { status = get_variant(value); } else if (name == "IconName") { From 245f7f4b11731c158f15703750b85dd6c87d660f Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 26 Jun 2021 16:33:25 -0700 Subject: [PATCH 247/303] feat(tray): handle scroll events --- include/modules/sni/item.hpp | 6 ++++ man/waybar-tray.5.scd | 4 +++ src/modules/sni/item.cpp | 54 +++++++++++++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index fc4596e..e51d3c7 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -70,6 +70,12 @@ class Item : public sigc::trackable { static void onMenuDestroyed(Item* self, GObject* old_menu_pointer); void makeMenu(); bool handleClick(GdkEventButton* const& /*ev*/); + bool handleScroll(GdkEventScroll* const&); + + // smooth scrolling threshold + gdouble scroll_threshold_ = 0; + gdouble distance_scrolled_x_ = 0; + gdouble distance_scrolled_y_ = 0; Glib::RefPtr proxy_; Glib::RefPtr cancellable_; diff --git a/man/waybar-tray.5.scd b/man/waybar-tray.5.scd index cd0e93f..5446a56 100644 --- a/man/waybar-tray.5.scd +++ b/man/waybar-tray.5.scd @@ -16,6 +16,10 @@ Addressed by *tray* typeof: integer ++ Defines the size of the tray icons. +*smooth-scrolling-threshold*: ++ + typeof: double ++ + Threshold to be used when scrolling. + *spacing*: ++ typeof: integer ++ Defines the spacing between the tray icons. diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index d4c4872..9a77d24 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -48,9 +48,13 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf if (config["icon-size"].isUInt()) { icon_size = config["icon-size"].asUInt(); } + if (config["smooth-scrolling-threshold"].isNumeric()) { + scroll_threshold_ = config["smooth-scrolling-threshold"].asDouble(); + } event_box.add(image); - event_box.add_events(Gdk::BUTTON_PRESS_MASK); + event_box.add_events(Gdk::BUTTON_PRESS_MASK | Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK); event_box.signal_button_press_event().connect(sigc::mem_fun(*this, &Item::handleClick)); + event_box.signal_scroll_event().connect(sigc::mem_fun(*this, &Item::handleScroll)); cancellable_ = Gio::Cancellable::create(); @@ -403,4 +407,52 @@ bool Item::handleClick(GdkEventButton* const& ev) { return false; } +bool Item::handleScroll(GdkEventScroll* const& ev) { + int dx = 0, dy = 0; + switch (ev->direction) { + case GDK_SCROLL_UP: + dy = -1; + break; + case GDK_SCROLL_DOWN: + dy = 1; + break; + case GDK_SCROLL_LEFT: + dx = -1; + break; + case GDK_SCROLL_RIGHT: + dx = 1; + break; + case GDK_SCROLL_SMOOTH: + distance_scrolled_x_ += ev->delta_x; + distance_scrolled_y_ += ev->delta_y; + // check against the configured threshold and ensure that the absolute value >= 1 + if (distance_scrolled_x_ > scroll_threshold_) { + dx = (int)lround(std::max(distance_scrolled_x_, 1.0)); + distance_scrolled_x_ = 0; + } else if (distance_scrolled_x_ < -scroll_threshold_) { + dx = (int)lround(std::min(distance_scrolled_x_, -1.0)); + distance_scrolled_x_ = 0; + } + if (distance_scrolled_y_ > scroll_threshold_) { + dy = (int)lround(std::max(distance_scrolled_y_, 1.0)); + distance_scrolled_y_ = 0; + } else if (distance_scrolled_y_ < -scroll_threshold_) { + dy = (int)lround(std::min(distance_scrolled_y_, -1.0)); + distance_scrolled_y_ = 0; + } + break; + } + if (dx != 0) { + auto parameters = Glib::VariantContainerBase::create_tuple( + {Glib::Variant::create(dx), Glib::Variant::create("horizontal")}); + proxy_->call("Scroll", parameters); + } + if (dy != 0) { + auto parameters = Glib::VariantContainerBase::create_tuple( + {Glib::Variant::create(dy), Glib::Variant::create("vertical")}); + proxy_->call("Scroll", parameters); + } + return true; +} + } // namespace waybar::modules::SNI From a5fe6f40b8d1439b8c9794e30ba97d92fabc4715 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 2 Jul 2021 19:44:10 -0700 Subject: [PATCH 248/303] feat(tray): handle Status property On the `Passive` value of `Status` tray items would be hidden unless `show-passive-items` is set to true. On the `NeedsAttention` value of `Status` tray items will have a `.needs-attention` CSS class. --- include/modules/sni/item.hpp | 4 +++- man/waybar-tray.5.scd | 8 ++++++++ resources/style.css | 9 +++++++++ src/modules/sni/item.cpp | 24 ++++++++++++++++++++++-- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index e51d3c7..1f1503e 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -35,7 +35,6 @@ class Item : public sigc::trackable { Gtk::EventBox event_box; std::string category; std::string id; - std::string status; std::string title; std::string icon_name; @@ -59,6 +58,7 @@ class Item : public sigc::trackable { private: void proxyReady(Glib::RefPtr& result); void setProperty(const Glib::ustring& name, Glib::VariantBase& value); + void setStatus(const Glib::ustring& value); void getUpdatedProperties(); void processUpdatedProperties(Glib::RefPtr& result); void onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name, @@ -76,6 +76,8 @@ class Item : public sigc::trackable { gdouble scroll_threshold_ = 0; gdouble distance_scrolled_x_ = 0; gdouble distance_scrolled_y_ = 0; + // visibility of items with Status == Passive + bool show_passive_ = false; Glib::RefPtr proxy_; Glib::RefPtr cancellable_; diff --git a/man/waybar-tray.5.scd b/man/waybar-tray.5.scd index 5446a56..c664594 100644 --- a/man/waybar-tray.5.scd +++ b/man/waybar-tray.5.scd @@ -16,6 +16,11 @@ Addressed by *tray* typeof: integer ++ Defines the size of the tray icons. +*show-passive-items*: ++ + typeof: bool ++ + default: false ++ + Defines visibility of the tray icons with *Passive* status. + *smooth-scrolling-threshold*: ++ typeof: double ++ Threshold to be used when scrolling. @@ -41,3 +46,6 @@ Addressed by *tray* # STYLE - *#tray* +- *#tray > .passive* +- *#tray > .active* +- *#tray > .needs-attention* diff --git a/resources/style.css b/resources/style.css index 63ea871..32dce42 100644 --- a/resources/style.css +++ b/resources/style.css @@ -195,6 +195,15 @@ label:focus { background-color: #2980b9; } +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + #idle_inhibitor { background-color: #2d3436; } diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 9a77d24..267cf63 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -51,10 +51,15 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf if (config["smooth-scrolling-threshold"].isNumeric()) { scroll_threshold_ = config["smooth-scrolling-threshold"].asDouble(); } + if (config["show-passive-items"].isBool()) { + show_passive_ = config["show-passive-items"].asBool(); + } event_box.add(image); event_box.add_events(Gdk::BUTTON_PRESS_MASK | Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK); event_box.signal_button_press_event().connect(sigc::mem_fun(*this, &Item::handleClick)); event_box.signal_scroll_event().connect(sigc::mem_fun(*this, &Item::handleScroll)); + // initial visibility + event_box.set_visible(show_passive_); cancellable_ = Gio::Cancellable::create(); @@ -81,7 +86,7 @@ void Item::proxyReady(Glib::RefPtr& result) { this->proxy_->signal_signal().connect(sigc::mem_fun(*this, &Item::onSignal)); - if (this->id.empty() || this->category.empty() || this->status.empty()) { + if (this->id.empty() || this->category.empty()) { spdlog::error("Invalid Status Notifier Item: {}, {}", bus_name, object_path); return; } @@ -127,7 +132,7 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { event_box.set_tooltip_markup(title); } } else if (name == "Status") { - status = get_variant(value); + setStatus(get_variant(value)); } else if (name == "IconName") { icon_name = get_variant(value); } else if (name == "IconPixmap") { @@ -173,6 +178,21 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) { } } +void Item::setStatus(const Glib::ustring& value) { + Glib::ustring lower = value.lowercase(); + event_box.set_visible(show_passive_ || lower.compare("passive") != 0); + + auto style = event_box.get_style_context(); + for (const auto& class_name : style->list_classes()) { + style->remove_class(class_name); + } + if (lower.compare("needsattention") == 0) { + // convert status to dash-case for CSS + lower = "needs-attention"; + } + style->add_class(lower); +} + void Item::getUpdatedProperties() { auto params = Glib::VariantContainerBase::create_tuple( {Glib::Variant::create(SNI_INTERFACE_NAME)}); From cf832798fb4ac250fb1ff0435e8f8f3c5d384b30 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 23 Jul 2021 14:46:03 +0200 Subject: [PATCH 249/303] Update debian --- Dockerfiles/debian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/debian b/Dockerfiles/debian index 32d7a6f..026d8fd 100644 --- a/Dockerfiles/debian +++ b/Dockerfiles/debian @@ -3,5 +3,5 @@ FROM debian:sid RUN apt-get update && \ - apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev libxkbregistry0 && \ + apt-get install -y build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev libxkbregistry-dev libxkbregistry0 && \ apt-get clean From 77a2eff2ce828eb14105c076f84333531b953ec9 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 23 Jul 2021 14:49:03 +0200 Subject: [PATCH 250/303] Update opensuse --- Dockerfiles/opensuse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/opensuse b/Dockerfiles/opensuse index a88aa7d..d7cdcf6 100644 --- a/Dockerfiles/opensuse +++ b/Dockerfiles/opensuse @@ -6,4 +6,4 @@ RUN zypper -n up && \ zypper addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo | echo 'a' && \ zypper -n refresh && \ zypper -n install -t pattern devel_C_C++ && \ - zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc libxkbcommon + zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc From 2009ceb35093fcf24c23d1d20e024fc3bfc58c35 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 23 Jul 2021 15:01:29 +0200 Subject: [PATCH 251/303] Update opensuse --- Dockerfiles/opensuse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/opensuse b/Dockerfiles/opensuse index d7cdcf6..49dea27 100644 --- a/Dockerfiles/opensuse +++ b/Dockerfiles/opensuse @@ -6,4 +6,4 @@ RUN zypper -n up && \ zypper addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo | echo 'a' && \ zypper -n refresh && \ zypper -n install -t pattern devel_C_C++ && \ - zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel scdoc + zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel libxkbregistry-devel scdoc From 88a5f713ed2c98034dbdd547d184e56a3071c5c8 Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Fri, 23 Jul 2021 09:45:07 -0400 Subject: [PATCH 252/303] Prefer keyboard-state over keyboard_state --- man/waybar-keyboard-state.5.scd | 12 ++++++------ resources/config | 4 ++-- resources/style.css | 6 +++--- src/factory.cpp | 2 +- src/modules/keyboard_state.cpp | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/man/waybar-keyboard-state.5.scd b/man/waybar-keyboard-state.5.scd index 8e9ca5e..1d7c3a8 100644 --- a/man/waybar-keyboard-state.5.scd +++ b/man/waybar-keyboard-state.5.scd @@ -2,11 +2,11 @@ waybar-keyboard-state(5) # NAME -waybar - keyboard_state module +waybar - keyboard-state module # DESCRIPTION -The *keyboard_state* module displays the state of number lock, caps lock, and scroll lock. +The *keyboard-state* module displays the state of number lock, caps lock, and scroll lock. # CONFIGURATION @@ -61,7 +61,7 @@ The following *format-icons* can be set. # EXAMPLE: ``` -"keyboard_state": { +"keyboard-state": { "numlock": true, "capslock": true, "format": "{name} {icon}", @@ -74,7 +74,7 @@ The following *format-icons* can be set. # STYLE -- *#keyboard_state* -- *#keyboard_state label* -- *#keyboard_state label.locked* +- *#keyboard-state* +- *#keyboard-state label* +- *#keyboard-state label.locked* diff --git a/resources/config b/resources/config index 465f694..87f24c0 100644 --- a/resources/config +++ b/resources/config @@ -6,7 +6,7 @@ // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-center": ["sway/window"], - "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard_state", "sway/language", "battery", "battery#bat2", "clock", "tray"], + "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2", "clock", "tray"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, @@ -23,7 +23,7 @@ // "default": "" // } // }, - "keyboard_state": { + "keyboard-state": { "numlock": true, "capslock": true, "format": "{name} {icon}", diff --git a/resources/style.css b/resources/style.css index c1ac5ad..b585e5f 100644 --- a/resources/style.css +++ b/resources/style.css @@ -229,7 +229,7 @@ label:focus { min-width: 16px; } -#keyboard_state { +#keyboard-state { background: #97e1ad; color: #000000; padding: 0 0px; @@ -237,10 +237,10 @@ label:focus { min-width: 16px; } -#keyboard_state > label { +#keyboard-state > label { padding: 0 5px; } -#keyboard_state > label.locked { +#keyboard-state > label.locked { background: rgba(0, 0, 0, 0.2); } diff --git a/src/factory.cpp b/src/factory.cpp index 6a0147d..9836354 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -71,7 +71,7 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { } #endif #ifdef HAVE_LIBEVDEV - if (ref == "keyboard_state") { + if (ref == "keyboard-state") { return new waybar::modules::KeyboardState(id, bar_, config_[name]); } #endif diff --git a/src/modules/keyboard_state.cpp b/src/modules/keyboard_state.cpp index ca72144..2b6eb2d 100644 --- a/src/modules/keyboard_state.cpp +++ b/src/modules/keyboard_state.cpp @@ -9,7 +9,7 @@ extern "C" { } waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar& bar, const Json::Value& config) - : AModule(config, "keyboard_state", id, false, !config["disable-scroll"].asBool()), + : AModule(config, "keyboard-state", id, false, !config["disable-scroll"].asBool()), box_(bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0), numlock_label_(""), capslock_label_(""), @@ -31,7 +31,7 @@ waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar& : "unlocked"), fd_(0), dev_(nullptr) { - box_.set_name("keyboard_state"); + box_.set_name("keyboard-state"); if (config_["numlock"].asBool()) { box_.pack_end(numlock_label_, false, false, 0); } From 68e4457f3a226c985bb48bf470f1a992e91cf688 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sat, 24 Jul 2021 17:24:37 +0300 Subject: [PATCH 253/303] Add tooltip-formay --- include/modules/sway/language.hpp | 1 + man/waybar-sway-language.5.scd | 5 +++++ src/modules/sway/language.cpp | 15 ++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/modules/sway/language.hpp b/include/modules/sway/language.hpp index fb4438b..b310b7f 100644 --- a/include/modules/sway/language.hpp +++ b/include/modules/sway/language.hpp @@ -48,6 +48,7 @@ class Language : public ALabel, public sigc::trackable { const static std::string XKB_ACTIVE_LAYOUT_NAME_KEY; Layout layout_; + std::string tooltip_format_ = ""; std::map layouts_map_; XKBContext xkb_context_; bool is_variant_displayed; diff --git a/man/waybar-sway-language.5.scd b/man/waybar-sway-language.5.scd index f7f8830..60a18fc 100644 --- a/man/waybar-sway-language.5.scd +++ b/man/waybar-sway-language.5.scd @@ -17,6 +17,11 @@ Addressed by *sway/language* default: {} ++ The format, how layout should be displayed. +*format-tooltip*: ++ + typeof: string ++ + default: {} ++ + The format, how layout should be displayed in tooltip. + *tooltip*: ++ typeof: bool ++ default: true ++ diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index 86a8e1e..5f3ce06 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -1,6 +1,7 @@ #include "modules/sway/language.hpp" #include +#include #include #include @@ -19,6 +20,9 @@ const std::string Language::XKB_ACTIVE_LAYOUT_NAME_KEY = "xkb_active_layout_name Language::Language(const std::string& id, const Json::Value& config) : ALabel(config, "language", id, "{}", 0, true) { is_variant_displayed = format_.find("{variant}") != std::string::npos; + if (config.isMember("tooltip-format")) { + tooltip_format_ = config["tooltip-format"].asString(); + } ipc_.subscribe(R"(["input"])"); ipc_.signal_event.connect(sigc::mem_fun(*this, &Language::onEvent)); ipc_.signal_cmd.connect(sigc::mem_fun(*this, &Language::onCmd)); @@ -90,7 +94,16 @@ auto Language::update() -> void { fmt::arg("variant", layout_.variant))); label_.set_markup(display_layout); if (tooltipEnabled()) { - label_.set_tooltip_markup(display_layout); + if (tooltip_format_ != "") { + auto tooltip_display_layout = trim(fmt::format(tooltip_format_, + fmt::arg("short", layout_.short_name), + fmt::arg("long", layout_.full_name), + fmt::arg("variant", layout_.variant))); + label_.set_tooltip_markup(tooltip_display_layout); + + } else { + label_.set_tooltip_markup(display_layout); + } } event_box_.show(); From af2113931a2b1fc8d331581bbaec2f747d158f04 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sat, 24 Jul 2021 17:26:49 +0300 Subject: [PATCH 254/303] fix typo --- man/waybar-sway-language.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/waybar-sway-language.5.scd b/man/waybar-sway-language.5.scd index 60a18fc..76bc720 100644 --- a/man/waybar-sway-language.5.scd +++ b/man/waybar-sway-language.5.scd @@ -17,7 +17,7 @@ Addressed by *sway/language* default: {} ++ The format, how layout should be displayed. -*format-tooltip*: ++ +*tooltip-format*: ++ typeof: string ++ default: {} ++ The format, how layout should be displayed in tooltip. From 710f933fa6165bf02a25f371496de76f1cdbbca6 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sat, 31 Jul 2021 14:55:17 +0000 Subject: [PATCH 255/303] Don't start if graphical-session is not running Currently waybar _can_ try to start even if there's no graphical session (and no sway) running. Adding `Requisite=` prevents this. From `systemd.unit(5)`: Requisite= Similar to Requires=. However, if the units listed here are not started already, they will not be started and the starting of this unit will fail immediately. Requisite= does not imply an ordering dependency, even if both units are started in the same transaction. Hence this setting should usually be combined with After=, to ensure this unit is not started before the other unit. When Requisite=b.service is used on a.service, this dependency will show as RequisiteOf=a.service in property listing of b.service. RequisiteOf= dependency cannot be specified directly. --- resources/waybar.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/waybar.service.in b/resources/waybar.service.in index ef0d07e..81ac677 100644 --- a/resources/waybar.service.in +++ b/resources/waybar.service.in @@ -3,6 +3,7 @@ Description=Highly customizable Wayland bar for Sway and Wlroots based composito Documentation=https://github.com/Alexays/Waybar/wiki/ PartOf=graphical-session.target After=graphical-session.target +Requisite=graphical-session.target [Service] ExecStart=@prefix@/bin/waybar From 4f6a9b1bc29cc73400e6d2b7253ff1bc1f1ba595 Mon Sep 17 00:00:00 2001 From: Michael Swiger Date: Sat, 31 Jul 2021 16:14:02 -0700 Subject: [PATCH 256/303] Fix incorrect tray icon scaling --- include/modules/sni/item.hpp | 2 ++ src/modules/sni/item.cpp | 68 +++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index 1f1503e..1115145 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -66,7 +66,9 @@ class Item : public sigc::trackable { void updateImage(); Glib::RefPtr extractPixBuf(GVariant* variant); + Glib::RefPtr getIconPixbuf(); Glib::RefPtr getIconByName(const std::string& name, int size); + double getScaledIconSize(); static void onMenuDestroyed(Item* self, GObject* old_menu_pointer); void makeMenu(); bool handleClick(GdkEventButton* const& /*ev*/); diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 267cf63..d40f0dd 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -310,44 +310,41 @@ Glib::RefPtr Item::extractPixBuf(GVariant* variant) { } void Item::updateImage() { - auto scale_factor = image.get_scale_factor(); - auto scaled_icon_size = icon_size * scale_factor; + auto pixbuf = getIconPixbuf(); + auto scaled_icon_size = getScaledIconSize(); + + if (!pixbuf) { + pixbuf = getIconByName("image-missing", getScaledIconSize()); + } - image.set_from_icon_name("image-missing", Gtk::ICON_SIZE_MENU); - image.set_pixel_size(scaled_icon_size); - if (!icon_name.empty()) { - try { - // Try to find icons specified by path and filename + // If the loaded icon is not square, assume that the icon height should match the + // requested icon size, but the width is allowed to be different. As such, if the + // height of the image does not match the requested icon size, resize the icon such that + // the aspect ratio is maintained, but the height matches the requested icon size. + if (pixbuf->get_height() != scaled_icon_size) { + int width = scaled_icon_size * pixbuf->get_width() / pixbuf->get_height(); + pixbuf = pixbuf->scale_simple(width, scaled_icon_size, Gdk::InterpType::INTERP_BILINEAR); + } + + auto surface = Gdk::Cairo::create_surface_from_pixbuf(pixbuf, 0, image.get_window()); + image.set(surface); +} + +Glib::RefPtr Item::getIconPixbuf() { + try { + if (!icon_name.empty()) { std::ifstream temp(icon_name); if (temp.is_open()) { - auto pixbuf = Gdk::Pixbuf::create_from_file(icon_name); - - if (pixbuf->gobj() != nullptr) { - // An icon specified by path and filename may be the wrong size for - // the tray - // Keep the aspect ratio and scale to make the height equal to scaled_icon_size - // If people have non square icons, assume they want it to grow in width not height - int width = scaled_icon_size * pixbuf->get_width() / pixbuf->get_height(); - - pixbuf = pixbuf->scale_simple(width, scaled_icon_size, Gdk::InterpType::INTERP_BILINEAR); - - auto surface = Gdk::Cairo::create_surface_from_pixbuf(pixbuf, 0, image.get_window()); - image.set(surface); - } - } else { - auto icon_by_name = getIconByName(icon_name, scaled_icon_size); - auto surface = Gdk::Cairo::create_surface_from_pixbuf(icon_by_name, 0, image.get_window()); - image.set(surface); + return Gdk::Pixbuf::create_from_file(icon_name); } - } catch (Glib::Error& e) { - spdlog::error("Item '{}': {}", id, static_cast(e.what())); + return getIconByName(icon_name, getScaledIconSize()); + } else if (icon_pixmap) { + return icon_pixmap; } - } else if (icon_pixmap) { - // An icon extracted may be the wrong size for the tray - icon_pixmap = icon_pixmap->scale_simple(icon_size, scaled_icon_size, Gdk::InterpType::INTERP_BILINEAR); - auto surface = Gdk::Cairo::create_surface_from_pixbuf(icon_pixmap, 0, image.get_window()); - image.set(icon_pixmap); - } + } catch (Glib::Error& e) { + spdlog::error("Item '{}': {}", id, static_cast(e.what())); + } + return getIconByName("image-missing", getScaledIconSize()); } Glib::RefPtr Item::getIconByName(const std::string& name, int request_size) { @@ -382,6 +379,11 @@ Glib::RefPtr Item::getIconByName(const std::string& name, int reque name.c_str(), tmp_size, Gtk::IconLookupFlags::ICON_LOOKUP_FORCE_SIZE); } +double Item::getScaledIconSize() { + // apply the scale factor from the Gtk window to the requested icon size + return icon_size * image.get_scale_factor(); +} + void Item::onMenuDestroyed(Item* self, GObject* old_menu_pointer) { if (old_menu_pointer == reinterpret_cast(self->dbus_menu)) { self->gtk_menu = nullptr; From e5787a2617df99ed465a46b5cd3063f3c440450a Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 16 Aug 2021 15:47:34 +0200 Subject: [PATCH 257/303] chore: 0.9.8 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1c065f7..835b70e 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project( 'waybar', 'cpp', 'c', - version: '0.9.7', + version: '0.9.8', license: 'MIT', meson_version: '>= 0.49.0', default_options : [ From a57e431437da8bae31cf4bde1ede57d7d21609b6 Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 17 Aug 2021 05:28:41 +0300 Subject: [PATCH 258/303] Add shortDescription --- include/modules/sway/language.hpp | 3 ++- man/waybar-sway-language.5.scd | 6 ++++-- src/modules/sway/language.cpp | 21 ++++++++++++++++----- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/include/modules/sway/language.hpp b/include/modules/sway/language.hpp index b310b7f..5cceee6 100644 --- a/include/modules/sway/language.hpp +++ b/include/modules/sway/language.hpp @@ -25,6 +25,7 @@ class Language : public ALabel, public sigc::trackable { std::string full_name; std::string short_name; std::string variant; + std::string short_description; }; class XKBContext { @@ -36,6 +37,7 @@ class Language : public ALabel, public sigc::trackable { rxkb_context* context_ = nullptr; rxkb_layout* xkb_layout_ = nullptr; Layout* layout_ = nullptr; + std::map base_layouts_by_name_; }; void onEvent(const struct Ipc::ipc_response&); @@ -50,7 +52,6 @@ class Language : public ALabel, public sigc::trackable { Layout layout_; std::string tooltip_format_ = ""; std::map layouts_map_; - XKBContext xkb_context_; bool is_variant_displayed; util::JsonParser parser_; diff --git a/man/waybar-sway-language.5.scd b/man/waybar-sway-language.5.scd index 76bc720..92a647e 100644 --- a/man/waybar-sway-language.5.scd +++ b/man/waybar-sway-language.5.scd @@ -29,11 +29,13 @@ Addressed by *sway/language* # FORMAT REPLACEMENTS -*{short}*: Short name of layout (e.g. "en"). Equals to {}. +*{short}*: Short name of layout (e.g. "us"). Equals to {}. + +*{shortDescription}*: Short description of layout (e.g. "en"). *{long}*: Long name of layout (e.g. "English (Dvorak)"). -*{variant}*: Variant of layout (e.g. "Dvorak"). +*{variant}*: Variant of layout (e.g. "dvorak"). # EXAMPLES diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index 5f3ce06..f7be4cb 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -90,6 +90,7 @@ void Language::onEvent(const struct Ipc::ipc_response& res) { auto Language::update() -> void { auto display_layout = trim(fmt::format(format_, fmt::arg("short", layout_.short_name), + fmt::arg("shortDescription", layout_.short_description), fmt::arg("long", layout_.full_name), fmt::arg("variant", layout_.variant))); label_.set_markup(display_layout); @@ -97,10 +98,10 @@ auto Language::update() -> void { if (tooltip_format_ != "") { auto tooltip_display_layout = trim(fmt::format(tooltip_format_, fmt::arg("short", layout_.short_name), + fmt::arg("shortDescription", layout_.short_description), fmt::arg("long", layout_.full_name), fmt::arg("variant", layout_.variant))); label_.set_tooltip_markup(tooltip_display_layout); - } else { label_.set_tooltip_markup(display_layout); } @@ -118,8 +119,9 @@ auto Language::set_current_layout(std::string current_layout) -> void { auto Language::init_layouts_map(const std::vector& used_layouts) -> void { std::map> found_by_short_names; - auto layout = xkb_context_.next_layout(); - for (; layout != nullptr; layout = xkb_context_.next_layout()) { + XKBContext* xkb_context_ = new XKBContext(); + auto layout = xkb_context_->next_layout(); + for (; layout != nullptr; layout = xkb_context_->next_layout()) { if (std::find(used_layouts.begin(), used_layouts.end(), layout->full_name) == used_layouts.end()) { continue; @@ -136,6 +138,7 @@ auto Language::init_layouts_map(const std::vector& used_layouts) -> layouts_map_.emplace(layout->full_name, *layout); } + //delete xkb_context_; if (is_variant_displayed || found_by_short_names.size() == 0) { return; @@ -145,7 +148,6 @@ auto Language::init_layouts_map(const std::vector& used_layouts) -> for (const auto& used_layout_name : used_layouts) { auto used_layout = &layouts_map_.find(used_layout_name)->second; auto layouts_with_same_name_list = found_by_short_names[used_layout->short_name]; - spdlog::info("SIZE: " + std::to_string(layouts_with_same_name_list.size())); if (layouts_with_same_name_list.size() < 2) { continue; } @@ -180,8 +182,17 @@ auto Language::XKBContext::next_layout() -> Layout* { auto name = std::string(rxkb_layout_get_name(xkb_layout_)); auto variant_ = rxkb_layout_get_variant(xkb_layout_); std::string variant = variant_ == nullptr ? "" : std::string(variant_); + auto short_description_ = rxkb_layout_get_brief(xkb_layout_); + std::string short_description; + if (short_description_ != nullptr) { + short_description = std::string(short_description_); + base_layouts_by_name_.emplace(name, xkb_layout_); + } else { + auto base_layout = base_layouts_by_name_[name]; + short_description = base_layout == nullptr ? "" : std::string(rxkb_layout_get_brief(base_layout)); + } - layout_ = new Layout{description, name, variant}; + layout_ = new Layout{description, name, variant, short_description}; return layout_; } From a87a967a97c48472a6b8bc632b0ad87c0988ac0d Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 17 Aug 2021 05:29:35 +0300 Subject: [PATCH 259/303] Fix leak --- src/modules/sway/language.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index f7be4cb..0b56dad 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -138,7 +138,7 @@ auto Language::init_layouts_map(const std::vector& used_layouts) -> layouts_map_.emplace(layout->full_name, *layout); } - //delete xkb_context_; + delete xkb_context_; if (is_variant_displayed || found_by_short_names.size() == 0) { return; From 2d80d3152797e53b2b7176e498d5c02f69b3cff8 Mon Sep 17 00:00:00 2001 From: Michael Swiger Date: Mon, 16 Aug 2021 23:33:29 -0700 Subject: [PATCH 260/303] Fix tray icon scaling on multi-display setups --- include/modules/sni/host.hpp | 5 ++++- include/modules/sni/item.hpp | 5 ++++- src/modules/sni/host.cpp | 5 +++-- src/modules/sni/item.cpp | 9 ++++++++- src/modules/sni/tray.cpp | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/modules/sni/host.hpp b/include/modules/sni/host.hpp index f97900f..8d32103 100644 --- a/include/modules/sni/host.hpp +++ b/include/modules/sni/host.hpp @@ -5,13 +5,15 @@ #include #include #include +#include "bar.hpp" #include "modules/sni/item.hpp" namespace waybar::modules::SNI { class Host { public: - Host(const std::size_t id, const Json::Value&, const std::function&)>&, + Host(const std::size_t id, const Json::Value&, const Bar&, + const std::function&)>&, const std::function&)>&); ~Host(); @@ -36,6 +38,7 @@ class Host { GCancellable* cancellable_ = nullptr; SnWatcher* watcher_ = nullptr; const Json::Value& config_; + const Bar& bar_; const std::function&)> on_add_; const std::function&)> on_remove_; }; diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index 1115145..430c351 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -14,6 +14,8 @@ #include #include +#include "bar.hpp" + namespace waybar::modules::SNI { struct ToolTip { @@ -23,7 +25,7 @@ struct ToolTip { class Item : public sigc::trackable { public: - Item(const std::string&, const std::string&, const Json::Value&); + Item(const std::string&, const std::string&, const Json::Value&, const Bar&); ~Item() = default; std::string bus_name; @@ -56,6 +58,7 @@ class Item : public sigc::trackable { bool item_is_menu = true; private: + void onConfigure(GdkEventConfigure* ev); void proxyReady(Glib::RefPtr& result); void setProperty(const Glib::ustring& name, Glib::VariantBase& value); void setStatus(const Glib::ustring& value); diff --git a/src/modules/sni/host.cpp b/src/modules/sni/host.cpp index 868fcd6..414f151 100644 --- a/src/modules/sni/host.cpp +++ b/src/modules/sni/host.cpp @@ -4,7 +4,7 @@ namespace waybar::modules::SNI { -Host::Host(const std::size_t id, const Json::Value& config, +Host::Host(const std::size_t id, const Json::Value& config, const Bar& bar, const std::function&)>& on_add, const std::function&)>& on_remove) : bus_name_("org.kde.StatusNotifierHost-" + std::to_string(getpid()) + "-" + @@ -13,6 +13,7 @@ Host::Host(const std::size_t id, const Json::Value& config, bus_name_id_(Gio::DBus::own_name(Gio::DBus::BusType::BUS_TYPE_SESSION, bus_name_, sigc::mem_fun(*this, &Host::busAcquired))), config_(config), + bar_(bar), on_add_(on_add), on_remove_(on_remove) {} @@ -136,7 +137,7 @@ void Host::addRegisteredItem(std::string service) { return bus_name == item->bus_name && object_path == item->object_path; }); if (it == items_.end()) { - items_.emplace_back(new Item(bus_name, object_path, config_)); + items_.emplace_back(new Item(bus_name, object_path, config_, bar_)); on_add_(items_.back()); } } diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index d40f0dd..991ccc4 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -39,7 +39,7 @@ namespace waybar::modules::SNI { static const Glib::ustring SNI_INTERFACE_NAME = sn_item_interface_info()->name; static const unsigned UPDATE_DEBOUNCE_TIME = 10; -Item::Item(const std::string& bn, const std::string& op, const Json::Value& config) +Item::Item(const std::string& bn, const std::string& op, const Json::Value& config, const Bar& bar) : bus_name(bn), object_path(op), icon_size(16), @@ -54,6 +54,9 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf if (config["show-passive-items"].isBool()) { show_passive_ = config["show-passive-items"].asBool(); } + + auto &window = const_cast(bar).window; + window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Item::onConfigure)); event_box.add(image); event_box.add_events(Gdk::BUTTON_PRESS_MASK | Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK); event_box.signal_button_press_event().connect(sigc::mem_fun(*this, &Item::handleClick)); @@ -73,6 +76,10 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf interface); } +void Item::onConfigure(GdkEventConfigure* ev) { + this->updateImage(); +} + void Item::proxyReady(Glib::RefPtr& result) { try { this->proxy_ = Gio::DBus::Proxy::create_for_bus_finish(result); diff --git a/src/modules/sni/tray.cpp b/src/modules/sni/tray.cpp index ae3702c..e73c9eb 100644 --- a/src/modules/sni/tray.cpp +++ b/src/modules/sni/tray.cpp @@ -7,7 +7,7 @@ Tray::Tray(const std::string& id, const Bar& bar, const Json::Value& config) : AModule(config, "tray", id), box_(bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0), watcher_(SNI::Watcher::getInstance()), - host_(nb_hosts_, config, std::bind(&Tray::onAdd, this, std::placeholders::_1), + host_(nb_hosts_, config, bar, std::bind(&Tray::onAdd, this, std::placeholders::_1), std::bind(&Tray::onRemove, this, std::placeholders::_1)) { spdlog::warn( "For a functional tray you must have libappindicator-* installed and export " From 024fd42e272f79cb08e594eb3af86c93b1446c91 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 19 Aug 2021 14:59:25 +0200 Subject: [PATCH 261/303] river/tags: support urgent tags Upstream river has a concept of urgent views/tags as of commit e59c2a73. Introduce a new urgent style to expose this in the waybar module. --- include/modules/river/tags.hpp | 1 + man/waybar-river-tags.5.scd | 6 ++++-- protocol/river-status-unstable-v1.xml | 17 +++++++++++++---- src/modules/river/tags.cpp | 27 +++++++++++++++++++++++++-- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/include/modules/river/tags.hpp b/include/modules/river/tags.hpp index f80b3c5..9b75fbd 100644 --- a/include/modules/river/tags.hpp +++ b/include/modules/river/tags.hpp @@ -18,6 +18,7 @@ class Tags : public waybar::AModule { // Handlers for wayland events void handle_focused_tags(uint32_t tags); void handle_view_tags(struct wl_array *tags); + void handle_urgent_tags(uint32_t tags); struct zriver_status_manager_v1 *status_manager_; diff --git a/man/waybar-river-tags.5.scd b/man/waybar-river-tags.5.scd index 0f02724..65b9033 100644 --- a/man/waybar-river-tags.5.scd +++ b/man/waybar-river-tags.5.scd @@ -15,7 +15,7 @@ Addressed by *river/tags* *num-tags*: ++ typeof: uint ++ default: 9 ++ - The number of tags that should be displayed. + The number of tags that should be displayed. Max 32. *tag-labels*: ++ typeof: array ++ @@ -34,8 +34,10 @@ Addressed by *river/tags* - *#tags button* - *#tags button.occupied* - *#tags button.focused* +- *#tags button.urgent* -Note that a tag can be both occupied and focused at the same time. +Note that occupied/focused/urgent status may overlap. That is, a tag may be +both occupied and focused at the same time. # SEE ALSO diff --git a/protocol/river-status-unstable-v1.xml b/protocol/river-status-unstable-v1.xml index a4d6f4e..13affaa 100644 --- a/protocol/river-status-unstable-v1.xml +++ b/protocol/river-status-unstable-v1.xml @@ -1,7 +1,7 @@ - Copyright 2020 Isaac Freund + Copyright 2020 The River Developers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - + A global factory for objects that receive status information specific to river. It could be used to implement, for example, a status bar. @@ -47,7 +47,7 @@ - + This interface allows clients to receive information about the current windowing state of an output. @@ -75,12 +75,21 @@ + + + + Sent once on binding the interface and again whenever the set of + tags with at least one urgent view changes. + + + This interface allows clients to receive information about the current - focus of a seat. + focus of a seat. Note that (un)focused_output events will only be sent + if the client has bound the relevant wl_output globals. diff --git a/src/modules/river/tags.cpp b/src/modules/river/tags.cpp index e96b201..2628af2 100644 --- a/src/modules/river/tags.cpp +++ b/src/modules/river/tags.cpp @@ -22,14 +22,24 @@ static void listen_view_tags(void *data, struct zriver_output_status_v1 *zriver_ static_cast(data)->handle_view_tags(tags); } +static void listen_urgent_tags(void *data, struct zriver_output_status_v1 *zriver_output_status_v1, + uint32_t tags) { + static_cast(data)->handle_urgent_tags(tags); +} + static const zriver_output_status_v1_listener output_status_listener_impl{ .focused_tags = listen_focused_tags, .view_tags = listen_view_tags, + .urgent_tags = listen_urgent_tags, }; static void handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { if (std::strcmp(interface, zriver_status_manager_v1_interface.name) == 0) { + version = std::min(version, 2); + if (version < ZRIVER_OUTPUT_STATUS_V1_URGENT_TAGS_SINCE_VERSION) { + spdlog::warn("river server does not support urgent tags"); + } static_cast(data)->status_manager_ = static_cast( wl_registry_bind(registry, name, &zriver_status_manager_v1_interface, version)); } @@ -64,8 +74,9 @@ Tags::Tags(const std::string &id, const waybar::Bar &bar, const Json::Value &con } event_box_.add(box_); - // Default to 9 tags - const uint32_t num_tags = config["num-tags"].isUInt() ? config_["num-tags"].asUInt() : 9; + // Default to 9 tags, cap at 32 + const uint32_t num_tags = + config["num-tags"].isUInt() ? std::min(32, config_["num-tags"].asUInt()) : 9; std::vector tag_labels(num_tags); for (uint32_t tag = 0; tag < num_tags; ++tag) { @@ -129,4 +140,16 @@ void Tags::handle_view_tags(struct wl_array *view_tags) { } } +void Tags::handle_urgent_tags(uint32_t tags) { + uint32_t i = 0; + for (auto &button : buttons_) { + if ((1 << i) & tags) { + button.get_style_context()->add_class("urgent"); + } else { + button.get_style_context()->remove_class("urgent"); + } + ++i; + } +} + } /* namespace waybar::modules::river */ From c058a2d196509c15de6c85c241052f5ddc37c430 Mon Sep 17 00:00:00 2001 From: dmitry Date: Fri, 20 Aug 2021 01:09:16 +0300 Subject: [PATCH 262/303] Add number to shortDescripton --- include/modules/sway/language.hpp | 7 +++++++ src/modules/sway/language.cpp | 18 +++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/modules/sway/language.hpp b/include/modules/sway/language.hpp index 5cceee6..1faf52b 100644 --- a/include/modules/sway/language.hpp +++ b/include/modules/sway/language.hpp @@ -21,6 +21,12 @@ class Language : public ALabel, public sigc::trackable { auto update() -> void; private: + enum class DispayedShortFlag { + None = 0, + ShortName = 1, + ShortDescription = 1 << 1 + }; + struct Layout { std::string full_name; std::string short_name; @@ -53,6 +59,7 @@ class Language : public ALabel, public sigc::trackable { std::string tooltip_format_ = ""; std::map layouts_map_; bool is_variant_displayed; + std::byte displayed_short_flag = static_cast(DispayedShortFlag::None); util::JsonParser parser_; std::mutex mutex_; diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index 0b56dad..c13c636 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -20,6 +20,12 @@ const std::string Language::XKB_ACTIVE_LAYOUT_NAME_KEY = "xkb_active_layout_name Language::Language(const std::string& id, const Json::Value& config) : ALabel(config, "language", id, "{}", 0, true) { is_variant_displayed = format_.find("{variant}") != std::string::npos; + if (format_.find("{}") != std::string::npos || format_.find("{short}") != std::string::npos) { + displayed_short_flag |= static_cast(DispayedShortFlag::ShortName); + } + if (format_.find("{shortDescription}") != std::string::npos) { + displayed_short_flag |= static_cast(DispayedShortFlag::ShortDescription); + } if (config.isMember("tooltip-format")) { tooltip_format_ = config["tooltip-format"].asString(); } @@ -155,9 +161,15 @@ auto Language::init_layouts_map(const std::vector& used_layouts) -> if (short_name_to_number_map.count(used_layout->short_name) == 0) { short_name_to_number_map[used_layout->short_name] = 1; } - - used_layout->short_name = - used_layout->short_name + std::to_string(short_name_to_number_map[used_layout->short_name]++); + + if (displayed_short_flag != static_cast(0)) { + int& number = short_name_to_number_map[used_layout->short_name]; + used_layout->short_name = + used_layout->short_name + std::to_string(number); + used_layout->short_description = + used_layout->short_description + std::to_string(number); + ++number; + } } } From 9ee701974fc23f82fd0f719ae4b2f2b50aca4f62 Mon Sep 17 00:00:00 2001 From: Gavin Beatty Date: Fri, 20 Aug 2021 10:06:35 -0500 Subject: [PATCH 263/303] Fix memory leak and data race - Delete previous Layout before creating next one, and in destructor - Use stack XKBContext instead of local new+delete - Lock mutex in update() as it is called from a different thread than onEvent(res) --- src/modules/sway/language.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index c13c636..85dc769 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -94,6 +94,7 @@ void Language::onEvent(const struct Ipc::ipc_response& res) { } auto Language::update() -> void { + std::lock_guard lock(mutex_); auto display_layout = trim(fmt::format(format_, fmt::arg("short", layout_.short_name), fmt::arg("shortDescription", layout_.short_description), @@ -125,9 +126,9 @@ auto Language::set_current_layout(std::string current_layout) -> void { auto Language::init_layouts_map(const std::vector& used_layouts) -> void { std::map> found_by_short_names; - XKBContext* xkb_context_ = new XKBContext(); - auto layout = xkb_context_->next_layout(); - for (; layout != nullptr; layout = xkb_context_->next_layout()) { + XKBContext xkb_context; + auto layout = xkb_context.next_layout(); + for (; layout != nullptr; layout = xkb_context.next_layout()) { if (std::find(used_layouts.begin(), used_layouts.end(), layout->full_name) == used_layouts.end()) { continue; @@ -144,7 +145,6 @@ auto Language::init_layouts_map(const std::vector& used_layouts) -> layouts_map_.emplace(layout->full_name, *layout); } - delete xkb_context_; if (is_variant_displayed || found_by_short_names.size() == 0) { return; @@ -203,10 +203,13 @@ auto Language::XKBContext::next_layout() -> Layout* { auto base_layout = base_layouts_by_name_[name]; short_description = base_layout == nullptr ? "" : std::string(rxkb_layout_get_brief(base_layout)); } - + delete layout_; layout_ = new Layout{description, name, variant, short_description}; return layout_; } -Language::XKBContext::~XKBContext() { rxkb_context_unref(context_); } +Language::XKBContext::~XKBContext() { + rxkb_context_unref(context_); + delete layout_; +} } // namespace waybar::modules::sway From cb49650ea48b457e0b5a4572d794bbc1a73bc33a Mon Sep 17 00:00:00 2001 From: Michael Swiger Date: Sun, 22 Aug 2021 14:46:40 -0700 Subject: [PATCH 264/303] Use g_memdup2 instead of g_memdup This fixes a compile warning. See: https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 --- src/modules/sni/item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 991ccc4..917a92a 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -287,7 +287,7 @@ Glib::RefPtr Item::extractPixBuf(GVariant* variant) { if (array != nullptr) { g_free(array); } - array = static_cast(g_memdup(data, size)); + array = static_cast(g_memdup2(data, size)); lwidth = width; lheight = height; } From 7b4b5e55a27ffbb748c63f2ebecab7d1629f7250 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Mon, 23 Aug 2021 07:30:07 +0200 Subject: [PATCH 265/303] support format-icon for cpu und memory --- man/waybar-cpu.5.scd | 5 +++++ man/waybar-memory.5.scd | 5 +++++ src/modules/cpu/common.cpp | 2 ++ src/modules/memory/common.cpp | 2 ++ 4 files changed, 14 insertions(+) diff --git a/man/waybar-cpu.5.scd b/man/waybar-cpu.5.scd index fbf6206..679ca2c 100644 --- a/man/waybar-cpu.5.scd +++ b/man/waybar-cpu.5.scd @@ -20,6 +20,11 @@ The *cpu* module displays the current cpu utilization. default: {usage}% ++ The format, how information should be displayed. On {} data gets inserted. +*format-icons*: ++ + typeof: array/object ++ + Based on the current usage, the corresponding icon gets selected. ++ + The order is *low* to *high*. Or by the state if it is an object. + *max-length*: ++ typeof: integer ++ The maximum length in character the module should display. diff --git a/man/waybar-memory.5.scd b/man/waybar-memory.5.scd index 3ff4c35..0639c07 100644 --- a/man/waybar-memory.5.scd +++ b/man/waybar-memory.5.scd @@ -22,6 +22,11 @@ Addressed by *memory* default: {percentage}% ++ The format, how information should be displayed. +*format-icons*: ++ + typeof: array/object ++ + Based on the current percentage, the corresponding icon gets selected. ++ + The order is *low* to *high*. Or by the state if it is an object. + *rotate*: ++ typeof: integer ++ Positive value to rotate the text label. diff --git a/src/modules/cpu/common.cpp b/src/modules/cpu/common.cpp index 2ca7421..767cde9 100644 --- a/src/modules/cpu/common.cpp +++ b/src/modules/cpu/common.cpp @@ -26,9 +26,11 @@ auto waybar::modules::Cpu::update() -> void { event_box_.hide(); } else { event_box_.show(); + auto icons = std::vector{state}; label_.set_markup(fmt::format(format, fmt::arg("load", cpu_load), fmt::arg("usage", cpu_usage), + fmt::arg("icon", getIcon(cpu_usage, icons)), fmt::arg("max_frequency", max_frequency), fmt::arg("min_frequency", min_frequency), fmt::arg("avg_frequency", avg_frequency))); diff --git a/src/modules/memory/common.cpp b/src/modules/memory/common.cpp index 09ce8e8..31219ed 100644 --- a/src/modules/memory/common.cpp +++ b/src/modules/memory/common.cpp @@ -38,8 +38,10 @@ auto waybar::modules::Memory::update() -> void { event_box_.hide(); } else { event_box_.show(); + auto icons = std::vector{state}; label_.set_markup(fmt::format(format, used_ram_percentage, + fmt::arg("icon", getIcon(used_ram_percentage, icons)), fmt::arg("total", total_ram_gigabytes), fmt::arg("percentage", used_ram_percentage), fmt::arg("used", used_ram_gigabytes), From e0260ac4fc05b533210e35ef9b016ea3838f845b Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Mon, 23 Aug 2021 08:02:08 +0200 Subject: [PATCH 266/303] rm travis-ci shield --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37c0cfc..98b99a2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Waybar [![Travis](https://travis-ci.org/Alexays/Waybar.svg?branch=master)](https://travis-ci.org/Alexays/Waybar) [![Licence](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Paypal Donate](https://img.shields.io/badge/Donate-Paypal-2244dd.svg)](https://paypal.me/ARouillard)
![Waybar](https://raw.githubusercontent.com/alexays/waybar/master/preview-2.png) +# Waybar [![Licence](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Paypal Donate](https://img.shields.io/badge/Donate-Paypal-2244dd.svg)](https://paypal.me/ARouillard)
![Waybar](https://raw.githubusercontent.com/alexays/waybar/master/preview-2.png) > Highly customizable Wayland bar for Sway and Wlroots based compositors.
> Available in Arch [community](https://www.archlinux.org/packages/community/x86_64/waybar/) or From 4f76c9bd43dd7ff8108ffe81c690fe3e6232ee6a Mon Sep 17 00:00:00 2001 From: Michael Swiger Date: Sun, 29 Aug 2021 13:11:04 -0700 Subject: [PATCH 267/303] Only use g_memdup2 for glib >= 2.68 --- src/modules/sni/item.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index 917a92a..d9748ed 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -287,7 +287,11 @@ Glib::RefPtr Item::extractPixBuf(GVariant* variant) { if (array != nullptr) { g_free(array); } +#if GLIB_MAJOR_VERSION >= 2 && GLIB_MINOR_VERSION >= 68 array = static_cast(g_memdup2(data, size)); +#else + array = static_cast(g_memdup(data, size)); +#endif lwidth = width; lheight = height; } From aacd0fcc652f36901632a252bd91e7f0c5f73cf1 Mon Sep 17 00:00:00 2001 From: Matan1x Date: Wed, 8 Sep 2021 17:12:30 +0300 Subject: [PATCH 268/303] round brightness --- src/modules/backlight.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/backlight.cpp b/src/modules/backlight.cpp index 3ebc6e7..fcd668c 100644 --- a/src/modules/backlight.cpp +++ b/src/modules/backlight.cpp @@ -173,7 +173,7 @@ auto waybar::modules::Backlight::update() -> void { return; } - const auto percent = best->get_max() == 0 ? 100 : best->get_actual() * 100 / best->get_max(); + const uint8_t percent = best->get_max() == 0 ? 100 : round(best->get_actual() * 100.0f / best->get_max()); label_.set_markup(fmt::format( format_, fmt::arg("percent", std::to_string(percent)), fmt::arg("icon", getIcon(percent)))); getState(percent); From 2c380a53caabfc831d832985becb95b69d202eed Mon Sep 17 00:00:00 2001 From: Rolf Vidar Mazunki Hoksaas Date: Thu, 9 Sep 2021 20:05:18 +0200 Subject: [PATCH 269/303] added support for the {gwaddr} variable --- Makefile | 3 +++ include/modules/network.hpp | 1 + man/waybar-network.5.scd | 2 ++ src/modules/network.cpp | 10 +++++++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d7182c1..ccf0507 100644 --- a/Makefile +++ b/Makefile @@ -16,5 +16,8 @@ install: build run: build ./build/waybar +debug-run: build + ./build/waybar --log-level debug + clean: rm -rf build diff --git a/include/modules/network.hpp b/include/modules/network.hpp index 009ae5a..ad28520 100644 --- a/include/modules/network.hpp +++ b/include/modules/network.hpp @@ -67,6 +67,7 @@ class Network : public ALabel { bool carrier_; std::string ifname_; std::string ipaddr_; + std::string gwaddr_; std::string netmask_; int cidr_; int32_t signal_strength_dbm_; diff --git a/man/waybar-network.5.scd b/man/waybar-network.5.scd index f274881..f8bdd65 100644 --- a/man/waybar-network.5.scd +++ b/man/waybar-network.5.scd @@ -131,6 +131,8 @@ Addressed by *network* *{ipaddr}*: The first IP of the interface. +*{gwaddr}*: The default gateway for the interface + *{netmask}*: The subnetmask corresponding to the IP. *{cidr}*: The subnetmask corresponding to the IP in CIDR notation. diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 7d0f638..a45f2b8 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -348,6 +348,7 @@ auto waybar::modules::Network::update() -> void { fmt::arg("ifname", ifname_), fmt::arg("netmask", netmask_), fmt::arg("ipaddr", ipaddr_), + fmt::arg("gwaddr", gwaddr_), fmt::arg("cidr", cidr_), fmt::arg("frequency", frequency_), fmt::arg("icon", getIcon(signal_strength_, state_)), @@ -376,6 +377,7 @@ auto waybar::modules::Network::update() -> void { fmt::arg("ifname", ifname_), fmt::arg("netmask", netmask_), fmt::arg("ipaddr", ipaddr_), + fmt::arg("gwaddr", gwaddr_), fmt::arg("cidr", cidr_), fmt::arg("frequency", frequency_), fmt::arg("icon", getIcon(signal_strength_, state_)), @@ -409,6 +411,7 @@ void waybar::modules::Network::clearIface() { ifname_.clear(); essid_.clear(); ipaddr_.clear(); + gwaddr_.clear(); netmask_.clear(); carrier_ = false; cidr_ = 0; @@ -581,6 +584,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { break; } + char temp_gw_addr[INET6_ADDRSTRLEN]; case RTM_DELROUTE: is_del_event = true; case RTM_NEWROUTE: { @@ -595,6 +599,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { int temp_idx = -1; uint32_t priority = 0; + /* Find the message(s) concerting the main routing table, each message * corresponds to a single routing table entry. */ @@ -612,9 +617,10 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { case RTA_GATEWAY: /* The gateway of the route. * - * If someone every needs to figure out the gateway address as well, + * If someone ever needs to figure out the gateway address as well, * it's here as the attribute payload. */ + inet_ntop(net->family_, RTA_DATA(attr), temp_gw_addr, sizeof(temp_gw_addr)); has_gateway = true; break; case RTA_DST: { @@ -655,6 +661,8 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->clearIface(); net->ifid_ = temp_idx; net->route_priority = priority; + net->gwaddr_ = temp_gw_addr; + spdlog::debug("netwok: gateway {}", net->gwaddr_); spdlog::debug("network: new default route via if{} metric {}", temp_idx, priority); From 95ecff05511f71fc542429059b843ecd369854ef Mon Sep 17 00:00:00 2001 From: Rolf Vidar Mazunki Hoksaas Date: Thu, 9 Sep 2021 20:12:20 +0200 Subject: [PATCH 270/303] added example tooltip usage --- resources/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/config b/resources/config index 87f24c0..b315721 100644 --- a/resources/config +++ b/resources/config @@ -117,7 +117,8 @@ "network": { // "interface": "wlp2*", // (Optional) To force the use of this interface "format-wifi": "{essid} ({signalStrength}%) ", - "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", "format-linked": "{ifname} (No IP) ", "format-disconnected": "Disconnected ⚠", "format-alt": "{ifname}: {ipaddr}/{cidr}" From b377520a38dd0a2aa68301039e9f649d98a94f5f Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 13 Aug 2021 06:08:27 -0700 Subject: [PATCH 271/303] refactor(client): extract config handling into a new class --- include/client.hpp | 14 +--- include/config.hpp | 31 +++++++++ meson.build | 1 + src/client.cpp | 148 +--------------------------------------- src/config.cpp | 166 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 204 insertions(+), 156 deletions(-) create mode 100644 include/config.hpp create mode 100644 src/config.cpp diff --git a/include/client.hpp b/include/client.hpp index e7fa1db..e68e4ad 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -3,11 +3,10 @@ #include #include #include -#include #include -#include #include "bar.hpp" +#include "config.hpp" struct zwlr_layer_shell_v1; struct zwp_idle_inhibitor_v1; @@ -32,15 +31,8 @@ class Client { private: Client() = default; - std::tuple getConfigs(const std::string &config, - const std::string &style) const; - void bindInterfaces(); - const std::string getValidPath(const std::vector &paths) const; + void bindInterfaces(); void handleOutput(struct waybar_output &output); - bool isValidOutput(const Json::Value &config, struct waybar_output &output); - auto setupConfig(const std::string &config_file, int depth) -> void; - auto resolveConfigIncludes(Json::Value &config, int depth) -> void; - auto mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void; auto setupCss(const std::string &css_file) -> void; struct waybar_output & getOutput(void *); std::vector getOutputConfigs(struct waybar_output &output); @@ -55,7 +47,7 @@ class Client { void handleMonitorRemoved(Glib::RefPtr monitor); void handleDeferredMonitorRemoval(Glib::RefPtr monitor); - Json::Value config_; + Config config_; Glib::RefPtr style_context_; Glib::RefPtr css_provider_; std::list outputs_; diff --git a/include/config.hpp b/include/config.hpp new file mode 100644 index 0000000..bb7b906 --- /dev/null +++ b/include/config.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include + +#include + +namespace waybar { + +class Config { + public: + Config() = default; + + void load(const std::string &config, const std::string &style); + + const std::string &getStyle() { return css_file_; } + + Json::Value &getConfig() { return config_; } + + std::vector getOutputConfigs(const std::string &name, const std::string &identifier); + + private: + void setupConfig(const std::string &config_file, int depth); + void resolveConfigIncludes(Json::Value &config, int depth); + void mergeConfig(Json::Value &a_config_, Json::Value &b_config_); + + std::string config_file_; + std::string css_file_; + + Json::Value config_; +}; +} // namespace waybar diff --git a/meson.build b/meson.build index 835b70e..641607d 100644 --- a/meson.build +++ b/meson.build @@ -149,6 +149,7 @@ src_files = files( 'src/main.cpp', 'src/bar.cpp', 'src/client.cpp', + 'src/config.cpp', 'src/util/ustring_clen.cpp' ) diff --git a/src/client.cpp b/src/client.cpp index ff6e7bf..b50faff 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -3,12 +3,10 @@ #include #include -#include #include #include "idle-inhibit-unstable-v1-client-protocol.h" #include "util/clara.hpp" -#include "util/json.hpp" #include "wlr-layer-shell-unstable-v1-client-protocol.h" waybar::Client *waybar::Client::inst() { @@ -16,23 +14,6 @@ waybar::Client *waybar::Client::inst() { return c; } -const std::string waybar::Client::getValidPath(const std::vector &paths) const { - wordexp_t p; - - for (const std::string &path : paths) { - if (wordexp(path.c_str(), &p, 0) == 0) { - if (access(*p.we_wordv, F_OK) == 0) { - std::string result = *p.we_wordv; - wordfree(&p); - return result; - } - wordfree(&p); - } - } - - return std::string(); -} - void waybar::Client::handleGlobal(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { auto client = static_cast(data); @@ -70,29 +51,6 @@ void waybar::Client::handleOutput(struct waybar_output &output) { zxdg_output_v1_add_listener(output.xdg_output.get(), &xdgOutputListener, &output); } -bool waybar::Client::isValidOutput(const Json::Value &config, struct waybar_output &output) { - if (config["output"].isArray()) { - for (auto const &output_conf : config["output"]) { - if (output_conf.isString() && - (output_conf.asString() == output.name || output_conf.asString() == output.identifier)) { - return true; - } - } - return false; - } else if (config["output"].isString()) { - auto config_output = config["output"].asString(); - if (!config_output.empty()) { - if (config_output.substr(0, 1) == "!") { - return config_output.substr(1) != output.name && - config_output.substr(1) != output.identifier; - } - return config_output == output.name || config_output == output.identifier; - } - } - - return true; -} - struct waybar::waybar_output &waybar::Client::getOutput(void *addr) { auto it = std::find_if( outputs_.begin(), outputs_.end(), [&addr](const auto &output) { return &output == addr; }); @@ -103,17 +61,7 @@ struct waybar::waybar_output &waybar::Client::getOutput(void *addr) { } std::vector waybar::Client::getOutputConfigs(struct waybar_output &output) { - std::vector configs; - if (config_.isArray()) { - for (auto const &config : config_) { - if (config.isObject() && isValidOutput(config, output)) { - configs.push_back(config); - } - } - } else if (isValidOutput(config_, output)) { - configs.push_back(config_); - } - return configs; + return config_.getOutputConfigs(output.name, output.identifier); } void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_output*/) { @@ -203,95 +151,6 @@ void waybar::Client::handleDeferredMonitorRemoval(Glib::RefPtr mon outputs_.remove_if([&monitor](const auto &output) { return output.monitor == monitor; }); } -std::tuple waybar::Client::getConfigs( - const std::string &config, const std::string &style) const { - auto config_file = config.empty() ? getValidPath({ - "$XDG_CONFIG_HOME/waybar/config", - "$XDG_CONFIG_HOME/waybar/config.jsonc", - "$HOME/.config/waybar/config", - "$HOME/.config/waybar/config.jsonc", - "$HOME/waybar/config", - "$HOME/waybar/config.jsonc", - "/etc/xdg/waybar/config", - "/etc/xdg/waybar/config.jsonc", - SYSCONFDIR "/xdg/waybar/config", - "./resources/config", - }) - : config; - auto css_file = style.empty() ? getValidPath({ - "$XDG_CONFIG_HOME/waybar/style.css", - "$HOME/.config/waybar/style.css", - "$HOME/waybar/style.css", - "/etc/xdg/waybar/style.css", - SYSCONFDIR "/xdg/waybar/style.css", - "./resources/style.css", - }) - : style; - if (css_file.empty() || config_file.empty()) { - throw std::runtime_error("Missing required resources files"); - } - spdlog::info("Resources files: {}, {}", config_file, css_file); - return {config_file, css_file}; -} - -auto waybar::Client::setupConfig(const std::string &config_file, int depth) -> void { - if (depth > 100) { - throw std::runtime_error("Aborting due to likely recursive include in config files"); - } - std::ifstream file(config_file); - if (!file.is_open()) { - throw std::runtime_error("Can't open config file"); - } - std::string str((std::istreambuf_iterator(file)), std::istreambuf_iterator()); - util::JsonParser parser; - Json::Value tmp_config_ = parser.parse(str); - if (tmp_config_.isArray()) { - for (auto &config_part : tmp_config_) { - resolveConfigIncludes(config_part, depth); - } - } else { - resolveConfigIncludes(tmp_config_, depth); - } - mergeConfig(config_, tmp_config_); -} - -auto waybar::Client::resolveConfigIncludes(Json::Value &config, int depth) -> void { - Json::Value includes = config["include"]; - if (includes.isArray()) { - for (const auto &include : includes) { - spdlog::info("Including resource file: {}", include.asString()); - setupConfig(getValidPath({include.asString()}), ++depth); - } - } else if (includes.isString()) { - spdlog::info("Including resource file: {}", includes.asString()); - setupConfig(getValidPath({includes.asString()}), ++depth); - } -} - -auto waybar::Client::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) -> void { - if (!a_config_) { - // For the first config - a_config_ = b_config_; - } else if (a_config_.isObject() && b_config_.isObject()) { - for (const auto &key : b_config_.getMemberNames()) { - if (a_config_[key].isObject() && b_config_[key].isObject()) { - mergeConfig(a_config_[key], b_config_[key]); - } else { - a_config_[key] = b_config_[key]; - } - } - } else if (a_config_.isArray() && b_config_.isArray()) { - // This can happen only on the top-level array of a multi-bar config - for (Json::Value::ArrayIndex i = 0; i < b_config_.size(); i++) { - if (a_config_[i].isObject() && b_config_[i].isObject()) { - mergeConfig(a_config_[i], b_config_[i]); - } - } - } else { - spdlog::error("Cannot merge config, conflicting or invalid JSON types"); - } -} - auto waybar::Client::setupCss(const std::string &css_file) -> void { css_provider_ = Gtk::CssProvider::create(); style_context_ = Gtk::StyleContext::create(); @@ -367,9 +226,8 @@ int waybar::Client::main(int argc, char *argv[]) { throw std::runtime_error("Bar need to run under Wayland"); } wl_display = gdk_wayland_display_get_wl_display(gdk_display->gobj()); - auto [config_file, css_file] = getConfigs(config, style); - setupConfig(config_file, 0); - setupCss(css_file); + config_.load(config, style); + setupCss(config_.getStyle()); bindInterfaces(); gtk_app->hold(); gtk_app->run(); diff --git a/src/config.cpp b/src/config.cpp new file mode 100644 index 0000000..6c7fa17 --- /dev/null +++ b/src/config.cpp @@ -0,0 +1,166 @@ +#include "config.hpp" + +#include +#include +#include + +#include +#include + +#include "util/json.hpp" + +#ifndef SYSCONFDIR +#define SYSCONFDIR "/etc" +#endif + +namespace waybar { + +const std::string getValidPath(const std::vector &paths) { + wordexp_t p; + + for (const std::string &path : paths) { + if (wordexp(path.c_str(), &p, 0) == 0) { + if (access(*p.we_wordv, F_OK) == 0) { + std::string result = *p.we_wordv; + wordfree(&p); + return result; + } + wordfree(&p); + } + } + + return std::string(); +} + +std::tuple getConfigs(const std::string &config, + const std::string &style) { + auto config_file = config.empty() ? getValidPath({ + "$XDG_CONFIG_HOME/waybar/config", + "$XDG_CONFIG_HOME/waybar/config.jsonc", + "$HOME/.config/waybar/config", + "$HOME/.config/waybar/config.jsonc", + "$HOME/waybar/config", + "$HOME/waybar/config.jsonc", + "/etc/xdg/waybar/config", + "/etc/xdg/waybar/config.jsonc", + SYSCONFDIR "/xdg/waybar/config", + "./resources/config", + }) + : config; + auto css_file = style.empty() ? getValidPath({ + "$XDG_CONFIG_HOME/waybar/style.css", + "$HOME/.config/waybar/style.css", + "$HOME/waybar/style.css", + "/etc/xdg/waybar/style.css", + SYSCONFDIR "/xdg/waybar/style.css", + "./resources/style.css", + }) + : style; + if (css_file.empty() || config_file.empty()) { + throw std::runtime_error("Missing required resources files"); + } + spdlog::info("Resources files: {}, {}", config_file, css_file); + return {config_file, css_file}; +} + +void Config::setupConfig(const std::string &config_file, int depth) { + if (depth > 100) { + throw std::runtime_error("Aborting due to likely recursive include in config files"); + } + std::ifstream file(config_file); + if (!file.is_open()) { + throw std::runtime_error("Can't open config file"); + } + std::string str((std::istreambuf_iterator(file)), std::istreambuf_iterator()); + util::JsonParser parser; + Json::Value tmp_config = parser.parse(str); + if (tmp_config.isArray()) { + for (auto &config_part : tmp_config) { + resolveConfigIncludes(config_part, depth); + } + } else { + resolveConfigIncludes(tmp_config, depth); + } + mergeConfig(config_, tmp_config); +} + +void Config::resolveConfigIncludes(Json::Value &config, int depth) { + Json::Value includes = config["include"]; + if (includes.isArray()) { + for (const auto &include : includes) { + spdlog::info("Including resource file: {}", include.asString()); + setupConfig(getValidPath({include.asString()}), ++depth); + } + } else if (includes.isString()) { + spdlog::info("Including resource file: {}", includes.asString()); + setupConfig(getValidPath({includes.asString()}), ++depth); + } +} + +void Config::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) { + if (!a_config_) { + // For the first config + a_config_ = b_config_; + } else if (a_config_.isObject() && b_config_.isObject()) { + for (const auto &key : b_config_.getMemberNames()) { + if (a_config_[key].isObject() && b_config_[key].isObject()) { + mergeConfig(a_config_[key], b_config_[key]); + } else { + a_config_[key] = b_config_[key]; + } + } + } else if (a_config_.isArray() && b_config_.isArray()) { + // This can happen only on the top-level array of a multi-bar config + for (Json::Value::ArrayIndex i = 0; i < b_config_.size(); i++) { + if (a_config_[i].isObject() && b_config_[i].isObject()) { + mergeConfig(a_config_[i], b_config_[i]); + } + } + } else { + spdlog::error("Cannot merge config, conflicting or invalid JSON types"); + } +} +bool isValidOutput(const Json::Value &config, const std::string &name, + const std::string &identifier) { + if (config["output"].isArray()) { + for (auto const &output_conf : config["output"]) { + if (output_conf.isString() && + (output_conf.asString() == name || output_conf.asString() == identifier)) { + return true; + } + } + return false; + } else if (config["output"].isString()) { + auto config_output = config["output"].asString(); + if (!config_output.empty()) { + if (config_output.substr(0, 1) == "!") { + return config_output.substr(1) != name && config_output.substr(1) != identifier; + } + return config_output == name || config_output == identifier; + } + } + + return true; +} + +void Config::load(const std::string &config, const std::string &style) { + std::tie(config_file_, css_file_) = getConfigs(config, style); + setupConfig(config_file_, 0); +} + +std::vector Config::getOutputConfigs(const std::string &name, + const std::string &identifier) { + std::vector configs; + if (config_.isArray()) { + for (auto const &config : config_) { + if (config.isObject() && isValidOutput(config, name, identifier)) { + configs.push_back(config); + } + } + } else if (isValidOutput(config_, name, identifier)) { + configs.push_back(config_); + } + return configs; +} + +} // namespace waybar From 4fff2eaaa0851c559fabd5b04ef08de8b9604fe1 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 15 Sep 2021 21:24:45 +0700 Subject: [PATCH 272/303] refactor(client): change config visibility to public --- include/client.hpp | 2 +- src/client.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index e68e4ad..1124cbb 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -28,6 +28,7 @@ class Client { struct zxdg_output_manager_v1 * xdg_output_manager = nullptr; struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr; std::vector> bars; + Config config; private: Client() = default; @@ -47,7 +48,6 @@ class Client { void handleMonitorRemoved(Glib::RefPtr monitor); void handleDeferredMonitorRemoval(Glib::RefPtr monitor); - Config config_; Glib::RefPtr style_context_; Glib::RefPtr css_provider_; std::list outputs_; diff --git a/src/client.cpp b/src/client.cpp index b50faff..0764883 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -61,7 +61,7 @@ struct waybar::waybar_output &waybar::Client::getOutput(void *addr) { } std::vector waybar::Client::getOutputConfigs(struct waybar_output &output) { - return config_.getOutputConfigs(output.name, output.identifier); + return config.getOutputConfigs(output.name, output.identifier); } void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_output*/) { @@ -188,14 +188,14 @@ void waybar::Client::bindInterfaces() { int waybar::Client::main(int argc, char *argv[]) { bool show_help = false; bool show_version = false; - std::string config; - std::string style; + std::string config_opt; + std::string style_opt; std::string bar_id; std::string log_level; auto cli = clara::detail::Help(show_help) | clara::detail::Opt(show_version)["-v"]["--version"]("Show version") | - clara::detail::Opt(config, "config")["-c"]["--config"]("Config path") | - clara::detail::Opt(style, "style")["-s"]["--style"]("Style path") | + clara::detail::Opt(config_opt, "config")["-c"]["--config"]("Config path") | + clara::detail::Opt(style_opt, "style")["-s"]["--style"]("Style path") | clara::detail::Opt( log_level, "trace|debug|info|warning|error|critical|off")["-l"]["--log-level"]("Log level") | @@ -226,8 +226,8 @@ int waybar::Client::main(int argc, char *argv[]) { throw std::runtime_error("Bar need to run under Wayland"); } wl_display = gdk_wayland_display_get_wl_display(gdk_display->gobj()); - config_.load(config, style); - setupCss(config_.getStyle()); + config.load(config_opt, style_opt); + setupCss(config.getStyle()); bindInterfaces(); gtk_app->hold(); gtk_app->run(); From 1f7d399b8edd3ea76612e674ee1b3fb1a365e483 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 13 Aug 2021 07:19:47 -0700 Subject: [PATCH 273/303] refactor(config): remove style handling from Config --- include/client.hpp | 1 + include/config.hpp | 16 ++++++--- src/client.cpp | 14 ++++++-- src/config.cpp | 84 ++++++++++++++++++++++------------------------ 4 files changed, 66 insertions(+), 49 deletions(-) diff --git a/include/client.hpp b/include/client.hpp index 1124cbb..bd80d0b 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -32,6 +32,7 @@ class Client { private: Client() = default; + const std::string getStyle(const std::string &style); void bindInterfaces(); void handleOutput(struct waybar_output &output); auto setupCss(const std::string &css_file) -> void; diff --git a/include/config.hpp b/include/config.hpp index bb7b906..25b78ab 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -2,17 +2,26 @@ #include +#include #include +#ifndef SYSCONFDIR +#define SYSCONFDIR "/etc" +#endif + namespace waybar { class Config { public: + static const std::vector CONFIG_DIRS; + + /* Try to find any of provided names in the supported set of config directories */ + static std::optional findConfigPath( + const std::vector &names, const std::vector &dirs = CONFIG_DIRS); + Config() = default; - void load(const std::string &config, const std::string &style); - - const std::string &getStyle() { return css_file_; } + void load(const std::string &config); Json::Value &getConfig() { return config_; } @@ -24,7 +33,6 @@ class Config { void mergeConfig(Json::Value &a_config_, Json::Value &b_config_); std::string config_file_; - std::string css_file_; Json::Value config_; }; diff --git a/src/client.cpp b/src/client.cpp index 0764883..95f5a29 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -151,6 +151,15 @@ void waybar::Client::handleDeferredMonitorRemoval(Glib::RefPtr mon outputs_.remove_if([&monitor](const auto &output) { return output.monitor == monitor; }); } +const std::string waybar::Client::getStyle(const std::string &style) { + auto css_file = style.empty() ? Config::findConfigPath({"style.css"}) : style; + if (!css_file) { + throw std::runtime_error("Missing required resource files"); + } + spdlog::info("Using CSS file {}", css_file.value()); + return css_file.value(); +}; + auto waybar::Client::setupCss(const std::string &css_file) -> void { css_provider_ = Gtk::CssProvider::create(); style_context_ = Gtk::StyleContext::create(); @@ -226,8 +235,9 @@ int waybar::Client::main(int argc, char *argv[]) { throw std::runtime_error("Bar need to run under Wayland"); } wl_display = gdk_wayland_display_get_wl_display(gdk_display->gobj()); - config.load(config_opt, style_opt); - setupCss(config.getStyle()); + config.load(config_opt); + auto css_file = getStyle(style_opt); + setupCss(css_file); bindInterfaces(); gtk_app->hold(); gtk_app->run(); diff --git a/src/config.cpp b/src/config.cpp index 6c7fa17..ed7168d 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -9,58 +9,51 @@ #include "util/json.hpp" -#ifndef SYSCONFDIR -#define SYSCONFDIR "/etc" -#endif - namespace waybar { -const std::string getValidPath(const std::vector &paths) { - wordexp_t p; +const std::vector Config::CONFIG_DIRS = { + "$XDG_CONFIG_HOME/waybar/", + "$HOME/.config/waybar/", + "$HOME/waybar/", + "/etc/xdg/waybar/", + SYSCONFDIR "/xdg/waybar/", + "./resources/", +}; - for (const std::string &path : paths) { - if (wordexp(path.c_str(), &p, 0) == 0) { - if (access(*p.we_wordv, F_OK) == 0) { - std::string result = *p.we_wordv; - wordfree(&p); - return result; - } +std::optional tryExpandPath(const std::string &path) { + wordexp_t p; + if (wordexp(path.c_str(), &p, 0) == 0) { + if (access(*p.we_wordv, F_OK) == 0) { + std::string result = *p.we_wordv; wordfree(&p); + return result; + } + wordfree(&p); + } + return std::nullopt; +} + +const std::string getValidPath(const std::vector &paths) { + for (const std::string &path : paths) { + if (auto res = tryExpandPath(path); res) { + return res.value(); } } return std::string(); } -std::tuple getConfigs(const std::string &config, - const std::string &style) { - auto config_file = config.empty() ? getValidPath({ - "$XDG_CONFIG_HOME/waybar/config", - "$XDG_CONFIG_HOME/waybar/config.jsonc", - "$HOME/.config/waybar/config", - "$HOME/.config/waybar/config.jsonc", - "$HOME/waybar/config", - "$HOME/waybar/config.jsonc", - "/etc/xdg/waybar/config", - "/etc/xdg/waybar/config.jsonc", - SYSCONFDIR "/xdg/waybar/config", - "./resources/config", - }) - : config; - auto css_file = style.empty() ? getValidPath({ - "$XDG_CONFIG_HOME/waybar/style.css", - "$HOME/.config/waybar/style.css", - "$HOME/waybar/style.css", - "/etc/xdg/waybar/style.css", - SYSCONFDIR "/xdg/waybar/style.css", - "./resources/style.css", - }) - : style; - if (css_file.empty() || config_file.empty()) { - throw std::runtime_error("Missing required resources files"); +std::optional Config::findConfigPath(const std::vector &names, + const std::vector &dirs) { + std::vector paths; + for (const auto &dir : dirs) { + for (const auto &name : names) { + if (auto res = tryExpandPath(dir + name); res) { + return res; + } + } } - spdlog::info("Resources files: {}, {}", config_file, css_file); - return {config_file, css_file}; + return std::nullopt; } void Config::setupConfig(const std::string &config_file, int depth) { @@ -143,8 +136,13 @@ bool isValidOutput(const Json::Value &config, const std::string &name, return true; } -void Config::load(const std::string &config, const std::string &style) { - std::tie(config_file_, css_file_) = getConfigs(config, style); +void Config::load(const std::string &config) { + auto file = config.empty() ? findConfigPath({"config", "config.jsonc"}) : config; + if (!file) { + throw std::runtime_error("Missing required resource files"); + } + config_file_ = file.value(); + spdlog::info("Using configuration file {}", config_file_); setupConfig(config_file_, 0); } From 1f16d7955d7832e2fcdc3317d42034ac0c772dac Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 13 Aug 2021 08:19:12 -0700 Subject: [PATCH 274/303] refactor(config): drop getValidPath --- src/config.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index ed7168d..207e1bd 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -33,16 +33,6 @@ std::optional tryExpandPath(const std::string &path) { return std::nullopt; } -const std::string getValidPath(const std::vector &paths) { - for (const std::string &path : paths) { - if (auto res = tryExpandPath(path); res) { - return res.value(); - } - } - - return std::string(); -} - std::optional Config::findConfigPath(const std::vector &names, const std::vector &dirs) { std::vector paths; @@ -82,11 +72,11 @@ void Config::resolveConfigIncludes(Json::Value &config, int depth) { if (includes.isArray()) { for (const auto &include : includes) { spdlog::info("Including resource file: {}", include.asString()); - setupConfig(getValidPath({include.asString()}), ++depth); + setupConfig(tryExpandPath(include.asString()).value_or(""), ++depth); } } else if (includes.isString()) { spdlog::info("Including resource file: {}", includes.asString()); - setupConfig(getValidPath({includes.asString()}), ++depth); + setupConfig(tryExpandPath(includes.asString()).value_or(""), ++depth); } } From 6eba62f0600379f9d594dea1fa5c41024f55fe8e Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 13 Aug 2021 18:33:24 -0700 Subject: [PATCH 275/303] test: add build configs for catch2 --- meson.build | 9 +++++++++ meson_options.txt | 1 + subprojects/catch2.wrap | 12 ++++++++++++ test/config.cpp | 4 ++++ test/meson.build | 21 +++++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 subprojects/catch2.wrap create mode 100644 test/config.cpp create mode 100644 test/meson.build diff --git a/meson.build b/meson.build index 641607d..c09fbb6 100644 --- a/meson.build +++ b/meson.build @@ -360,6 +360,15 @@ if scdoc.found() endforeach endif +catch2 = dependency( + 'catch2', + fallback: ['catch2', 'catch2_dep'], + required: get_option('tests'), +) +if catch2.found() + subdir('test') +endif + clangtidy = find_program('clang-tidy', required: false) if clangtidy.found() diff --git a/meson_options.txt b/meson_options.txt index fefb3dc..81e4468 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,3 +10,4 @@ option('mpd', type: 'feature', value: 'auto', description: 'Enable support for t option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk-layer-shell library for popups support') option('rfkill', type: 'feature', value: 'auto', description: 'Enable support for RFKILL') option('sndio', type: 'feature', value: 'auto', description: 'Enable support for sndio') +option('tests', type: 'feature', value: 'auto', description: 'Enable tests') diff --git a/subprojects/catch2.wrap b/subprojects/catch2.wrap new file mode 100644 index 0000000..356c406 --- /dev/null +++ b/subprojects/catch2.wrap @@ -0,0 +1,12 @@ +[wrap-file] +directory = Catch2-2.13.3 +source_url = https://github.com/catchorg/Catch2/archive/v2.13.3.zip +source_filename = Catch2-2.13.3.zip +source_hash = 1804feb72bc15c0856b4a43aa586c661af9c3685a75973b6a8fc0b950c7cfd13 +patch_url = https://github.com/mesonbuild/catch2/releases/download/2.13.3-2/catch2.zip +patch_filename = catch2-2.13.3-2-wrap.zip +patch_hash = 21b590ab8c65b593ad5ee8f8e5b822bf9877b2c2672f97fbb52459751053eadf + +[provide] +catch2 = catch2_dep + diff --git a/test/config.cpp b/test/config.cpp new file mode 100644 index 0000000..41180bb --- /dev/null +++ b/test/config.cpp @@ -0,0 +1,4 @@ +#define CATCH_CONFIG_MAIN +#include "config.hpp" + +#include diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000..85b9771 --- /dev/null +++ b/test/meson.build @@ -0,0 +1,21 @@ +test_inc = include_directories('../include') +test_dep = [ + catch2, + fmt, + jsoncpp, + spdlog, +] + +config_test = executable( + 'config_test', + 'config.cpp', + '../src/config.cpp', + dependencies: test_dep, + include_directories: test_inc, +) + +test( + 'Configuration test', + config_test, + workdir: meson.source_root(), +) From 9f3b34e4d9c47eae5c3a7179e70952d5c6ba3f61 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 13 Aug 2021 18:50:36 -0700 Subject: [PATCH 276/303] test: validate configuration load --- test/config.cpp | 74 ++++++++++++++++++++++++++++++++++++++ test/config/include-1.json | 6 ++++ test/config/include-2.json | 3 ++ test/config/include.json | 4 +++ test/config/multi.json | 25 +++++++++++++ test/config/simple.json | 5 +++ 6 files changed, 117 insertions(+) create mode 100644 test/config/include-1.json create mode 100644 test/config/include-2.json create mode 100644 test/config/include.json create mode 100644 test/config/multi.json create mode 100644 test/config/simple.json diff --git a/test/config.cpp b/test/config.cpp index 41180bb..78ea0e1 100644 --- a/test/config.cpp +++ b/test/config.cpp @@ -2,3 +2,77 @@ #include "config.hpp" #include + +TEST_CASE("Load simple config", "[config]") { + waybar::Config conf; + conf.load("test/config/simple.json"); + + SECTION("validate the config data") { + auto& data = conf.getConfig(); + REQUIRE(data["layer"].asString() == "top"); + REQUIRE(data["height"].asInt() == 30); + } + SECTION("select configs for configured output") { + auto configs = conf.getOutputConfigs("HDMI-0", "Fake HDMI output #0"); + REQUIRE(configs.size() == 1); + } + SECTION("select configs for missing output") { + auto configs = conf.getOutputConfigs("HDMI-1", "Fake HDMI output #1"); + REQUIRE(configs.empty()); + } +} + +TEST_CASE("Load config with multiple bars", "[config]") { + waybar::Config conf; + conf.load("test/config/multi.json"); + + SECTION("select multiple configs #1") { + auto data = conf.getOutputConfigs("DP-0", "Fake DisplayPort output #0"); + REQUIRE(data.size() == 3); + REQUIRE(data[0]["layer"].asString() == "bottom"); + REQUIRE(data[0]["height"].asInt() == 20); + REQUIRE(data[1]["layer"].asString() == "top"); + REQUIRE(data[1]["position"].asString() == "bottom"); + REQUIRE(data[1]["height"].asInt() == 21); + REQUIRE(data[2]["layer"].asString() == "overlay"); + REQUIRE(data[2]["position"].asString() == "right"); + REQUIRE(data[2]["height"].asInt() == 23); + } + SECTION("select multiple configs #2") { + auto data = conf.getOutputConfigs("HDMI-0", "Fake HDMI output #0"); + REQUIRE(data.size() == 2); + REQUIRE(data[0]["layer"].asString() == "bottom"); + REQUIRE(data[0]["height"].asInt() == 20); + REQUIRE(data[1]["layer"].asString() == "overlay"); + REQUIRE(data[1]["position"].asString() == "right"); + REQUIRE(data[1]["height"].asInt() == 23); + } + SECTION("select single config by output description") { + auto data = conf.getOutputConfigs("HDMI-1", "Fake HDMI output #1"); + REQUIRE(data.size() == 1); + REQUIRE(data[0]["layer"].asString() == "overlay"); + REQUIRE(data[0]["position"].asString() == "left"); + REQUIRE(data[0]["height"].asInt() == 22); + } +} + +TEST_CASE("Load simple config with include", "[config]") { + waybar::Config conf; + conf.load("test/config/include.json"); + + SECTION("validate the config data") { + auto& data = conf.getConfig(); + REQUIRE(data["layer"].asString() == "bottom"); + REQUIRE(data["height"].asInt() == 30); + // config override behavior: preserve value from the top config + REQUIRE(data["position"].asString() == "top"); + } + SECTION("select configs for configured output") { + auto configs = conf.getOutputConfigs("HDMI-0", "Fake HDMI output #0"); + REQUIRE(configs.size() == 1); + } + SECTION("select configs for missing output") { + auto configs = conf.getOutputConfigs("HDMI-1", "Fake HDMI output #1"); + REQUIRE(configs.empty()); + } +} diff --git a/test/config/include-1.json b/test/config/include-1.json new file mode 100644 index 0000000..853111c --- /dev/null +++ b/test/config/include-1.json @@ -0,0 +1,6 @@ +{ + "layer": "top", + "position": "bottom", + "height": 30, + "output": ["HDMI-0", "DP-0"] +} diff --git a/test/config/include-2.json b/test/config/include-2.json new file mode 100644 index 0000000..741194f --- /dev/null +++ b/test/config/include-2.json @@ -0,0 +1,3 @@ +{ + "layer": "bottom" +} diff --git a/test/config/include.json b/test/config/include.json new file mode 100644 index 0000000..098cae0 --- /dev/null +++ b/test/config/include.json @@ -0,0 +1,4 @@ +{ + "include": ["test/config/include-1.json", "test/config/include-2.json"], + "position": "top" +} diff --git a/test/config/multi.json b/test/config/multi.json new file mode 100644 index 0000000..ed43a39 --- /dev/null +++ b/test/config/multi.json @@ -0,0 +1,25 @@ +[ + { + "layer": "bottom", + "height": 20, + "output": ["HDMI-0", "DP-0"] + }, + { + "position": "bottom", + "layer": "top", + "height": 21, + "output": ["DP-0"] + }, + { + "position": "left", + "layer": "overlay", + "height": 22, + "output": "Fake HDMI output #1" + }, + { + "position": "right", + "layer": "overlay", + "height": 23, + "output": "!HDMI-1" + } +] diff --git a/test/config/simple.json b/test/config/simple.json new file mode 100644 index 0000000..1cb1e3a --- /dev/null +++ b/test/config/simple.json @@ -0,0 +1,5 @@ +{ + "layer": "top", + "height": 30, + "output": ["HDMI-0", "DP-0"] +} From 8912bd3ed0734aeaf4db961e1cfab28a42ac4cb2 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 16 Aug 2021 21:11:46 +0700 Subject: [PATCH 277/303] test: multi-bar config with includes --- test/config.cpp | 34 ++++++++++++++++++++++++++++++ test/config/include-multi-0.json | 9 ++++++++ test/config/include-multi-1.json | 8 +++++++ test/config/include-multi-2.json | 9 ++++++++ test/config/include-multi-3-0.json | 8 +++++++ test/config/include-multi-3.json | 9 ++++++++ test/config/include-multi.json | 16 ++++++++++++++ 7 files changed, 93 insertions(+) create mode 100644 test/config/include-multi-0.json create mode 100644 test/config/include-multi-1.json create mode 100644 test/config/include-multi-2.json create mode 100644 test/config/include-multi-3-0.json create mode 100644 test/config/include-multi-3.json create mode 100644 test/config/include-multi.json diff --git a/test/config.cpp b/test/config.cpp index 78ea0e1..0dc0b42 100644 --- a/test/config.cpp +++ b/test/config.cpp @@ -76,3 +76,37 @@ TEST_CASE("Load simple config with include", "[config]") { REQUIRE(configs.empty()); } } + +TEST_CASE("Load multiple bar config with include", "[config]") { + waybar::Config conf; + conf.load("test/config/include-multi.json"); + + SECTION("bar config with sole include") { + auto data = conf.getOutputConfigs("OUT-0", "Fake ouptut #0"); + REQUIRE(data.size() == 1); + REQUIRE(data[0]["height"].asInt() == 20); + } + + SECTION("bar config with output and include") { + auto data = conf.getOutputConfigs("OUT-1", "Fake output #1"); + REQUIRE(data.size() == 1); + REQUIRE(data[0]["height"].asInt() == 21); + } + + SECTION("bar config with output override") { + auto data = conf.getOutputConfigs("OUT-2", "Fake output #2"); + REQUIRE(data.size() == 1); + REQUIRE(data[0]["height"].asInt() == 22); + } + + SECTION("multiple levels of include") { + auto data = conf.getOutputConfigs("OUT-3", "Fake output #3"); + REQUIRE(data.size() == 1); + REQUIRE(data[0]["height"].asInt() == 23); + } + + auto& data = conf.getConfig(); + REQUIRE(data.isArray()); + REQUIRE(data.size() == 4); + REQUIRE(data[0]["output"].asString() == "OUT-0"); +} diff --git a/test/config/include-multi-0.json b/test/config/include-multi-0.json new file mode 100644 index 0000000..87b6cab --- /dev/null +++ b/test/config/include-multi-0.json @@ -0,0 +1,9 @@ +[ + { + "output": "OUT-0", + "height": 20 + }, + {}, + {}, + {} +] diff --git a/test/config/include-multi-1.json b/test/config/include-multi-1.json new file mode 100644 index 0000000..d816a0f --- /dev/null +++ b/test/config/include-multi-1.json @@ -0,0 +1,8 @@ +[ + {}, + { + "height": 21 + }, + {}, + {} +] diff --git a/test/config/include-multi-2.json b/test/config/include-multi-2.json new file mode 100644 index 0000000..47616ef --- /dev/null +++ b/test/config/include-multi-2.json @@ -0,0 +1,9 @@ +[ + {}, + {}, + { + "output": "OUT-1", + "height": 22 + }, + {} +] diff --git a/test/config/include-multi-3-0.json b/test/config/include-multi-3-0.json new file mode 100644 index 0000000..3f4da0c --- /dev/null +++ b/test/config/include-multi-3-0.json @@ -0,0 +1,8 @@ +[ + {}, + {}, + {}, + { + "height": 23 + } +] diff --git a/test/config/include-multi-3.json b/test/config/include-multi-3.json new file mode 100644 index 0000000..d095189 --- /dev/null +++ b/test/config/include-multi-3.json @@ -0,0 +1,9 @@ +[ + {}, + {}, + {}, + { + "output": "OUT-3", + "include": "test/config/include-multi-3-0.json" + } +] diff --git a/test/config/include-multi.json b/test/config/include-multi.json new file mode 100644 index 0000000..e128aba --- /dev/null +++ b/test/config/include-multi.json @@ -0,0 +1,16 @@ +[ + { + "include": "test/config/include-multi-0.json" + }, + { + "output": "OUT-1", + "include": "test/config/include-multi-1.json" + }, + { + "output": "OUT-2", + "include": "test/config/include-multi-2.json" + }, + { + "include": "test/config/include-multi-3.json" + } +] From ccc60b42459b29fed266759bd668b697636d5253 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 14 Sep 2021 12:16:37 +0700 Subject: [PATCH 278/303] refactor(config): more sensible multi-bar include behavior --- include/config.hpp | 2 +- src/config.cpp | 20 +++++++------------- test/config.cpp | 3 ++- test/config/include-multi-0.json | 13 ++++--------- test/config/include-multi-1.json | 11 +++-------- test/config/include-multi-2.json | 13 ++++--------- test/config/include-multi-3-0.json | 11 +++-------- test/config/include-multi-3.json | 13 ++++--------- 8 files changed, 28 insertions(+), 58 deletions(-) diff --git a/include/config.hpp b/include/config.hpp index 25b78ab..82d5599 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -28,7 +28,7 @@ class Config { std::vector getOutputConfigs(const std::string &name, const std::string &identifier); private: - void setupConfig(const std::string &config_file, int depth); + void setupConfig(Json::Value &dst, const std::string &config_file, int depth); void resolveConfigIncludes(Json::Value &config, int depth); void mergeConfig(Json::Value &a_config_, Json::Value &b_config_); diff --git a/src/config.cpp b/src/config.cpp index 207e1bd..63f18c2 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -46,7 +46,7 @@ std::optional Config::findConfigPath(const std::vector return std::nullopt; } -void Config::setupConfig(const std::string &config_file, int depth) { +void Config::setupConfig(Json::Value &dst, const std::string &config_file, int depth) { if (depth > 100) { throw std::runtime_error("Aborting due to likely recursive include in config files"); } @@ -64,7 +64,7 @@ void Config::setupConfig(const std::string &config_file, int depth) { } else { resolveConfigIncludes(tmp_config, depth); } - mergeConfig(config_, tmp_config); + mergeConfig(dst, tmp_config); } void Config::resolveConfigIncludes(Json::Value &config, int depth) { @@ -72,11 +72,11 @@ void Config::resolveConfigIncludes(Json::Value &config, int depth) { if (includes.isArray()) { for (const auto &include : includes) { spdlog::info("Including resource file: {}", include.asString()); - setupConfig(tryExpandPath(include.asString()).value_or(""), ++depth); + setupConfig(config, tryExpandPath(include.asString()).value_or(""), ++depth); } } else if (includes.isString()) { spdlog::info("Including resource file: {}", includes.asString()); - setupConfig(tryExpandPath(includes.asString()).value_or(""), ++depth); + setupConfig(config, tryExpandPath(includes.asString()).value_or(""), ++depth); } } @@ -88,17 +88,11 @@ void Config::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) { for (const auto &key : b_config_.getMemberNames()) { if (a_config_[key].isObject() && b_config_[key].isObject()) { mergeConfig(a_config_[key], b_config_[key]); - } else { + } else if (a_config_[key].isNull()) { + // do not allow overriding value set by top or previously included config a_config_[key] = b_config_[key]; } } - } else if (a_config_.isArray() && b_config_.isArray()) { - // This can happen only on the top-level array of a multi-bar config - for (Json::Value::ArrayIndex i = 0; i < b_config_.size(); i++) { - if (a_config_[i].isObject() && b_config_[i].isObject()) { - mergeConfig(a_config_[i], b_config_[i]); - } - } } else { spdlog::error("Cannot merge config, conflicting or invalid JSON types"); } @@ -133,7 +127,7 @@ void Config::load(const std::string &config) { } config_file_ = file.value(); spdlog::info("Using configuration file {}", config_file_); - setupConfig(config_file_, 0); + setupConfig(config_, config_file_, 0); } std::vector Config::getOutputConfigs(const std::string &name, diff --git a/test/config.cpp b/test/config.cpp index 0dc0b42..343a1c1 100644 --- a/test/config.cpp +++ b/test/config.cpp @@ -62,7 +62,8 @@ TEST_CASE("Load simple config with include", "[config]") { SECTION("validate the config data") { auto& data = conf.getConfig(); - REQUIRE(data["layer"].asString() == "bottom"); + // config override behavior: preserve first included value + REQUIRE(data["layer"].asString() == "top"); REQUIRE(data["height"].asInt() == 30); // config override behavior: preserve value from the top config REQUIRE(data["position"].asString() == "top"); diff --git a/test/config/include-multi-0.json b/test/config/include-multi-0.json index 87b6cab..a4c3fc1 100644 --- a/test/config/include-multi-0.json +++ b/test/config/include-multi-0.json @@ -1,9 +1,4 @@ -[ - { - "output": "OUT-0", - "height": 20 - }, - {}, - {}, - {} -] +{ + "output": "OUT-0", + "height": 20 +} diff --git a/test/config/include-multi-1.json b/test/config/include-multi-1.json index d816a0f..2b28d6c 100644 --- a/test/config/include-multi-1.json +++ b/test/config/include-multi-1.json @@ -1,8 +1,3 @@ -[ - {}, - { - "height": 21 - }, - {}, - {} -] +{ + "height": 21 +} diff --git a/test/config/include-multi-2.json b/test/config/include-multi-2.json index 47616ef..f74c2b4 100644 --- a/test/config/include-multi-2.json +++ b/test/config/include-multi-2.json @@ -1,9 +1,4 @@ -[ - {}, - {}, - { - "output": "OUT-1", - "height": 22 - }, - {} -] +{ + "output": "OUT-1", + "height": 22 +} diff --git a/test/config/include-multi-3-0.json b/test/config/include-multi-3-0.json index 3f4da0c..11cdd3f 100644 --- a/test/config/include-multi-3-0.json +++ b/test/config/include-multi-3-0.json @@ -1,8 +1,3 @@ -[ - {}, - {}, - {}, - { - "height": 23 - } -] +{ + "height": 23 +} diff --git a/test/config/include-multi-3.json b/test/config/include-multi-3.json index d095189..309fe15 100644 --- a/test/config/include-multi-3.json +++ b/test/config/include-multi-3.json @@ -1,9 +1,4 @@ -[ - {}, - {}, - {}, - { - "output": "OUT-3", - "include": "test/config/include-multi-3-0.json" - } -] +{ + "output": "OUT-3", + "include": "test/config/include-multi-3-0.json" +} From 0c1d3e30b62dc7c94b7ae32b97089309de7ff956 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 15 Sep 2021 22:14:12 +0700 Subject: [PATCH 279/303] fix(config): preserve explicit null when merging objects --- src/config.cpp | 9 +++++++-- test/config.cpp | 2 ++ test/config/include-1.json | 3 ++- test/config/include.json | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 63f18c2..63149cb 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1,5 +1,6 @@ #include "config.hpp" +#include #include #include #include @@ -86,11 +87,15 @@ void Config::mergeConfig(Json::Value &a_config_, Json::Value &b_config_) { a_config_ = b_config_; } else if (a_config_.isObject() && b_config_.isObject()) { for (const auto &key : b_config_.getMemberNames()) { - if (a_config_[key].isObject() && b_config_[key].isObject()) { + // [] creates key with default value. Use `get` to avoid that. + if (a_config_.get(key, Json::Value::nullSingleton()).isObject() && + b_config_[key].isObject()) { mergeConfig(a_config_[key], b_config_[key]); - } else if (a_config_[key].isNull()) { + } else if (!a_config_.isMember(key)) { // do not allow overriding value set by top or previously included config a_config_[key] = b_config_[key]; + } else { + spdlog::trace("Option {} is already set; ignoring value {}", key, b_config_[key]); } } } else { diff --git a/test/config.cpp b/test/config.cpp index 343a1c1..f09f5da 100644 --- a/test/config.cpp +++ b/test/config.cpp @@ -67,6 +67,8 @@ TEST_CASE("Load simple config with include", "[config]") { REQUIRE(data["height"].asInt() == 30); // config override behavior: preserve value from the top config REQUIRE(data["position"].asString() == "top"); + // config override behavior: explicit null is still a value and should be preserved + REQUIRE((data.isMember("nullOption") && data["nullOption"].isNull())); } SECTION("select configs for configured output") { auto configs = conf.getOutputConfigs("HDMI-0", "Fake HDMI output #0"); diff --git a/test/config/include-1.json b/test/config/include-1.json index 853111c..7c47a88 100644 --- a/test/config/include-1.json +++ b/test/config/include-1.json @@ -2,5 +2,6 @@ "layer": "top", "position": "bottom", "height": 30, - "output": ["HDMI-0", "DP-0"] + "output": ["HDMI-0", "DP-0"], + "nullOption": "not null" } diff --git a/test/config/include.json b/test/config/include.json index 098cae0..c46aaf2 100644 --- a/test/config/include.json +++ b/test/config/include.json @@ -1,4 +1,5 @@ { "include": ["test/config/include-1.json", "test/config/include-2.json"], - "position": "top" + "position": "top", + "nullOption": null } From d7d606b72152da08c4a68dcbb36b92f070419159 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 15 Sep 2021 22:00:23 +0700 Subject: [PATCH 280/303] doc: update documentation for 'include' --- man/waybar.5.scd.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man/waybar.5.scd.in b/man/waybar.5.scd.in index 9dc6925..997a48d 100644 --- a/man/waybar.5.scd.in +++ b/man/waybar.5.scd.in @@ -87,8 +87,9 @@ Also a minimal example configuration can be found on the at the bottom of this m *include* ++ typeof: string|array ++ - Paths to additional configuration files. In case of duplicate options, the including file's value takes precedence. Make sure to avoid circular imports. - For a multi-bar config, specify at least an empty object for each bar also in every file being included. + Paths to additional configuration files. + Each file can contain a single object with any of the bar configuration options. In case of duplicate options, the first defined value takes precedence, i.e. including file -> first included file -> etc. Nested includes are permitted, but make sure to avoid circular imports. + For a multi-bar config, the include directive affects only current bar configuration object. # MODULE FORMAT From 5991bbb741fed4756e6efdec473b56a5c9767840 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 14 Sep 2021 14:02:38 +0700 Subject: [PATCH 281/303] ci: run unit-tests --- .github/workflows/freebsd.yml | 7 ++++--- .github/workflows/linux.yml | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index f02c9b5..8af7a04 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -15,9 +15,10 @@ jobs: export CPPFLAGS=-isystem/usr/local/include LDFLAGS=-L/usr/local/lib # sndio sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf pkg install -y git # subprojects/date - pkg install -y evdev-proto gtk-layer-shell gtkmm30 jsoncpp libdbusmenu \ - libevdev libfmt libmpdclient libudev-devd meson pkgconf pulseaudio \ - scdoc sndio spdlog + pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \ + libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \ + pkgconf pulseaudio scdoc sndio spdlog run: | meson build -Dman-pages=enabled ninja -C build + meson test -C build --no-rebuild --print-errorlogs --suite waybar diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e550e20..d4efbf8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,3 +23,5 @@ jobs: run: meson -Dman-pages=enabled build - name: build run: ninja -C build + - name: test + run: meson test -C build --no-rebuild --print-errorlogs --suite waybar From 4bf577e89bfc2c7c816cda99e1b5a68e63ae9d5a Mon Sep 17 00:00:00 2001 From: Darkclainer Date: Fri, 17 Sep 2021 21:18:21 +0300 Subject: [PATCH 282/303] Add CPU usage for every core --- include/modules/cpu.hpp | 11 ++++++----- src/modules/cpu/common.cpp | 32 +++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/include/modules/cpu.hpp b/include/modules/cpu.hpp index 866b5af..1fe1199 100644 --- a/include/modules/cpu.hpp +++ b/include/modules/cpu.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -19,11 +20,11 @@ class Cpu : public ALabel { auto update() -> void; private: - double getCpuLoad(); - std::tuple getCpuUsage(); - std::tuple getCpuFrequency(); - std::vector> parseCpuinfo(); - std::vector parseCpuFrequencies(); + double getCpuLoad(); + std::tuple, std::string> getCpuUsage(); + std::tuple getCpuFrequency(); + std::vector> parseCpuinfo(); + std::vector parseCpuFrequencies(); std::vector> prev_times_; diff --git a/src/modules/cpu/common.cpp b/src/modules/cpu/common.cpp index 767cde9..5869e13 100644 --- a/src/modules/cpu/common.cpp +++ b/src/modules/cpu/common.cpp @@ -17,7 +17,8 @@ auto waybar::modules::Cpu::update() -> void { label_.set_tooltip_text(tooltip); } auto format = format_; - auto state = getState(cpu_usage); + auto total_usage = cpu_usage.empty() ? 0 : cpu_usage[0]; + auto state = getState(total_usage); if (!state.empty() && config_["format-" + state].isString()) { format = config_["format-" + state].asString(); } @@ -27,13 +28,22 @@ auto waybar::modules::Cpu::update() -> void { } else { event_box_.show(); auto icons = std::vector{state}; - label_.set_markup(fmt::format(format, - fmt::arg("load", cpu_load), - fmt::arg("usage", cpu_usage), - fmt::arg("icon", getIcon(cpu_usage, icons)), - fmt::arg("max_frequency", max_frequency), - fmt::arg("min_frequency", min_frequency), - fmt::arg("avg_frequency", avg_frequency))); + fmt::dynamic_format_arg_store store; + store.push_back(fmt::arg("load", cpu_load)); + store.push_back(fmt::arg("load", cpu_load)); + store.push_back(fmt::arg("usage", total_usage)); + store.push_back(fmt::arg("icon", getIcon(total_usage, icons))); + store.push_back(fmt::arg("max_frequency", max_frequency)); + store.push_back(fmt::arg("min_frequency", min_frequency)); + store.push_back(fmt::arg("avg_frequency", avg_frequency)); + for (size_t i = 1; i < cpu_usage.size(); ++i) { + auto core_i = i - 1; + auto core_format = fmt::format("usage{}", core_i); + store.push_back(fmt::arg(core_format.c_str(), cpu_usage[i])); + auto icon_format = fmt::format("icon{}", core_i); + store.push_back(fmt::arg(icon_format.c_str(), getIcon(cpu_usage[i], icons))); + } + label_.set_markup(fmt::vformat(format, store)); } // Call parent update @@ -48,14 +58,14 @@ double waybar::modules::Cpu::getCpuLoad() { throw std::runtime_error("Can't get Cpu load"); } -std::tuple waybar::modules::Cpu::getCpuUsage() { +std::tuple, std::string> waybar::modules::Cpu::getCpuUsage() { if (prev_times_.empty()) { prev_times_ = parseCpuinfo(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); } std::vector> curr_times = parseCpuinfo(); std::string tooltip; - uint16_t usage = 0; + std::vector usage; for (size_t i = 0; i < curr_times.size(); ++i) { auto [curr_idle, curr_total] = curr_times[i]; auto [prev_idle, prev_total] = prev_times_[i]; @@ -63,11 +73,11 @@ std::tuple waybar::modules::Cpu::getCpuUsage() { const float delta_total = curr_total - prev_total; uint16_t tmp = 100 * (1 - delta_idle / delta_total); if (i == 0) { - usage = tmp; tooltip = fmt::format("Total: {}%", tmp); } else { tooltip = tooltip + fmt::format("\nCore{}: {}%", i - 1, tmp); } + usage.push_back(tmp); } prev_times_ = curr_times; return {usage, tooltip}; From 8da940f929bd8c06a30fd3d02de53e6fac2ac5f8 Mon Sep 17 00:00:00 2001 From: Darkclainer Date: Fri, 17 Sep 2021 22:22:14 +0300 Subject: [PATCH 283/303] Update man pages for cpu usage --- man/waybar-cpu.5.scd | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/man/waybar-cpu.5.scd b/man/waybar-cpu.5.scd index 679ca2c..2e0d6c7 100644 --- a/man/waybar-cpu.5.scd +++ b/man/waybar-cpu.5.scd @@ -82,7 +82,9 @@ The *cpu* module displays the current cpu utilization. *{load}*: Current cpu load. -*{usage}*: Current cpu usage. +*{usage}*: Current overall cpu usage. + +*{usage*{n}*}*: Current cpu core n usage. Cores are numbered from zero, so first core will be {usage0} and 4th will be {usage3}. *{avg_frequency}*: Current cpu average frequency (based on all cores) in GHz. @@ -90,7 +92,13 @@ The *cpu* module displays the current cpu utilization. *{min_frequency}*: Current cpu min frequency (based on the core with the lowest frequency) in GHz. -# EXAMPLE +*{icon}*: Icon for overall cpu usage. + +*{icon*{n}*}*: Icon for cpu core n usage. Use like {icon0}. + +# EXAMPLES + +Basic configuration: ``` "cpu": { @@ -100,6 +108,16 @@ The *cpu* module displays the current cpu utilization. } ``` +Cpu usage per core rendered as icons: + +``` +"cpu": { + "interval": 1, + "format": "{icon0}{icon1}{icon2}{icon3} {usage:>2}% ", + "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], +}, +``` + # STYLE - *#cpu* From 5f083193e4202e616d587b53050111fef1fa031f Mon Sep 17 00:00:00 2001 From: mazunki Date: Sat, 18 Sep 2021 01:12:58 +0200 Subject: [PATCH 284/303] fixed tab indentation to spaces, removed debug --- src/modules/network.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index a45f2b8..0fccf09 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -661,9 +661,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->clearIface(); net->ifid_ = temp_idx; net->route_priority = priority; - net->gwaddr_ = temp_gw_addr; - spdlog::debug("netwok: gateway {}", net->gwaddr_); - + net->gwaddr_ = temp_gw_addr; spdlog::debug("network: new default route via if{} metric {}", temp_idx, priority); /* Ask ifname associated with temp_idx as well as carrier status */ From 13239417d817460eee8dd46bd09ddae0fc8dcf5a Mon Sep 17 00:00:00 2001 From: mazunki Date: Sat, 18 Sep 2021 01:20:16 +0200 Subject: [PATCH 285/303] fixed wrong dependency for make target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ccf0507..94f8ee6 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ install: build run: build ./build/waybar -debug-run: build +debug-run: build-debug ./build/waybar --log-level debug clean: From 6142dfba6a1ffc5e08ac68df172291d926fa8b03 Mon Sep 17 00:00:00 2001 From: mazunki Date: Sat, 18 Sep 2021 01:51:16 +0200 Subject: [PATCH 286/303] updated original debug message with gateway ip, similar, yet not identical to default via 10.13.37.100 dev enp7s0 metric 2 10.13.37.0/24 dev enp7s0 proto kernel scope link src 10.13.37.97 's output --- src/modules/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 0fccf09..3b9fb18 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -662,7 +662,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->ifid_ = temp_idx; net->route_priority = priority; net->gwaddr_ = temp_gw_addr; - spdlog::debug("network: new default route via if{} metric {}", temp_idx, priority); + spdlog::debug("network: new default route via {} on if{} metric {}", temp_gw_addr, temp_idx, priority); /* Ask ifname associated with temp_idx as well as carrier status */ struct ifinfomsg ifinfo_hdr = { From 1c91c71dcde2d77506989b407eefcd18b20f34a3 Mon Sep 17 00:00:00 2001 From: mazunki Date: Sat, 18 Sep 2021 01:51:16 +0200 Subject: [PATCH 287/303] updated original debug message with gateway ip, similar, yet not identical to `ip route` --- src/modules/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 0fccf09..3b9fb18 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -662,7 +662,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { net->ifid_ = temp_idx; net->route_priority = priority; net->gwaddr_ = temp_gw_addr; - spdlog::debug("network: new default route via if{} metric {}", temp_idx, priority); + spdlog::debug("network: new default route via {} on if{} metric {}", temp_gw_addr, temp_idx, priority); /* Ask ifname associated with temp_idx as well as carrier status */ struct ifinfomsg ifinfo_hdr = { From 67c730293885684a954632a70fe041abd2288685 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 18 Sep 2021 13:50:16 +0200 Subject: [PATCH 288/303] Revert "Add CPU usage for every core" --- include/modules/cpu.hpp | 11 +++++------ man/waybar-cpu.5.scd | 22 ++-------------------- src/modules/cpu/common.cpp | 32 +++++++++++--------------------- 3 files changed, 18 insertions(+), 47 deletions(-) diff --git a/include/modules/cpu.hpp b/include/modules/cpu.hpp index 1fe1199..866b5af 100644 --- a/include/modules/cpu.hpp +++ b/include/modules/cpu.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include @@ -20,11 +19,11 @@ class Cpu : public ALabel { auto update() -> void; private: - double getCpuLoad(); - std::tuple, std::string> getCpuUsage(); - std::tuple getCpuFrequency(); - std::vector> parseCpuinfo(); - std::vector parseCpuFrequencies(); + double getCpuLoad(); + std::tuple getCpuUsage(); + std::tuple getCpuFrequency(); + std::vector> parseCpuinfo(); + std::vector parseCpuFrequencies(); std::vector> prev_times_; diff --git a/man/waybar-cpu.5.scd b/man/waybar-cpu.5.scd index 2e0d6c7..679ca2c 100644 --- a/man/waybar-cpu.5.scd +++ b/man/waybar-cpu.5.scd @@ -82,9 +82,7 @@ The *cpu* module displays the current cpu utilization. *{load}*: Current cpu load. -*{usage}*: Current overall cpu usage. - -*{usage*{n}*}*: Current cpu core n usage. Cores are numbered from zero, so first core will be {usage0} and 4th will be {usage3}. +*{usage}*: Current cpu usage. *{avg_frequency}*: Current cpu average frequency (based on all cores) in GHz. @@ -92,13 +90,7 @@ The *cpu* module displays the current cpu utilization. *{min_frequency}*: Current cpu min frequency (based on the core with the lowest frequency) in GHz. -*{icon}*: Icon for overall cpu usage. - -*{icon*{n}*}*: Icon for cpu core n usage. Use like {icon0}. - -# EXAMPLES - -Basic configuration: +# EXAMPLE ``` "cpu": { @@ -108,16 +100,6 @@ Basic configuration: } ``` -Cpu usage per core rendered as icons: - -``` -"cpu": { - "interval": 1, - "format": "{icon0}{icon1}{icon2}{icon3} {usage:>2}% ", - "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], -}, -``` - # STYLE - *#cpu* diff --git a/src/modules/cpu/common.cpp b/src/modules/cpu/common.cpp index 5869e13..767cde9 100644 --- a/src/modules/cpu/common.cpp +++ b/src/modules/cpu/common.cpp @@ -17,8 +17,7 @@ auto waybar::modules::Cpu::update() -> void { label_.set_tooltip_text(tooltip); } auto format = format_; - auto total_usage = cpu_usage.empty() ? 0 : cpu_usage[0]; - auto state = getState(total_usage); + auto state = getState(cpu_usage); if (!state.empty() && config_["format-" + state].isString()) { format = config_["format-" + state].asString(); } @@ -28,22 +27,13 @@ auto waybar::modules::Cpu::update() -> void { } else { event_box_.show(); auto icons = std::vector{state}; - fmt::dynamic_format_arg_store store; - store.push_back(fmt::arg("load", cpu_load)); - store.push_back(fmt::arg("load", cpu_load)); - store.push_back(fmt::arg("usage", total_usage)); - store.push_back(fmt::arg("icon", getIcon(total_usage, icons))); - store.push_back(fmt::arg("max_frequency", max_frequency)); - store.push_back(fmt::arg("min_frequency", min_frequency)); - store.push_back(fmt::arg("avg_frequency", avg_frequency)); - for (size_t i = 1; i < cpu_usage.size(); ++i) { - auto core_i = i - 1; - auto core_format = fmt::format("usage{}", core_i); - store.push_back(fmt::arg(core_format.c_str(), cpu_usage[i])); - auto icon_format = fmt::format("icon{}", core_i); - store.push_back(fmt::arg(icon_format.c_str(), getIcon(cpu_usage[i], icons))); - } - label_.set_markup(fmt::vformat(format, store)); + label_.set_markup(fmt::format(format, + fmt::arg("load", cpu_load), + fmt::arg("usage", cpu_usage), + fmt::arg("icon", getIcon(cpu_usage, icons)), + fmt::arg("max_frequency", max_frequency), + fmt::arg("min_frequency", min_frequency), + fmt::arg("avg_frequency", avg_frequency))); } // Call parent update @@ -58,14 +48,14 @@ double waybar::modules::Cpu::getCpuLoad() { throw std::runtime_error("Can't get Cpu load"); } -std::tuple, std::string> waybar::modules::Cpu::getCpuUsage() { +std::tuple waybar::modules::Cpu::getCpuUsage() { if (prev_times_.empty()) { prev_times_ = parseCpuinfo(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); } std::vector> curr_times = parseCpuinfo(); std::string tooltip; - std::vector usage; + uint16_t usage = 0; for (size_t i = 0; i < curr_times.size(); ++i) { auto [curr_idle, curr_total] = curr_times[i]; auto [prev_idle, prev_total] = prev_times_[i]; @@ -73,11 +63,11 @@ std::tuple, std::string> waybar::modules::Cpu::getCpuUsage const float delta_total = curr_total - prev_total; uint16_t tmp = 100 * (1 - delta_idle / delta_total); if (i == 0) { + usage = tmp; tooltip = fmt::format("Total: {}%", tmp); } else { tooltip = tooltip + fmt::format("\nCore{}: {}%", i - 1, tmp); } - usage.push_back(tmp); } prev_times_ = curr_times; return {usage, tooltip}; From fe547901fae1f536d047b468d8c35d3afb70a6e2 Mon Sep 17 00:00:00 2001 From: Gavin Beatty Date: Sat, 18 Sep 2021 15:28:27 -0500 Subject: [PATCH 289/303] sway/language: remove tabs, indent with 2 spaces --- src/modules/sway/language.cpp | 74 +++++++++++++++++------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index 85dc769..186fa4b 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -20,15 +20,15 @@ const std::string Language::XKB_ACTIVE_LAYOUT_NAME_KEY = "xkb_active_layout_name Language::Language(const std::string& id, const Json::Value& config) : ALabel(config, "language", id, "{}", 0, true) { is_variant_displayed = format_.find("{variant}") != std::string::npos; - if (format_.find("{}") != std::string::npos || format_.find("{short}") != std::string::npos) { - displayed_short_flag |= static_cast(DispayedShortFlag::ShortName); - } - if (format_.find("{shortDescription}") != std::string::npos) { - displayed_short_flag |= static_cast(DispayedShortFlag::ShortDescription); - } - if (config.isMember("tooltip-format")) { - tooltip_format_ = config["tooltip-format"].asString(); - } + if (format_.find("{}") != std::string::npos || format_.find("{short}") != std::string::npos) { + displayed_short_flag |= static_cast(DispayedShortFlag::ShortName); + } + if (format_.find("{shortDescription}") != std::string::npos) { + displayed_short_flag |= static_cast(DispayedShortFlag::ShortDescription); + } + if (config.isMember("tooltip-format")) { + tooltip_format_ = config["tooltip-format"].asString(); + } ipc_.subscribe(R"(["input"])"); ipc_.signal_event.connect(sigc::mem_fun(*this, &Language::onEvent)); ipc_.signal_cmd.connect(sigc::mem_fun(*this, &Language::onCmd)); @@ -102,16 +102,16 @@ auto Language::update() -> void { fmt::arg("variant", layout_.variant))); label_.set_markup(display_layout); if (tooltipEnabled()) { - if (tooltip_format_ != "") { - auto tooltip_display_layout = trim(fmt::format(tooltip_format_, - fmt::arg("short", layout_.short_name), - fmt::arg("shortDescription", layout_.short_description), - fmt::arg("long", layout_.full_name), - fmt::arg("variant", layout_.variant))); - label_.set_tooltip_markup(tooltip_display_layout); - } else { - label_.set_tooltip_markup(display_layout); - } + if (tooltip_format_ != "") { + auto tooltip_display_layout = trim(fmt::format(tooltip_format_, + fmt::arg("short", layout_.short_name), + fmt::arg("shortDescription", layout_.short_description), + fmt::arg("long", layout_.full_name), + fmt::arg("variant", layout_.variant))); + label_.set_tooltip_markup(tooltip_display_layout); + } else { + label_.set_tooltip_markup(display_layout); + } } event_box_.show(); @@ -126,7 +126,7 @@ auto Language::set_current_layout(std::string current_layout) -> void { auto Language::init_layouts_map(const std::vector& used_layouts) -> void { std::map> found_by_short_names; - XKBContext xkb_context; + XKBContext xkb_context; auto layout = xkb_context.next_layout(); for (; layout != nullptr; layout = xkb_context.next_layout()) { if (std::find(used_layouts.begin(), used_layouts.end(), layout->full_name) == @@ -161,15 +161,15 @@ auto Language::init_layouts_map(const std::vector& used_layouts) -> if (short_name_to_number_map.count(used_layout->short_name) == 0) { short_name_to_number_map[used_layout->short_name] = 1; } - - if (displayed_short_flag != static_cast(0)) { - int& number = short_name_to_number_map[used_layout->short_name]; - used_layout->short_name = - used_layout->short_name + std::to_string(number); - used_layout->short_description = - used_layout->short_description + std::to_string(number); - ++number; - } + + if (displayed_short_flag != static_cast(0)) { + int& number = short_name_to_number_map[used_layout->short_name]; + used_layout->short_name = + used_layout->short_name + std::to_string(number); + used_layout->short_description = + used_layout->short_description + std::to_string(number); + ++number; + } } } @@ -195,14 +195,14 @@ auto Language::XKBContext::next_layout() -> Layout* { auto variant_ = rxkb_layout_get_variant(xkb_layout_); std::string variant = variant_ == nullptr ? "" : std::string(variant_); auto short_description_ = rxkb_layout_get_brief(xkb_layout_); - std::string short_description; - if (short_description_ != nullptr) { - short_description = std::string(short_description_); - base_layouts_by_name_.emplace(name, xkb_layout_); - } else { - auto base_layout = base_layouts_by_name_[name]; - short_description = base_layout == nullptr ? "" : std::string(rxkb_layout_get_brief(base_layout)); - } + std::string short_description; + if (short_description_ != nullptr) { + short_description = std::string(short_description_); + base_layouts_by_name_.emplace(name, xkb_layout_); + } else { + auto base_layout = base_layouts_by_name_[name]; + short_description = base_layout == nullptr ? "" : std::string(rxkb_layout_get_brief(base_layout)); + } delete layout_; layout_ = new Layout{description, name, variant, short_description}; return layout_; From 6e5a0bc80a3301f4f30ce58909eadb7d54bd739e Mon Sep 17 00:00:00 2001 From: Darkclainer Date: Sun, 19 Sep 2021 13:41:59 +0300 Subject: [PATCH 290/303] Add cpu usage for every core --- include/modules/cpu.hpp | 10 +++++----- man/waybar-cpu.5.scd | 22 ++++++++++++++++++-- src/modules/cpu/common.cpp | 41 ++++++++++++++++++++++++++++---------- 3 files changed, 55 insertions(+), 18 deletions(-) diff --git a/include/modules/cpu.hpp b/include/modules/cpu.hpp index 866b5af..7e32a43 100644 --- a/include/modules/cpu.hpp +++ b/include/modules/cpu.hpp @@ -19,11 +19,11 @@ class Cpu : public ALabel { auto update() -> void; private: - double getCpuLoad(); - std::tuple getCpuUsage(); - std::tuple getCpuFrequency(); - std::vector> parseCpuinfo(); - std::vector parseCpuFrequencies(); + double getCpuLoad(); + std::tuple, std::string> getCpuUsage(); + std::tuple getCpuFrequency(); + std::vector> parseCpuinfo(); + std::vector parseCpuFrequencies(); std::vector> prev_times_; diff --git a/man/waybar-cpu.5.scd b/man/waybar-cpu.5.scd index 679ca2c..2e0d6c7 100644 --- a/man/waybar-cpu.5.scd +++ b/man/waybar-cpu.5.scd @@ -82,7 +82,9 @@ The *cpu* module displays the current cpu utilization. *{load}*: Current cpu load. -*{usage}*: Current cpu usage. +*{usage}*: Current overall cpu usage. + +*{usage*{n}*}*: Current cpu core n usage. Cores are numbered from zero, so first core will be {usage0} and 4th will be {usage3}. *{avg_frequency}*: Current cpu average frequency (based on all cores) in GHz. @@ -90,7 +92,13 @@ The *cpu* module displays the current cpu utilization. *{min_frequency}*: Current cpu min frequency (based on the core with the lowest frequency) in GHz. -# EXAMPLE +*{icon}*: Icon for overall cpu usage. + +*{icon*{n}*}*: Icon for cpu core n usage. Use like {icon0}. + +# EXAMPLES + +Basic configuration: ``` "cpu": { @@ -100,6 +108,16 @@ The *cpu* module displays the current cpu utilization. } ``` +Cpu usage per core rendered as icons: + +``` +"cpu": { + "interval": 1, + "format": "{icon0}{icon1}{icon2}{icon3} {usage:>2}% ", + "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], +}, +``` + # STYLE - *#cpu* diff --git a/src/modules/cpu/common.cpp b/src/modules/cpu/common.cpp index 767cde9..4cf67eb 100644 --- a/src/modules/cpu/common.cpp +++ b/src/modules/cpu/common.cpp @@ -1,5 +1,14 @@ #include "modules/cpu.hpp" +// In the 80000 version of fmt library authors decided to optimize imports +// and moved declarations required for fmt::dynamic_format_arg_store in new +// header fmt/args.h +#if (FMT_VERSION >= 80000) +#include +#else +#include +#endif + waybar::modules::Cpu::Cpu(const std::string& id, const Json::Value& config) : ALabel(config, "cpu", id, "{usage}%", 10) { thread_ = [this] { @@ -17,7 +26,8 @@ auto waybar::modules::Cpu::update() -> void { label_.set_tooltip_text(tooltip); } auto format = format_; - auto state = getState(cpu_usage); + auto total_usage = cpu_usage.empty() ? 0 : cpu_usage[0]; + auto state = getState(total_usage); if (!state.empty() && config_["format-" + state].isString()) { format = config_["format-" + state].asString(); } @@ -27,13 +37,22 @@ auto waybar::modules::Cpu::update() -> void { } else { event_box_.show(); auto icons = std::vector{state}; - label_.set_markup(fmt::format(format, - fmt::arg("load", cpu_load), - fmt::arg("usage", cpu_usage), - fmt::arg("icon", getIcon(cpu_usage, icons)), - fmt::arg("max_frequency", max_frequency), - fmt::arg("min_frequency", min_frequency), - fmt::arg("avg_frequency", avg_frequency))); + fmt::dynamic_format_arg_store store; + store.push_back(fmt::arg("load", cpu_load)); + store.push_back(fmt::arg("load", cpu_load)); + store.push_back(fmt::arg("usage", total_usage)); + store.push_back(fmt::arg("icon", getIcon(total_usage, icons))); + store.push_back(fmt::arg("max_frequency", max_frequency)); + store.push_back(fmt::arg("min_frequency", min_frequency)); + store.push_back(fmt::arg("avg_frequency", avg_frequency)); + for (size_t i = 1; i < cpu_usage.size(); ++i) { + auto core_i = i - 1; + auto core_format = fmt::format("usage{}", core_i); + store.push_back(fmt::arg(core_format.c_str(), cpu_usage[i])); + auto icon_format = fmt::format("icon{}", core_i); + store.push_back(fmt::arg(icon_format.c_str(), getIcon(cpu_usage[i], icons))); + } + label_.set_markup(fmt::vformat(format, store)); } // Call parent update @@ -48,14 +67,14 @@ double waybar::modules::Cpu::getCpuLoad() { throw std::runtime_error("Can't get Cpu load"); } -std::tuple waybar::modules::Cpu::getCpuUsage() { +std::tuple, std::string> waybar::modules::Cpu::getCpuUsage() { if (prev_times_.empty()) { prev_times_ = parseCpuinfo(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); } std::vector> curr_times = parseCpuinfo(); std::string tooltip; - uint16_t usage = 0; + std::vector usage; for (size_t i = 0; i < curr_times.size(); ++i) { auto [curr_idle, curr_total] = curr_times[i]; auto [prev_idle, prev_total] = prev_times_[i]; @@ -63,11 +82,11 @@ std::tuple waybar::modules::Cpu::getCpuUsage() { const float delta_total = curr_total - prev_total; uint16_t tmp = 100 * (1 - delta_idle / delta_total); if (i == 0) { - usage = tmp; tooltip = fmt::format("Total: {}%", tmp); } else { tooltip = tooltip + fmt::format("\nCore{}: {}%", i - 1, tmp); } + usage.push_back(tmp); } prev_times_ = curr_times; return {usage, tooltip}; From f638fe473a54e62d0ec41e143b4cf616ce388099 Mon Sep 17 00:00:00 2001 From: Ryan Walklin Date: Wed, 22 Sep 2021 11:43:25 +1200 Subject: [PATCH 291/303] Update catch2 dependency 2.13.3 -> 2.13.7 --- subprojects/catch2.wrap | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subprojects/catch2.wrap b/subprojects/catch2.wrap index 356c406..c82b310 100644 --- a/subprojects/catch2.wrap +++ b/subprojects/catch2.wrap @@ -1,11 +1,11 @@ [wrap-file] -directory = Catch2-2.13.3 -source_url = https://github.com/catchorg/Catch2/archive/v2.13.3.zip -source_filename = Catch2-2.13.3.zip -source_hash = 1804feb72bc15c0856b4a43aa586c661af9c3685a75973b6a8fc0b950c7cfd13 -patch_url = https://github.com/mesonbuild/catch2/releases/download/2.13.3-2/catch2.zip -patch_filename = catch2-2.13.3-2-wrap.zip -patch_hash = 21b590ab8c65b593ad5ee8f8e5b822bf9877b2c2672f97fbb52459751053eadf +directory = Catch2-2.13.7 +source_url = https://github.com/catchorg/Catch2/archive/v2.13.7.zip +source_filename = Catch2-2.13.7.zip +source_hash = 3f3ccd90ad3a8fbb1beeb15e6db440ccdcbebe378dfd125d07a1f9a587a927e9 +patch_filename = catch2_2.13.7-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/catch2_2.13.7-1/get_patch +patch_hash = 2f7369645d747e5bd866317ac1dd4c3d04dc97d3aad4fc6b864bdf75d3b57158 [provide] catch2 = catch2_dep From fbedc3d133d627b8ff4f8c9fe5744739bf8dd0b3 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 19 Sep 2021 18:30:41 +0300 Subject: [PATCH 292/303] fix(tray): fix visibility of Passive items `show_all` call from `Tray::update` attempts to walk the widget tree and make every widget visible. Since we control individual tray item visibility based on `Status` SNI property, we don't want that to happen. Modify `Tray::update` to control the visibility of a whole tray module only and ensure that the children of `Item` are still visible when necessary. --- src/modules/sni/item.cpp | 1 + src/modules/sni/tray.cpp | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index d9748ed..b504c8d 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -62,6 +62,7 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf event_box.signal_button_press_event().connect(sigc::mem_fun(*this, &Item::handleClick)); event_box.signal_scroll_event().connect(sigc::mem_fun(*this, &Item::handleScroll)); // initial visibility + event_box.show_all(); event_box.set_visible(show_passive_); cancellable_ = Gio::Cancellable::create(); diff --git a/src/modules/sni/tray.cpp b/src/modules/sni/tray.cpp index e73c9eb..70b0d37 100644 --- a/src/modules/sni/tray.cpp +++ b/src/modules/sni/tray.cpp @@ -35,11 +35,8 @@ void Tray::onRemove(std::unique_ptr& item) { } auto Tray::update() -> void { - if (box_.get_children().empty()) { - box_.hide(); - } else { - box_.show_all(); - } + // Show tray only when items are availale + box_.set_visible(!box_.get_children().empty()); // Call parent update AModule::update(); } From f18eb71ad7b6b1a523fdbb8416bbc713213b6ccd Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Sat, 2 Oct 2021 18:13:17 +0200 Subject: [PATCH 293/303] Fix spelling errors Signed-off-by: Elyes HAOUAS --- resources/custom_modules/mediaplayer.py | 2 +- src/modules/clock.cpp | 2 +- src/modules/network.cpp | 2 +- src/modules/sni/tray.cpp | 2 +- test/config.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/custom_modules/mediaplayer.py b/resources/custom_modules/mediaplayer.py index cf3df4b..fa9aa58 100755 --- a/resources/custom_modules/mediaplayer.py +++ b/resources/custom_modules/mediaplayer.py @@ -79,7 +79,7 @@ def signal_handler(sig, frame): def parse_arguments(): parser = argparse.ArgumentParser() - # Increase verbosity with every occurence of -v + # Increase verbosity with every occurrence of -v parser.add_argument('-v', '--verbose', action='count', default=0) # Define for which player we're listening diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 82c5701..0c38cb6 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -16,7 +16,7 @@ using waybar::modules::waybar_time; waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config) : ALabel(config, "clock", id, "{:%H:%M}", 60, false, false, true), fixed_time_zone_(false) { if (config_["timezone"].isString()) { - spdlog::warn("As using a timezone, some format args may be missing as the date library havn't got a release since 2018."); + spdlog::warn("As using a timezone, some format args may be missing as the date library haven't got a release since 2018."); time_zone_ = date::locate_zone(config_["timezone"].asString()); fixed_time_zone_ = true; } diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 3b9fb18..99ccd8e 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -469,7 +469,7 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) { } if (!is_del_event && ifi->ifi_index == net->ifid_) { - // Update inferface information + // Update interface information if (net->ifname_.empty() && ifname != NULL) { std::string new_ifname (ifname, ifname_len); net->ifname_ = new_ifname; diff --git a/src/modules/sni/tray.cpp b/src/modules/sni/tray.cpp index 70b0d37..c32c0d6 100644 --- a/src/modules/sni/tray.cpp +++ b/src/modules/sni/tray.cpp @@ -35,7 +35,7 @@ void Tray::onRemove(std::unique_ptr& item) { } auto Tray::update() -> void { - // Show tray only when items are availale + // Show tray only when items are available box_.set_visible(!box_.get_children().empty()); // Call parent update AModule::update(); diff --git a/test/config.cpp b/test/config.cpp index f09f5da..edd6d6b 100644 --- a/test/config.cpp +++ b/test/config.cpp @@ -85,7 +85,7 @@ TEST_CASE("Load multiple bar config with include", "[config]") { conf.load("test/config/include-multi.json"); SECTION("bar config with sole include") { - auto data = conf.getOutputConfigs("OUT-0", "Fake ouptut #0"); + auto data = conf.getOutputConfigs("OUT-0", "Fake output #0"); REQUIRE(data.size() == 1); REQUIRE(data[0]["height"].asInt() == 20); } From 99723845976fb577a057b86e36b502c966bf254f Mon Sep 17 00:00:00 2001 From: "Rene D. Obermueller" Date: Sat, 2 Oct 2021 18:35:38 +0200 Subject: [PATCH 294/303] sway/window: include floating_nodes when considering window count for class --- src/modules/sway/window.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index b677958..fc81b2c 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -68,15 +68,22 @@ auto Window::update() -> void { int leafNodesInWorkspace(const Json::Value& node) { auto const& nodes = node["nodes"]; - if(nodes.empty()) { + auto const& floating_nodes = node["floating_nodes"]; + if(nodes.empty() && floating_nodes.empty()) { if(node["type"] == "workspace") return 0; else return 1; } int sum = 0; - for(auto const& node : nodes) - sum += leafNodesInWorkspace(node); + if (!nodes.empty()) { + for(auto const& node : nodes) + sum += leafNodesInWorkspace(node); + } + if (!floating_nodes.empty()) { + for(auto const& node : floating_nodes) + sum += leafNodesInWorkspace(node); + } return sum; } From 174db444d6a6a78814e0c93430755d92312832a0 Mon Sep 17 00:00:00 2001 From: Sergey Mishin Date: Sun, 3 Oct 2021 03:27:54 +0000 Subject: [PATCH 295/303] Fix Clock crash on empty string in timezones field Also fixed timezones behavior: now waybar starting with the first timezone in timezones list and falling back to timezone field only if timezones omit or has no elements. --- include/modules/clock.hpp | 1 + man/waybar-clock.5.scd | 3 ++- src/modules/clock.cpp | 30 +++++++++++++++++++----------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/include/modules/clock.hpp b/include/modules/clock.hpp index b3e2634..17752e4 100644 --- a/include/modules/clock.hpp +++ b/include/modules/clock.hpp @@ -37,6 +37,7 @@ class Clock : public ALabel { auto calendar_text(const waybar_time& wtime) -> std::string; auto weekdays_header(const date::weekday& first_dow, std::ostream& os) -> void; auto first_day_of_week() -> date::weekday; + bool setTimeZone(Json::Value zone_name); }; } // namespace waybar::modules diff --git a/man/waybar-clock.5.scd b/man/waybar-clock.5.scd index 28688ee..2c901d2 100644 --- a/man/waybar-clock.5.scd +++ b/man/waybar-clock.5.scd @@ -24,7 +24,8 @@ The *clock* module displays the current date and time. *timezone*: ++ typeof: string ++ default: inferred local timezone ++ - The timezone to display the time in, e.g. America/New_York. + The timezone to display the time in, e.g. America/New_York. ++ + This field will be ignored if *timezones* field is set and have at least one value. *timezones*: ++ typeof: list of strings ++ diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 0c38cb6..7c94c45 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -15,10 +15,14 @@ using waybar::modules::waybar_time; waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config) : ALabel(config, "clock", id, "{:%H:%M}", 60, false, false, true), fixed_time_zone_(false) { - if (config_["timezone"].isString()) { + if (config_["timezones"].isArray() && !config_["timezones"].empty()) { + time_zone_idx_ = 0; + setTimeZone(config_["timezones"][time_zone_idx_]); + } else { + setTimeZone(config_["timezone"]); + } + if (fixed_time_zone_) { spdlog::warn("As using a timezone, some format args may be missing as the date library haven't got a release since 2018."); - time_zone_ = date::locate_zone(config_["timezone"].asString()); - fixed_time_zone_ = true; } if (config_["locale"].isString()) { @@ -72,6 +76,17 @@ auto waybar::modules::Clock::update() -> void { ALabel::update(); } +bool waybar::modules::Clock::setTimeZone(Json::Value zone_name) { + if (!zone_name.isString() || zone_name.asString().empty()) { + fixed_time_zone_ = false; + return false; + } + + time_zone_ = date::locate_zone(zone_name.asString()); + fixed_time_zone_ = true; + return true; +} + bool waybar::modules::Clock::handleScroll(GdkEventScroll *e) { // defer to user commands if set if (config_["on-scroll-up"].isString() || config_["on-scroll-down"].isString()) { @@ -92,14 +107,7 @@ bool waybar::modules::Clock::handleScroll(GdkEventScroll *e) { } else { time_zone_idx_ = time_zone_idx_ == 0 ? nr_zones - 1 : time_zone_idx_ - 1; } - auto zone_name = config_["timezones"][time_zone_idx_]; - if (!zone_name.isString() || zone_name.empty()) { - fixed_time_zone_ = false; - } else { - time_zone_ = date::locate_zone(zone_name.asString()); - fixed_time_zone_ = true; - } - + setTimeZone(config_["timezones"][time_zone_idx_]); update(); return true; } From 0b66454d5c9cf526b889d16cd656cd2c4834c7ee Mon Sep 17 00:00:00 2001 From: Robin Ebert Date: Wed, 20 Oct 2021 11:11:49 +0200 Subject: [PATCH 296/303] Add spacing config option This option allows to add spaces between the modules. It uses Gtk:Box's spacing property. --- src/bar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bar.cpp b/src/bar.cpp index 7d76359..54e487d 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -438,6 +438,13 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) center_.get_style_context()->add_class("modules-center"); right_.get_style_context()->add_class("modules-right"); + if (config["spacing"].isInt()) { + int spacing = config["spacing"].asInt(); + left_.set_spacing(spacing); + center_.set_spacing(spacing); + right_.set_spacing(spacing); + } + uint32_t height = config["height"].isUInt() ? config["height"].asUInt() : 0; uint32_t width = config["width"].isUInt() ? config["width"].asUInt() : 0; From 7669029bfece53d171eead18baff0520a52859fb Mon Sep 17 00:00:00 2001 From: Robin Ebert Date: Wed, 20 Oct 2021 11:15:49 +0200 Subject: [PATCH 297/303] Add man documentation for spacing config option --- man/waybar.5.scd.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/waybar.5.scd.in b/man/waybar.5.scd.in index 997a48d..eaa8d78 100644 --- a/man/waybar.5.scd.in +++ b/man/waybar.5.scd.in @@ -64,6 +64,10 @@ Also a minimal example configuration can be found on the at the bottom of this m typeof: integer ++ Margins value without units. +*spacing* ++ + typeof: integer ++ + Size of gaps in between of the different modules. + *name* ++ typeof: string ++ Optional name added as a CSS class, for styling multiple waybars. From 01bfbc46560bf2daac3317b9541b46196e6673fd Mon Sep 17 00:00:00 2001 From: Robin Ebert Date: Wed, 20 Oct 2021 11:23:57 +0200 Subject: [PATCH 298/303] Use spacing in config --- resources/config | 1 + resources/style.css | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/config b/resources/config index b315721..063393b 100644 --- a/resources/config +++ b/resources/config @@ -3,6 +3,7 @@ // "position": "bottom", // Waybar position (top|bottom|left|right) "height": 30, // Waybar height (to be removed for auto height) // "width": 1280, // Waybar width + "spacing": 4, // Gaps between modules (4px) // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-center": ["sway/window"], diff --git a/resources/style.css b/resources/style.css index c0d4d9b..0235942 100644 --- a/resources/style.css +++ b/resources/style.css @@ -80,7 +80,6 @@ window#waybar.chromium { #idle_inhibitor, #mpd { padding: 0 10px; - margin: 0 4px; color: #ffffff; } From a015b2e3db979fa4603f8d942d0f2e2877b9327b Mon Sep 17 00:00:00 2001 From: jonbakke <49371446+jonbakke@users.noreply.github.com> Date: Thu, 28 Oct 2021 09:37:11 -0700 Subject: [PATCH 299/303] Clarify less than/greater than in warning. I was seeing "[warning] Requested height: 20 exceeds the minimum height: 30 required..." Lines 114-134 are relevant; 133 overrides the requested height with the minimum height when GTK wants more pixels to work with. So, the code is behaving as expected, and "less than" matches the code's logic. --- src/bar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bar.cpp b/src/bar.cpp index 54e487d..a8b230e 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -13,10 +13,10 @@ namespace waybar { static constexpr const char* MIN_HEIGHT_MSG = - "Requested height: {} exceeds the minimum height: {} required by the modules"; + "Requested height: {} is less than the minimum height: {} required by the modules"; static constexpr const char* MIN_WIDTH_MSG = - "Requested width: {} exceeds the minimum width: {} required by the modules"; + "Requested width: {} is less than the minimum width: {} required by the modules"; static constexpr const char* BAR_SIZE_MSG = "Bar configured (width: {}, height: {}) for output: {}"; From decb13eef0a3c42d5bf7356c0d21f6fc5af93585 Mon Sep 17 00:00:00 2001 From: Marwin Glaser Date: Thu, 28 Oct 2021 19:10:46 +0200 Subject: [PATCH 300/303] mark zfs arc size as free in memory --- src/modules/memory/common.cpp | 4 ++-- src/modules/memory/linux.cpp | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/modules/memory/common.cpp b/src/modules/memory/common.cpp index 31219ed..75e0530 100644 --- a/src/modules/memory/common.cpp +++ b/src/modules/memory/common.cpp @@ -15,11 +15,11 @@ auto waybar::modules::Memory::update() -> void { unsigned long memfree; if (meminfo_.count("MemAvailable")) { // New kernels (3.4+) have an accurate available memory field. - memfree = meminfo_["MemAvailable"]; + memfree = meminfo_["MemAvailable"] + meminfo_["zfs_size"]; } else { // Old kernel; give a best-effort approximation of available memory. memfree = meminfo_["MemFree"] + meminfo_["Buffers"] + meminfo_["Cached"] + - meminfo_["SReclaimable"] - meminfo_["Shmem"]; + meminfo_["SReclaimable"] - meminfo_["Shmem"] + meminfo_["zfs_size"]; } if (memtotal > 0 && memfree >= 0) { diff --git a/src/modules/memory/linux.cpp b/src/modules/memory/linux.cpp index 75f05fe..34d55c9 100644 --- a/src/modules/memory/linux.cpp +++ b/src/modules/memory/linux.cpp @@ -1,8 +1,29 @@ #include "modules/memory.hpp" +static unsigned zfsArcSize() { + std::ifstream zfs_arc_stats{"/proc/spl/kstat/zfs/arcstats"}; + + if (zfs_arc_stats.is_open()) { + std::string name; + std::string type; + unsigned long data{0}; + + std::string line; + while (std::getline(zfs_arc_stats, line)) { + std::stringstream(line) >> name >> type >> data; + + if (name == "size") { + return data / 1024; // convert to kB + } + } + } + + return 0; +} + void waybar::modules::Memory::parseMeminfo() { const std::string data_dir_ = "/proc/meminfo"; - std::ifstream info(data_dir_); + std::ifstream info(data_dir_); if (!info.is_open()) { throw std::runtime_error("Can't open " + data_dir_); } @@ -17,4 +38,6 @@ void waybar::modules::Memory::parseMeminfo() { int64_t value = std::stol(line.substr(posDelim + 1)); meminfo_[name] = value; } + + meminfo_["zfs_size"] = zfsArcSize(); } From 48117a2e971e3d64dd1a7321802da9019a1fc9e1 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Sameti Date: Fri, 29 Oct 2021 14:12:48 +0330 Subject: [PATCH 301/303] Fix divide by zero (#1303) --- src/ALabel.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ALabel.cpp b/src/ALabel.cpp index dd41a32..b9b3d1d 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -67,8 +67,10 @@ std::string ALabel::getIcon(uint16_t percentage, const std::string& alt, uint16_ } if (format_icons.isArray()) { auto size = format_icons.size(); - auto idx = std::clamp(percentage / ((max == 0 ? 100 : max) / size), 0U, size - 1); - format_icons = format_icons[idx]; + if (size) { + auto idx = std::clamp(percentage / ((max == 0 ? 100 : max) / size), 0U, size - 1); + format_icons = format_icons[idx]; + } } if (format_icons.isString()) { return format_icons.asString(); @@ -90,8 +92,10 @@ std::string ALabel::getIcon(uint16_t percentage, const std::vector& } if (format_icons.isArray()) { auto size = format_icons.size(); - auto idx = std::clamp(percentage / ((max == 0 ? 100 : max) / size), 0U, size - 1); - format_icons = format_icons[idx]; + if (size) { + auto idx = std::clamp(percentage / ((max == 0 ? 100 : max) / size), 0U, size - 1); + format_icons = format_icons[idx]; + } } if (format_icons.isString()) { return format_icons.asString(); From 769b12f16a05f1c86c9966810dee93185bbc8a15 Mon Sep 17 00:00:00 2001 From: Birger Schacht <1143280+b1rger@users.noreply.github.com> Date: Sat, 6 Nov 2021 09:00:15 +0000 Subject: [PATCH 302/303] Fix typo --- man/waybar-battery.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/waybar-battery.5.scd b/man/waybar-battery.5.scd index 48c2ee1..e8053c9 100644 --- a/man/waybar-battery.5.scd +++ b/man/waybar-battery.5.scd @@ -120,7 +120,7 @@ The two arguments are: # CUSTOM FORMATS -The *battery* module allows to define custom formats based on up to two factors. The best fitting format will be selected. +The *battery* module allows one to define custom formats based on up to two factors. The best fitting format will be selected. *format-*: With *states*, a custom format can be set depending on the capacity of your battery. From b24f9ea5690a949f91f367eb90bbe25472f55a74 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 11 Nov 2021 21:42:05 +0100 Subject: [PATCH 303/303] Ensure MPD volume is not negative If the primary output does not support changing volume MPD will report -1. Ensure that negative volume levels will be represented as 0 instead. Signed-off-by: Sefa Eyeoglu --- src/modules/mpd/mpd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index 0a7c970..6d27286 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -131,6 +131,9 @@ void waybar::modules::MPD::setLabel() { date = getTag(MPD_TAG_DATE); song_pos = mpd_status_get_song_pos(status_.get()); volume = mpd_status_get_volume(status_.get()); + if (volume < 0) { + volume = 0; + } queue_length = mpd_status_get_queue_length(status_.get()); elapsedTime = std::chrono::seconds(mpd_status_get_elapsed_time(status_.get())); totalTime = std::chrono::seconds(mpd_status_get_total_time(status_.get()));