Skip to content

Commit

Permalink
forgor
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Jul 8, 2024
1 parent 6ec715d commit 03d26c5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/path/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Hyprutils::Path {
if (!homeDir || !std::filesystem::path(homeDir).is_absolute())
return std::nullopt;

return (std::optional<std::string>) std::string(homeDir).append("/.config");
return (std::optional<std::string>)std::string(homeDir).append("/.config");
}

std::optional<String::CVarList> getXdgConfigDirs() {
Expand All @@ -35,7 +35,7 @@ namespace Hyprutils::Path {
if (!xdgConfigHome || !std::filesystem::path(xdgConfigHome).is_absolute())
return std::nullopt;

return (std::optional<std::string>) xdgConfigHome;
return (std::optional<std::string>)xdgConfigHome;
}

std::optional<std::string> findConfig(std::string programName) {
Expand All @@ -60,14 +60,13 @@ namespace Hyprutils::Path {
static const auto xdgConfigDirs = getXdgConfigDirs();
if (xdgConfigDirs.has_value()) {
for (auto dir : xdgConfigDirs.value()) {

if (checkConfigExists(dir, programName))
return (std::optional<std::string>)dir;
}
}

if (checkConfigExists("/etc/xdg", programName))
return (std::optional<std::string>)"/etc/xdg";
return std::optional<std::string>("/etc/xdg/hypr/" + programName + ".conf");

if (xdgConfigHomeExists)
return xdgConfigHome;
Expand Down

0 comments on commit 03d26c5

Please sign in to comment.