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/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 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(); 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 {