Merge pull request #2326 from czM1K3/master

hyprland/language: Differentiating keyboard layout variants
This commit is contained in:
Alexis Rouillard 2023-07-18 08:21:52 +02:00 committed by GitHub
commit 185aa104b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,10 @@ auto Language::update() -> void {
std::lock_guard<std::mutex> lg(mutex_); std::lock_guard<std::mutex> lg(mutex_);
std::string layoutName = std::string{}; std::string layoutName = std::string{};
if (config_.isMember("format-" + layout_.short_description)) { if (config_.isMember("format-" + layout_.short_description + "-" + layout_.variant)) {
const auto propName = "format-" + layout_.short_description + "-" + layout_.variant;
layoutName = fmt::format(fmt::runtime(format_), config_[propName].asString());
} else if (config_.isMember("format-" + layout_.short_description)) {
const auto propName = "format-" + layout_.short_description; const auto propName = "format-" + layout_.short_description;
layoutName = fmt::format(fmt::runtime(format_), config_[propName].asString()); layoutName = fmt::format(fmt::runtime(format_), config_[propName].asString());
} else { } else {