summaryrefslogtreecommitdiff
path: root/src/helpers/env/Env.cpp
blob: 606d5f728cf70deb42401ca0eeda44d807c3bec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "Env.hpp"

#include <cstdlib>
#include <string_view>

bool Env::envEnabled(const std::string& env) {
    auto ret = getenv(env.c_str());
    if (!ret)
        return false;

    const std::string_view sv = ret;

    return !sv.empty() && sv != "0";
}

bool Env::isTrace() {
    static bool TRACE = envEnabled("HYPRLAND_TRACE");
    return TRACE;
}