fix linter

pull/1657/head
vaxerski 2022-08-18 18:04:39 +02:00
parent 16d5619f3b
commit a23d58e900
1 changed files with 16 additions and 16 deletions

View File

@ -45,7 +45,7 @@ void Language::onEvent(const std::string& ev) {
keebName = keebName.substr(keebName.find_first_of('>') + 2); keebName = keebName.substr(keebName.find_first_of('>') + 2);
if (config_.isMember("keyboard-name") && keebName != config_["keyboard-name"].asString()) if (config_.isMember("keyboard-name") && keebName != config_["keyboard-name"].asString())
return; // ignore return; // ignore
auto replaceAll = [](std::string str, const std::string& from, auto replaceAll = [](std::string str, const std::string& from,
const std::string& to) -> std::string { const std::string& to) -> std::string {
@ -69,29 +69,29 @@ void Language::onEvent(const std::string& ev) {
} }
void Language::initLanguage() { void Language::initLanguage() {
const auto INPUTDEVICES = gIPC->getSocket1Reply("devices"); const auto INPUTDEVICES = gIPC->getSocket1Reply("devices");
if (!config_.isMember("keyboard-name")) if (!config_.isMember("keyboard-name"))
return; return;
const auto KEEBNAME = config_["keyboard-name"].asString(); const auto KEEBNAME = config_["keyboard-name"].asString();
try { try {
auto searcher = INPUTDEVICES.substr(INPUTDEVICES.find(KEEBNAME) + KEEBNAME.length()); auto searcher = INPUTDEVICES.substr(INPUTDEVICES.find(KEEBNAME) + KEEBNAME.length());
searcher = searcher.substr(searcher.find("Keyboard at")); searcher = searcher.substr(searcher.find("Keyboard at"));
searcher = searcher.substr(searcher.find("keymap:") + 7); searcher = searcher.substr(searcher.find("keymap:") + 7);
searcher = searcher.substr(0, searcher.find_first_of("\n\t")); searcher = searcher.substr(0, searcher.find_first_of("\n\t"));
layoutName_ = searcher; layoutName_ = searcher;
spdlog::debug("hyprland language initLanguage found {}", layoutName_); spdlog::debug("hyprland language initLanguage found {}", layoutName_);
dp.emit(); dp.emit();
} catch (std::exception& e) { } catch (std::exception& e) {
spdlog::error("hyprland language initLanguage failed with {}", e.what()); spdlog::error("hyprland language initLanguage failed with {}", e.what());
} }
} }
} // namespace waybar::modules::hyprland } // namespace waybar::modules::hyprland