mirror of
https://github.com/hyprwm/hyprcursor.git
synced 2024-11-16 18:25:58 +01:00
util: use a subdir from the output directory
This commit is contained in:
parent
31aff6642a
commit
ad64299e37
1 changed files with 6 additions and 4 deletions
|
@ -127,9 +127,7 @@ static std::optional<std::string> createCursorThemeFromPath(const std::string& p
|
|||
if (!std::filesystem::exists(path))
|
||||
return "input path does not exist";
|
||||
|
||||
std::string out = out_.empty() ? path.substr(0, path.find_last_of('/') + 1) + "theme/" : out_;
|
||||
|
||||
const auto MANIFESTPATH = path + "/manifest.hl";
|
||||
const auto MANIFESTPATH = path + "/manifest.hl";
|
||||
if (!std::filesystem::exists(MANIFESTPATH))
|
||||
return "manifest.hl is missing";
|
||||
|
||||
|
@ -144,6 +142,10 @@ static std::optional<std::string> createCursorThemeFromPath(const std::string& p
|
|||
manifest->parse();
|
||||
} catch (const char* err) { return "failed parsing manifest: " + std::string{err}; }
|
||||
|
||||
const std::string THEMENAME = std::any_cast<Hyprlang::STRING>(manifest->getConfigValue("name"));
|
||||
|
||||
std::string out = (out_.empty() ? path.substr(0, path.find_last_of('/') + 1) : out_) + "/theme_" + THEMENAME + "/";
|
||||
|
||||
const std::string CURSORSSUBDIR = std::any_cast<Hyprlang::STRING>(manifest->getConfigValue("cursors_directory"));
|
||||
const std::string CURSORDIR = path + "/" + CURSORSSUBDIR;
|
||||
|
||||
|
@ -289,7 +291,7 @@ static std::optional<std::string> extractXTheme(const std::string& xpath, const
|
|||
if (!std::filesystem::exists(xpath) || !std::filesystem::exists(xpath + "/cursors"))
|
||||
return "input path does not exist or is not an xcursor theme";
|
||||
|
||||
std::string out = out_.empty() ? xpath.substr(0, xpath.find_last_of('/') + 1) + "extracted/" : out_;
|
||||
std::string out = (out_.empty() ? xpath.substr(0, xpath.find_last_of('/') + 1) : out_) + "/extracted_" + xpath.substr(xpath.find_last_of('/') + 1) + "/";
|
||||
|
||||
// create output fs structure
|
||||
if (!std::filesystem::exists(out))
|
||||
|
|
Loading…
Reference in a new issue