This commit is contained in:
John
2025-04-27 09:34:04 +12:00
parent 3c50260ed3
commit c6665f3044
11 changed files with 75 additions and 37 deletions

View File

@ -11,18 +11,26 @@ namespace dropshell {
std::string get_local_dropshell_config_path()
std::string get_local_dropshell_config_parent_path()
{
// Try ~/.config/dropshell/dropshell.conf
const char* home = std::getenv("HOME");
if (home) {
fs::path user_path = fs::path(home) / ".config" / "dropshell" / "dropshell.env";
fs::path user_path = fs::path(home) / ".config" / "dropshell";
return user_path.string();
}
std::cerr << "Warning: Couldn't determine user directory" << std::endl;
return std::string();
}
std::string get_local_dropshell_config_file()
{
std::string parent_path = get_local_dropshell_config_parent_path();
if (parent_path.empty())
return std::string();
return parent_path + "/dropshell.conf";
}
std::string get_local_system_templates_path()
{
return "/opt/dropshell/templates";