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

View file

@ -132,7 +132,7 @@ tracing-appender = "0.2.3"
strip-ansi-escapes = "0.2.0"
color-eyre = "0.6.5"
serde = { version = "1.0.219", features = ["derive"] }
indexmap = "2.10.0"
indexmap = { version = "2.10.0", features = ["serde"] }
dirs = "6.0.0"
walkdir = "2.5.0"
notify = { version = "8.1.0", default-features = false }
@ -191,7 +191,8 @@ rustix = { version = "1.0.7", default-features = false, features = ["std", "fs",
serde_json = { version = "1.0.140", optional = true } # ipc, niri
# schema
schemars = { version = "1.0.4", optional = true }
schemars = { version = "1.0.4", optional = true, features = ["indexmap2"] }
[build-dependencies]
clap = { version = "4.5.41", features = ["derive"] }