diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-05-08 15:28:45 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-05-08 15:28:45 +0200 |
| commit | 39dcfa61c3530c2049b9e88afff6b31f5b2bb7fd (patch) | |
| tree | 6b495bdc0c800e85d81d9115731563ed85a60cfb /src | |
| parent | aa5b0d2cda4aa3a06bb80b69dbcbb18ffddb8c8f (diff) | |
Added hyprctl reload
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/ConfigManager.cpp | 5 | ||||
| -rw-r--r-- | src/config/ConfigManager.hpp | 1 | ||||
| -rw-r--r-- | src/debug/HyprCtl.cpp | 8 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 2f114670..2bab2304 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -555,9 +555,10 @@ void CConfigManager::tick() { } // check if we need to reload cfg - if (fileStat.st_mtime != lastModifyTime) { + if (fileStat.st_mtime != lastModifyTime || m_bForceReload) { lastModifyTime = fileStat.st_mtime; - + m_bForceReload = false; + loadConfigLoadVars(); } } diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index 3c2cd38e..fa183cae 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -71,6 +71,7 @@ public: void performMonitorReload(); bool m_bWantsMonitorReload = false; + bool m_bForceReload = false; std::string parseKeyword(const std::string&, const std::string&, bool dynamic = false); diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index d670ea37..5c4f42c1 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -130,6 +130,12 @@ std::string dispatchKeyword(std::string in) { return retval; } +std::string reloadRequest() { + g_pConfigManager->m_bForceReload = true; + + return "ok"; +} + std::string getReply(std::string); std::string dispatchBatch(std::string request) { @@ -177,6 +183,8 @@ std::string getReply(std::string request) { return layersRequest(); else if (request == "version") return versionRequest(); + else if (request == "reload") + return reloadRequest(); else if (request.find("dispatch") == 0) return dispatchRequest(request); else if (request.find("keyword") == 0) |
