diff options
author | Vaxry <[email protected]> | 2024-02-09 19:42:19 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-02-09 19:42:19 +0000 |
commit | 56a30712b5c2ccf247e555cf58a35a110fa173d9 (patch) | |
tree | b6e50fffde2446ff838459163340b857a05f1c35 | |
parent | 8c5c65dbfb02e89b6689dd517f82bbb6c127de16 (diff) | |
download | Hyprland-56a30712b5c2ccf247e555cf58a35a110fa173d9.tar.gz Hyprland-56a30712b5c2ccf247e555cf58a35a110fa173d9.zip |
oops missed exec-once
-rw-r--r-- | src/config/ConfigManager.cpp | 22 | ||||
-rw-r--r-- | src/config/ConfigManager.hpp | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index ba110123..1543b194 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -88,6 +88,18 @@ static Hyprlang::CParseResult handleRawExec(const char* c, const char* v) { return result; } +static Hyprlang::CParseResult handleExecOnce(const char* c, const char* v) { + const std::string VALUE = v; + const std::string COMMAND = c; + + const auto RESULT = g_pConfigManager->handleExecOnce(COMMAND, VALUE); + + Hyprlang::CParseResult result; + if (RESULT.has_value()) + result.setError(RESULT.value().c_str()); + return result; +} + static Hyprlang::CParseResult handleMonitor(const char* c, const char* v) { const std::string VALUE = v; const std::string COMMAND = c; @@ -511,6 +523,7 @@ CConfigManager::CConfigManager() { // keywords m_pConfig->registerHandler(&::handleRawExec, "exec", {false}); + m_pConfig->registerHandler(&::handleExecOnce, "exec-once", {false}); m_pConfig->registerHandler(&::handleMonitor, "monitor", {false}); m_pConfig->registerHandler(&::handleBind, "bind", {true}); m_pConfig->registerHandler(&::handleUnbind, "unbind", {false}); @@ -1386,7 +1399,6 @@ std::string CConfigManager::getDefaultWorkspaceFor(const std::string& name) { } std::optional<std::string> CConfigManager::handleRawExec(const std::string& command, const std::string& args) { - // Exec in the background dont wait for it. if (isFirstLaunch) { firstExecRequests.push_back(args); return {}; @@ -1396,6 +1408,14 @@ std::optional<std::string> CConfigManager::handleRawExec(const std::string& comm return {}; } +std::optional<std::string> CConfigManager::handleExecOnce(const std::string& command, const std::string& args) { + if (isFirstLaunch) { + firstExecRequests.push_back(args); + return {}; + } + return {}; +} + static bool parseModeLine(const std::string& modeline, drmModeModeInfo& mode) { auto args = CVarList(modeline, 0, 's'); diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index f90754cc..85983f16 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -143,6 +143,7 @@ class CConfigManager { // keywords std::optional<std::string> handleRawExec(const std::string&, const std::string&); + std::optional<std::string> handleExecOnce(const std::string&, const std::string&); std::optional<std::string> handleMonitor(const std::string&, const std::string&); std::optional<std::string> handleBind(const std::string&, const std::string&); std::optional<std::string> handleUnbind(const std::string&, const std::string&); |