Beispiel #1
0
static void
append_environments_to_replacement(pqrs::string::replacement& r) {
  if (r.find("ENV_HOME") == r.end()) {
    const char* p = std::getenv("HOME");
    if (!p) {
      p = "";
    }
    r["ENV_HOME"] = p;
  }
}
void xml_compiler::append_environments_to_replacement_(pqrs::string::replacement& r) const {
  if (r.find("ENV_HOME") == r.end()) {
    const char* p = std::getenv("HOME");
    if (!p) {
      p = "";
    }
    r["ENV_HOME"] = p;
  }

  r.emplace("ENV_Karabiner_Resources", system_xml_directory_);

  if (r.find("ENV_Select_the_previous_input_source_shortcut") == r.end()) {
    std::string shortcut = get_select_the_previous_input_source_shortcut();
    r.emplace("ENV_Select_the_previous_input_source_shortcut", shortcut);
  }
  if (r.find("ENV_Select_next_source_in_input_menu_shortcut") == r.end()) {
    std::string shortcut = get_select_next_source_in_input_menu_shortcut();
    r.emplace("ENV_Select_next_source_in_input_menu_shortcut", shortcut);
  }
}