diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-11-10 13:39:23 +0000 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-11-10 13:39:23 +0000 |
| commit | 851df11eb595c5863bb931c32cbaa446c7071813 (patch) | |
| tree | e64d48e7effeb910f66852b93fc8eb446f6f409c /src/config/ConfigManager.hpp | |
| parent | 5f2c741f49245e90b46b2912f78cd2f3ba33d36a (diff) | |
Added exec rules
Diffstat (limited to 'src/config/ConfigManager.hpp')
| -rw-r--r-- | src/config/ConfigManager.hpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index e390a93b..b78cb273 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -71,14 +71,19 @@ struct SAnimationPropertyConfig { SAnimationPropertyConfig* pParentAnimation = nullptr; }; +struct SExecRequestedRule { + std::string szRule = ""; + uint64_t iPid = 0; +}; + class CVarList { public: - CVarList(const std::string& in, long unsigned int lastArgNo = 0) { + CVarList(const std::string& in, long unsigned int lastArgNo = 0, const char separator = ',') { std::string curitem = ""; std::string argZ = in; auto nextItem = [&]() { - auto idx = lastArgNo != 0 && m_vArgs.size() >= lastArgNo - 1 ? std::string::npos : argZ.find_first_of(','); + auto idx = lastArgNo != 0 && m_vArgs.size() >= lastArgNo - 1 ? std::string::npos : argZ.find_first_of(separator); if (idx != std::string::npos) { curitem = argZ.substr(0, idx); @@ -109,7 +114,13 @@ public: return m_vArgs[idx]; } -private: + // for range-based loops + std::vector<std::string>::iterator begin() { return m_vArgs.begin(); } + std::vector<std::string>::const_iterator begin() const { return m_vArgs.begin(); } + std::vector<std::string>::iterator end() { return m_vArgs.end(); } + std::vector<std::string>::const_iterator end() const { return m_vArgs.end(); } + + private: std::vector<std::string> m_vArgs; }; @@ -160,6 +171,8 @@ public: SAnimationPropertyConfig* getAnimationPropertyConfig(const std::string&); + void addExecRule(SExecRequestedRule); + std::string configCurrentPath; private: @@ -179,6 +192,8 @@ private: std::vector<std::pair<std::string, std::string>> boundWorkspaces; + std::vector<SExecRequestedRule> execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty + bool isFirstLaunch = true; // For exec-once std::deque<SMonitorRule> m_dMonitorRules; |
