start: use nixGL if Hyprland is nix but not NixOS (#12845)
--------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
This commit is contained in:
parent
918e2bb9be
commit
8368566044
5 changed files with 147 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "Instance.hpp"
|
||||
#include "State.hpp"
|
||||
#include "../helpers/Logger.hpp"
|
||||
#include "../helpers/Nix.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
|
@ -54,7 +55,12 @@ void CHyprlandInstance::runHyprlandThread(bool safeMode) {
|
|||
procctl(P_PID, getpid(), PROC_PDEATHSIG_CTL, &sig);
|
||||
#endif
|
||||
|
||||
execvp(g_state->customPath.value_or("Hyprland").c_str(), args.data());
|
||||
if (Nix::shouldUseNixGL()) {
|
||||
argsStd.insert(argsStd.begin(), g_state->customPath.value_or("Hyprland"));
|
||||
args.insert(args.begin(), strdup(argsStd.front().c_str()));
|
||||
execvp("nixGL", args.data());
|
||||
} else
|
||||
execvp(g_state->customPath.value_or("Hyprland").c_str(), args.data());
|
||||
|
||||
g_logger->log(Hyprutils::CLI::LOG_ERR, "fork(): execvp failed: {}", strerror(errno));
|
||||
std::fflush(stdout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue