Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions man/waybar-hyprland-language.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Addressed by *hyprland/language*
typeof: string ++
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.

*tooltip-format*: ++
typeof: string ++
The format, how information should be displayed in the tooltip. Uses the same replacements as *format*.

*menu*: ++
typeof: string ++
Action that popups the menu.
Expand Down Expand Up @@ -60,6 +64,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"
Expand Down
13 changes: 13 additions & 0 deletions src/modules/hyprland/language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ auto Language::update() -> void {
label_.hide();
}

if (tooltipEnabled()) {
if (config_["tooltip-format"].isString()) {
const auto tooltip = trim(fmt::format(fmt::runtime(config_["tooltip-format"].asString()),
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);
}
}

ALabel::update();
}

Expand Down