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.");