From 851df11eb595c5863bb931c32cbaa446c7071813 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 10 Nov 2022 13:39:23 +0000 Subject: Added exec rules --- src/config/ConfigManager.hpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/config/ConfigManager.hpp') 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::iterator begin() { return m_vArgs.begin(); } + std::vector::const_iterator begin() const { return m_vArgs.begin(); } + std::vector::iterator end() { return m_vArgs.end(); } + std::vector::const_iterator end() const { return m_vArgs.end(); } + + private: std::vector 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> boundWorkspaces; + std::vector execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty + bool isFirstLaunch = true; // For exec-once std::deque m_dMonitorRules; -- cgit v1.2.3