mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-28 16:32:57 +02:00
Waybar: update to 0.9.9.
This commit is contained in:
parent
6ee46b289b
commit
479e59bbfd
2 changed files with 3 additions and 167 deletions
|
@ -1,164 +0,0 @@
|
||||||
From 024fd42e272f79cb08e594eb3af86c93b1446c91 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Isaac Freund <ifreund@ifreund.xyz>
|
|
||||||
Date: Thu, 19 Aug 2021 14:59:25 +0200
|
|
||||||
Subject: [PATCH] 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 f80b3c591..9b75fbd3b 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 0f0272491..65b90332a 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 a4d6f4e57..13affaa77 100644
|
|
||||||
--- a/protocol/river-status-unstable-v1.xml
|
|
||||||
+++ b/protocol/river-status-unstable-v1.xml
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<protocol name="river_status_unstable_v1">
|
|
||||||
<copyright>
|
|
||||||
- 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.
|
|
||||||
</copyright>
|
|
||||||
|
|
||||||
- <interface name="zriver_status_manager_v1" version="1">
|
|
||||||
+ <interface name="zriver_status_manager_v1" version="2">
|
|
||||||
<description summary="manage river status objects">
|
|
||||||
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 @@
|
|
||||||
</request>
|
|
||||||
</interface>
|
|
||||||
|
|
||||||
- <interface name="zriver_output_status_v1" version="1">
|
|
||||||
+ <interface name="zriver_output_status_v1" version="2">
|
|
||||||
<description summary="track output tags and focus">
|
|
||||||
This interface allows clients to receive information about the current
|
|
||||||
windowing state of an output.
|
|
||||||
@@ -75,12 +75,21 @@
|
|
||||||
</description>
|
|
||||||
<arg name="tags" type="array" summary="array of 32-bit bitfields"/>
|
|
||||||
</event>
|
|
||||||
+
|
|
||||||
+ <event name="urgent_tags" since="2">
|
|
||||||
+ <description summary="tags of the output with an urgent view">
|
|
||||||
+ Sent once on binding the interface and again whenever the set of
|
|
||||||
+ tags with at least one urgent view changes.
|
|
||||||
+ </description>
|
|
||||||
+ <arg name="tags" type="uint" summary="32-bit bitfield"/>
|
|
||||||
+ </event>
|
|
||||||
</interface>
|
|
||||||
|
|
||||||
<interface name="zriver_seat_status_v1" version="1">
|
|
||||||
<description summary="track seat focus">
|
|
||||||
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.
|
|
||||||
</description>
|
|
||||||
|
|
||||||
<request name="destroy" type="destrucor">
|
|
||||||
diff --git a/src/modules/river/tags.cpp b/src/modules/river/tags.cpp
|
|
||||||
index e96b20169..2628af2db 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<Tags *>(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<Tags *>(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<uint32_t>(version, 2);
|
|
||||||
+ if (version < ZRIVER_OUTPUT_STATUS_V1_URGENT_TAGS_SINCE_VERSION) {
|
|
||||||
+ spdlog::warn("river server does not support urgent tags");
|
|
||||||
+ }
|
|
||||||
static_cast<Tags *>(data)->status_manager_ = static_cast<struct zriver_status_manager_v1 *>(
|
|
||||||
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<uint32_t>(32, config_["num-tags"].asUInt()) : 9;
|
|
||||||
|
|
||||||
std::vector<std::string> 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 */
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'Waybar'
|
# Template file for 'Waybar'
|
||||||
pkgname=Waybar
|
pkgname=Waybar
|
||||||
version=0.9.8
|
version=0.9.9
|
||||||
revision=2
|
revision=1
|
||||||
_date_version=3.0.0
|
_date_version=3.0.0
|
||||||
build_style=meson
|
build_style=meson
|
||||||
configure_args="-Dgtk-layer-shell=enabled -Dlibudev=enabled -Dman-pages=enabled
|
configure_args="-Dgtk-layer-shell=enabled -Dlibudev=enabled -Dman-pages=enabled
|
||||||
|
@ -29,7 +29,7 @@ changelog="https://github.com/Alexays/Waybar/releases"
|
||||||
distfiles="https://github.com/Alexays/Waybar/archive/${version}.tar.gz
|
distfiles="https://github.com/Alexays/Waybar/archive/${version}.tar.gz
|
||||||
https://github.com/HowardHinnant/date/archive/v${_date_version}.tar.gz
|
https://github.com/HowardHinnant/date/archive/v${_date_version}.tar.gz
|
||||||
https://github.com/mesonbuild/hinnant-date/releases/download/${_date_version}-1/hinnant-date.zip"
|
https://github.com/mesonbuild/hinnant-date/releases/download/${_date_version}-1/hinnant-date.zip"
|
||||||
checksum="3f067c484aaee3e7d8ded382e72c280a92913b0c4e8a20d0ac9afdf8baf19405
|
checksum="23a94538538f43a6db4c1c5f7e09e75ab743ded1ccfc737e1f3e0971fe4cdd87
|
||||||
87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3
|
87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3
|
||||||
6ccaf70732d8bdbd1b6d5fdf3e1b935c23bf269bda12fdfd0e561276f63432fe"
|
6ccaf70732d8bdbd1b6d5fdf3e1b935c23bf269bda12fdfd0e561276f63432fe"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue