From 6c188455a4ca75fbb11cd07de0feb19cc5d1341a Mon Sep 17 00:00:00 2001 From: gemmelos <73130646+gemmelos@users.noreply.github.com> Date: Sat, 5 Feb 2022 19:05:50 +0100 Subject: [PATCH 1/3] Update man page clock module - tooltip Add tooltip documentation to the clock man page now that this is works. --- man/waybar-clock.5.scd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man/waybar-clock.5.scd b/man/waybar-clock.5.scd index 2c901d2..265e739 100644 --- a/man/waybar-clock.5.scd +++ b/man/waybar-clock.5.scd @@ -86,6 +86,11 @@ The *clock* module displays the current date and time. typeof: double ++ Threshold to be used when scrolling. +*tooltip*: ++ + typeof: bool ++ + default: true ++ + Option to disable tooltip on hover. + View all valid format options in *strftime(3)*. # FORMAT REPLACEMENTS From d4da04a7507177f702aee7c5e58daa6788d00fd5 Mon Sep 17 00:00:00 2001 From: Alex Maystrenko Date: Sat, 5 Feb 2022 21:19:55 +0100 Subject: [PATCH 2/3] move Glib ustring format helper to utils this formatter is useful for other modules which want to print Glib exceptions messages --- include/util/format.hpp | 11 +++++++++++ src/modules/sni/item.cpp | 8 +------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/util/format.hpp b/include/util/format.hpp index 543a100..48f0f51 100644 --- a/include/util/format.hpp +++ b/include/util/format.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include class pow_format { public: @@ -84,5 +85,15 @@ namespace fmt { ); } }; + + + // Glib ustirng support + template <> + struct formatter : formatter { + template + auto format(const Glib::ustring& value, FormatContext& ctx) { + return formatter::format(value, ctx); + } + }; } diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index b504c8d..74987ca 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -8,13 +8,7 @@ #include #include -template <> -struct fmt::formatter : formatter { - template - auto format(const Glib::ustring& value, FormatContext& ctx) { - return formatter::format(value, ctx); - } -}; +#include "util/format.hpp" template <> struct fmt::formatter : formatter { From 1a93a6cfa593093868ac684831e0072b3dacc46a Mon Sep 17 00:00:00 2001 From: Dorian Rudolph Date: Wed, 9 Feb 2022 14:20:09 +0100 Subject: [PATCH 3/3] fix #1431: audio output does not update on unplug --- src/modules/pulseaudio.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 3c32060..b1f7830 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -54,7 +54,9 @@ void waybar::modules::Pulseaudio::contextStateCb(pa_context *c, void *data) { c, static_cast(static_cast(PA_SUBSCRIPTION_MASK_SERVER) | static_cast(PA_SUBSCRIPTION_MASK_SINK) | - static_cast(PA_SUBSCRIPTION_MASK_SOURCE)), + static_cast(PA_SUBSCRIPTION_MASK_SINK_INPUT) | + static_cast(PA_SUBSCRIPTION_MASK_SOURCE) | + static_cast(PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT)), nullptr, nullptr); break; @@ -121,8 +123,12 @@ void waybar::modules::Pulseaudio::subscribeCb(pa_context * conte pa_context_get_server_info(context, serverInfoCb, data); } else if (facility == PA_SUBSCRIPTION_EVENT_SINK) { pa_context_get_sink_info_by_index(context, idx, sinkInfoCb, data); + } else if (facility == PA_SUBSCRIPTION_EVENT_SINK_INPUT) { + pa_context_get_sink_info_list(context, sinkInfoCb, data); } else if (facility == PA_SUBSCRIPTION_EVENT_SOURCE) { pa_context_get_source_info_by_index(context, idx, sourceInfoCb, data); + } else if (facility == PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT) { + pa_context_get_source_info_list(context, sourceInfoCb, data); } } @@ -279,7 +285,7 @@ auto waybar::modules::Pulseaudio::update() -> void { fmt::arg("source_desc", source_desc_), fmt::arg("icon", getIcon(volume_, getPulseIcon())))); getState(volume_); - + if (tooltipEnabled()) { if (tooltip_format.empty() && config_["tooltip-format"].isString()) { tooltip_format = config_["tooltip-format"].asString();