Skip to content

feat(hyprland/submap): add config option to specify different icons for submaps#4772

Open
szbmrk wants to merge 3 commits intoAlexays:masterfrom
szbmrk:feat-hyprland-submap-icon-handling
Open

feat(hyprland/submap): add config option to specify different icons for submaps#4772
szbmrk wants to merge 3 commits intoAlexays:masterfrom
szbmrk:feat-hyprland-submap-icon-handling

Conversation

@szbmrk
Copy link

@szbmrk szbmrk commented Jan 14, 2026

Summary

This PR adds support for configurable icons in the Hyprland submap module based on the active submap name.

New Configuration Options

  • icons: Object mapping submap names to their corresponding icons/strings
    • Keys: submap names (e.g., "resize", "pause")
    • Values: icons or strings to display for those submaps
    • The selected icon is made available via the {icon} placeholder in the format string

Format String Changes

The format option now supports two placeholders:

  • {submap}: The currently active submap name (replaces the legacy {} placeholder)
  • {icon}: The icon associated with the current submap (from the icons configuration)
  • having only {} will work the same as before and will show the submap name, so if anybody updates there will be no breaking changes for their configs

Example Configuration

"hyprland/submap": {
    "format": "{icon} {submap}",
    "max-length": 8,
    "tooltip": false,
    "icons": {
        "resize": "",
        "pause": "",
    }
}

Implementation Details

  • Added icons_ map to store submap name to icon mappings
  • Added icon_ member variable to track the current icon
  • Icons are loaded from the configuration during module initialization
  • The icon is updated dynamically when the submap changes
  • If no icon is defined for a submap, the {icon} placeholder will be empty
  • Legacy format string using {} is still supported for backward compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant