export HYPRLAND_CMD for scripts

This commit is contained in:
Vaxry 2022-09-19 21:06:44 +01:00
parent ec6144e5da
commit e42de0b778
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,12 @@ int main(int argc, char** argv) {
if (!getenv("XDG_RUNTIME_DIR")) if (!getenv("XDG_RUNTIME_DIR"))
throw std::runtime_error("XDG_RUNTIME_DIR is not set!"); throw std::runtime_error("XDG_RUNTIME_DIR is not set!");
// export HYPRLAND_CMD
std::string cmd = "";
for (auto i = 0; i < argc; ++i)
cmd += std::string(i == 0 ? "" : " ") + argv[i];
setenv("HYPRLAND_CMD", cmd.c_str(), 1);
// parse some args // parse some args
std::string configPath; std::string configPath;
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i) {