From 331a028ab009a10189b51c0597d792c3c90c8ec3 Mon Sep 17 00:00:00 2001 From: Dan Elitzer <4393744+delitzer@users.noreply.github.com> Date: Sat, 6 Jun 2026 02:43:24 -0700 Subject: [PATCH 1/3] Add tooltip_format member to language class --- include/modules/hyprland/language.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/modules/hyprland/language.hpp b/include/modules/hyprland/language.hpp index ec59e5c3ad..99972a0d40 100644 --- a/include/modules/hyprland/language.hpp +++ b/include/modules/hyprland/language.hpp @@ -37,6 +37,7 @@ class Language : public waybar::ALabel, public EventHandler { util::JsonParser parser_; Layout layout_; + std::string tooltip_format_; IPC& m_ipc; }; From a7ab76b4930c42be3b1ac769083431edae019f62 Mon Sep 17 00:00:00 2001 From: Dan Elitzer <4393744+delitzer@users.noreply.github.com> Date: Sat, 6 Jun 2026 02:49:21 -0700 Subject: [PATCH 2/3] Add tooltip-format support to hyprland language --- src/modules/hyprland/language.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modules/hyprland/language.cpp b/src/modules/hyprland/language.cpp index 6e0fe23d30..18ac36a615 100644 --- a/src/modules/hyprland/language.cpp +++ b/src/modules/hyprland/language.cpp @@ -11,6 +11,10 @@ namespace waybar::modules::hyprland { Language::Language(const std::string& id, const Bar& bar, const Json::Value& config) : ALabel(config, "language", id, "{}", 0, true), bar_(bar), m_ipc(IPC::inst()) { + if (config_["tooltip-format"].isString()) { + tooltip_format_ = config_["tooltip-format"].asString(); + } + // get the active layout when open initLanguage(); @@ -54,6 +58,18 @@ auto Language::update() -> void { if (!format_.empty()) { label_.show(); label_.set_markup(layoutName); + if (tooltipEnabled()) { + if (!tooltip_format_.empty()) { + auto tooltip = trim(fmt::format(fmt::runtime(tooltip_format_), + fmt::arg("long", layout_.full_name), + fmt::arg("short", layout_.short_name), + fmt::arg("shortDescription", layout_.short_description), + fmt::arg("variant", layout_.variant))); + label_.set_tooltip_markup(tooltip); + } else { + label_.set_tooltip_markup(layoutName); + } + } } else { label_.hide(); } From cc5262caf8e653f28d8280ebbd336fcbd7dc779b Mon Sep 17 00:00:00 2001 From: Dan Elitzer <4393744+delitzer@users.noreply.github.com> Date: Sat, 6 Jun 2026 02:49:50 -0700 Subject: [PATCH 3/3] Document hyprland language tooltip format --- man/waybar-hyprland-language.5.scd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/man/waybar-hyprland-language.5.scd b/man/waybar-hyprland-language.5.scd index 5a7ba94181..f5d1762ee5 100644 --- a/man/waybar-hyprland-language.5.scd +++ b/man/waybar-hyprland-language.5.scd @@ -21,6 +21,16 @@ Addressed by *hyprland/language* typeof: string++ Provide an alternative name to display per language where is the language of your choosing. Can be passed multiple times with multiple languages as shown by the example below. +*tooltip-format*: ++ + typeof: string ++ + default: {} ++ + The format, how layout should be displayed in tooltip. + +*tooltip*: ++ + typeof: bool ++ + default: true ++ + Option to disable tooltip on hover. + *keyboard-name*: ++ typeof: string ++ Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended. @@ -60,6 +70,7 @@ Addressed by *hyprland/language* ``` "hyprland/language": { "format": "Lang: {long}", + "tooltip-format": "Layout: {long}", "format-en": "AMERICA, HELL YEAH!", "format-tr": "As bayrakları", "keyboard-name": "at-translated-set-2-keyboard"