hyprland/language: add tooltip-format support#5099
Open
jarlyn95 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds configurable tooltip formatting to the Hyprland language module so users can display different text in the tooltip than in the label.
Changes:
- Parse a new
tooltip-formatconfig option forhyprland/language. - Set tooltip markup during
update()using the configured tooltip format (or fall back to the label text). - Refactor layout formatting into a shared helper (lambda) to avoid duplication.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/modules/hyprland/language.cpp | Implements tooltip-format parsing and tooltip rendering; refactors formatting into a helper. |
| include/modules/hyprland/language.hpp | Adds storage for the tooltip format string. |
| man/waybar-hyprland-language.5.scd | Documents the new tooltip-format option and adds an example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+42
to
+48
| const auto formatLayout = [this](const std::string& format) { | ||
| return trim(fmt::format(fmt::runtime(format), layout_.short_name, | ||
| fmt::arg("long", layout_.full_name), | ||
| fmt::arg("short", layout_.short_name), | ||
| fmt::arg("shortDescription", layout_.short_description), | ||
| fmt::arg("variant", layout_.variant))); | ||
| }; |
Comment on lines
+66
to
+69
| if (tooltipEnabled()) { | ||
| label_.set_tooltip_markup( | ||
| tooltip_format_.empty() ? layoutName : formatLayout(tooltip_format_)); | ||
| } |
Comment on lines
+42
to
+48
| const auto formatLayout = [this](const std::string& format) { | ||
| return trim(fmt::format(fmt::runtime(format), layout_.short_name, | ||
| fmt::arg("long", layout_.full_name), | ||
| fmt::arg("short", layout_.short_name), | ||
| fmt::arg("shortDescription", layout_.short_description), | ||
| fmt::arg("variant", layout_.variant))); | ||
| }; |
Comment on lines
+20
to
+22
| *tooltip-format*: ++ | ||
| typeof: string ++ | ||
| The format, how information should be displayed in the tooltip. This format supports the same replacements as *format*. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tooltip-formatsupport to thehyprland/languagemoduleformat:{},{long},{short},{shortDescription}, and{variant}waybar-hyprland-language(5)Closes #3693
Validation
git diff --check HEAD~1..HEADI could not run a full Meson/Ninja build in this Windows workspace because the required Linux build tools and Waybar system dependencies were not installed; Docker image setup timed out before completing.