feat(keyboard-layout): custom labels support (v5 port)#2925
Open
fennstef wants to merge 4 commits into
Open
Conversation
added 4 commits
June 6, 2026 22:30
Allows users to override the auto-generated short label for any keyboard layout by name via the [widget.keyboard_layout.custom_labels] TOML table: [widget.keyboard_layout.custom_labels] "German (Neo 2)" = "Neo2" "English (US)" = "EN" To support TOML sub-tables as widget settings, WidgetSettingValue gains a new unordered_map<string,string> variant. readWidgetSettingValue parses inline and dotted tables into this type; WidgetConfig.getStringMap() retrieves it. All existing std::visit call-sites are updated to handle the new variant (config_export, bar_widget_editor, scripted_widget_bindings).
…conflict toml++ uses template introspection on WidgetSettingValue and rejects unordered_map as a variant member. Instead, TOML tables are parsed into WidgetConfig::tables (separate from settings) and getStringMap reads from there. config_export round-trips tables back to TOML correctly.
- Add all keyboard layout settings to the settings panel (cycle_command, hide_when_single_layout, show_icon, show_label, display, custom_labels) - Add DisplayMode::Custom for direct custom-label-only display - Add KeyValueMap control type for editing string→string mappings in GUI - Pre-populate custom_labels editor with active compositor layout names - Apply custom labels in the OSD pill shown on layout change - Store TOML sub-tables in a separate `tables` field on WidgetConfig to avoid toml++ variant type constraints
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
Port of the keyboard layout custom labels feature from v4 to v5.
DisplayMode::Custom: New display mode that shows a user-defined label for each layout. Falls back to the layout name if no mapping is configured.custom_labelsconfig key: TOML sub-table under[widget.keyboard_layout]mapping layout names to display labels:Implementation notes
custom_labelsis a string→string map. Because toml++ statically introspects theWidgetSettingValuevariant and rejects non-native TOML types, the map cannot be added to that variant. Instead, a separatetablesfield (unordered_map<string, unordered_map<string,string>>) was added toWidgetConfigto hold TOML sub-tables. Override persistence works viawidgetConfigEqualwhich now comparestablesas well.Test plan
display = "custom"in widget inspector, verify segmented control shows short/full/custom~/.local/state/noctalia/settings.toml