summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2024-09-25 10:36:43 +0100
committervaxerski <vaxry@vaxry.net>2024-09-25 10:36:51 +0100
commit2a052c69f36a71fb473262f57039b8ac81518ad3 (patch)
tree637def56cae5e45778a49b6866fc96776307a2b9 /src/debug
parent2320b2241c0713b8d81e8f467cb99bd4179ad23b (diff)
core: add a --systeminfo parameter to gather systeminfo without running
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/HyprCtl.cpp11
-rw-r--r--src/debug/HyprCtl.hpp3
2 files changed, 10 insertions, 4 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 178e9ba8..0229a803 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -943,11 +943,14 @@ std::string systemInfoRequest(eHyprCtlOutputFormat format, std::string request)
result += "os-release: " + execAndGet("cat /etc/os-release") + "\n\n";
result += "plugins:\n";
- for (auto const& pl : g_pPluginSystem->getAllPlugins()) {
- result += std::format(" {} by {} ver {}\n", pl->name, pl->author, pl->version);
- }
+ if (g_pPluginSystem) {
+ for (auto const& pl : g_pPluginSystem->getAllPlugins()) {
+ result += std::format(" {} by {} ver {}\n", pl->name, pl->author, pl->version);
+ }
+ } else
+ result += "\tunknown: not runtime\n";
- if (g_pHyprCtl->m_sCurrentRequestParams.sysInfoConfig) {
+ if (g_pHyprCtl && g_pHyprCtl->m_sCurrentRequestParams.sysInfoConfig) {
result += "\n======Config-Start======\n";
result += g_pConfigManager->getConfigString();
result += "\n======Config-End========\n";
diff --git a/src/debug/HyprCtl.hpp b/src/debug/HyprCtl.hpp
index cbacd7cb..d68bf14f 100644
--- a/src/debug/HyprCtl.hpp
+++ b/src/debug/HyprCtl.hpp
@@ -5,6 +5,9 @@
#include "../helpers/MiscFunctions.hpp"
#include <functional>
+// exposed for main.cpp
+std::string systemInfoRequest(eHyprCtlOutputFormat format, std::string request);
+
class CHyprCtl {
public:
CHyprCtl();