From 483302a2cdc3cc8f4854aecb9cb0ed841babe30c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 17 Nov 2023 23:29:30 +0000 Subject: [PATCH] env: add HYPRLAND_NO_RT --- src/helpers/MiscFunctions.cpp | 4 ++++ src/main.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 85a816571dd..712637481f0 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -708,6 +708,10 @@ int64_t configStringToInt(const std::string& VALUE) { } else if (VALUE.starts_with("false") || VALUE.starts_with("off") || VALUE.starts_with("no")) { return 0; } + + if (VALUE.empty() || !isNumber(VALUE)) + return 0; + return std::stoll(VALUE); } diff --git a/src/main.cpp b/src/main.cpp index 40ddf39052b..27a768bad35 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -97,7 +97,8 @@ int main(int argc, char** argv) { g_pCompositor->initServer(); - Init::gainRealTime(); + if (!getenv("HYPRLAND_NO_RT") || configStringToInt(std::string(getenv("HYPRLAND_NO_RT"))) == 0) + Init::gainRealTime(); Debug::log(LOG, "Hyprland init finished.");