polybar-dwm/src/utils/env.cpp
2016-11-25 21:58:49 +01:00

20 lines
338 B
C++

#include <thread>
#include <utility>
#include "utils/env.hpp"
POLYBAR_NS
namespace env_util {
bool has(const char* var) {
return std::getenv(var) != nullptr;
}
string get(const char* var, string fallback) {
const char* value{std::getenv(var)};
return value != nullptr ? value : move(fallback);
}
}
POLYBAR_NS_END