1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-09-15 19:26:58 +02:00

feat: support glob patterns for keyboard layout icons (#949)

* Simplistic globbing for matching keyboard layout icons

Update the logic for determining the display text for the current keyboard layout.
Instead of a direct map lookup, iterate through the layout map to support wildcard matching.

Patterns ending with `*` will match any language string starting with the characters before the `*`. This allows grouping similar layouts (e.g., `English`, `English (Colemak-DH ISO)`) under a single pattern like `English*`.

* Use `IndexMap` instead of `HashMap` for keyboard layout icons map

This enables users to choose which globs to prioritize via ordering in the config

* Enable feature `serde` for `indexmap`

* Document wildcard matching for keyboard layouts

* Enable `indexmap2` feature flag for `schemars`

* Add missing period

* use string slices

* Fix formatting
This commit is contained in:
Alan 2025-07-21 00:19:58 +03:00 committed by GitHub
commit 5520562a18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 8 deletions

1
Cargo.lock generated
View file

@ -2969,6 +2969,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0"
dependencies = [
"dyn-clone",
"indexmap",
"ref-cast",
"schemars_derive",
"serde",