core: add --verify-config to verify the config with Hyprland
fixes #9135
This commit is contained in:
parent
80b2fd135b
commit
d8f79d7678
7 changed files with 69 additions and 25 deletions
|
|
@ -22,6 +22,7 @@
|
|||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <ranges>
|
||||
#include <print>
|
||||
#include <unordered_set>
|
||||
#include "debug/HyprCtl.hpp"
|
||||
#include "debug/CrashReporter.hpp"
|
||||
|
|
@ -162,7 +163,10 @@ void CCompositor::restoreNofile() {
|
|||
Debug::log(ERR, "Failed restoring NOFILE limits");
|
||||
}
|
||||
|
||||
CCompositor::CCompositor() : m_iHyprlandPID(getpid()) {
|
||||
CCompositor::CCompositor(bool onlyConfig) : m_bOnlyConfigVerification(onlyConfig), m_iHyprlandPID(getpid()) {
|
||||
if (onlyConfig)
|
||||
return;
|
||||
|
||||
m_szHyprTempDataRoot = std::string{getenv("XDG_RUNTIME_DIR")} + "/hypr";
|
||||
|
||||
if (m_szHyprTempDataRoot.starts_with("/hypr")) {
|
||||
|
|
@ -226,7 +230,7 @@ CCompositor::CCompositor() : m_iHyprlandPID(getpid()) {
|
|||
}
|
||||
|
||||
CCompositor::~CCompositor() {
|
||||
if (!m_bIsShuttingDown)
|
||||
if (!m_bIsShuttingDown && !m_bOnlyConfigVerification)
|
||||
cleanup();
|
||||
}
|
||||
|
||||
|
|
@ -262,6 +266,16 @@ static bool filterGlobals(const wl_client* client, const wl_global* global, void
|
|||
//
|
||||
void CCompositor::initServer(std::string socketName, int socketFd) {
|
||||
|
||||
if (m_bOnlyConfigVerification) {
|
||||
g_pHookSystem = makeUnique<CHookSystemManager>();
|
||||
g_pKeybindManager = makeUnique<CKeybindManager>();
|
||||
g_pAnimationManager = makeUnique<CHyprAnimationManager>();
|
||||
g_pConfigManager = makeUnique<CConfigManager>();
|
||||
|
||||
std::println("\n\n======== Config parsing result:\n\n{}", g_pConfigManager->verify());
|
||||
return;
|
||||
}
|
||||
|
||||
m_sWLDisplay = wl_display_create();
|
||||
|
||||
wl_display_set_global_filter(m_sWLDisplay, ::filterGlobals, nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue