From bd952dcef2ead3b0b7e2d730930a3fc528813ee0 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 21 Dec 2023 22:27:12 +0100 Subject: systemd: add HYPRLAND_NO_SD_NOTIFY fixes #4217 --- src/helpers/MiscFunctions.cpp | 7 +++++++ src/helpers/MiscFunctions.hpp | 1 + 2 files changed, 8 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 6eab7e2b..5eb99bfd 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -791,4 +791,11 @@ uint32_t glFormatToType(uint32_t gl) { GL_UNSIGNED_INT_2_10_10_10_REV : #endif GL_UNSIGNED_BYTE; +} + +bool envEnabled(const std::string& env) { + const auto ENV = getenv(env.c_str()); + if (!ENV) + return false; + return std::string(ENV) == "1"; } \ No newline at end of file diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp index d8070c76..1ccbdc0e 100644 --- a/src/helpers/MiscFunctions.hpp +++ b/src/helpers/MiscFunctions.hpp @@ -35,6 +35,7 @@ std::vector getBacktrace(); void throwError(const std::string& err); uint32_t drmFormatToGL(uint32_t drm); uint32_t glFormatToType(uint32_t gl); +bool envEnabled(const std::string& env); template [[deprecated("use std::format instead")]] std::string getFormat(std::format_string fmt, Args&&... args) { -- cgit v1.2.3