Run executables from PATH instead of /usr/bin

Not all distributions install non-system binaries into /usr/bin. For
example, NixOS installs packages to /nix/store using a unique hash
generated from the inputs used to build it:

/nix/store/jld7jh3ilvbg91zvn1bdyawfc55b9jk8-polkit-0.118-bin/bin/pkexec
This commit is contained in:
Kira Bruneau
2021-05-15 19:03:37 -04:00
committed by afayaz-feral
parent 4000a32584
commit 126e67fb6b
5 changed files with 6 additions and 6 deletions

View File

@ -70,7 +70,7 @@ static void print_usage_and_exit(void)
static const char *get_nv_attr(const char *attr)
{
static char out[EXTERNAL_BUFFER_MAX];
const char *exec_args[] = { "/usr/bin/nvidia-settings", "-q", attr, "-t", NULL };
const char *exec_args[] = { "nvidia-settings", "-q", attr, "-t", NULL };
if (run_external_process(exec_args, out, -1) != 0) {
LOG_ERROR("Failed to get %s!\n", attr);
out[0] = 0;
@ -82,7 +82,7 @@ static const char *get_nv_attr(const char *attr)
static int set_nv_attr(const char *attr)
{
const char *exec_args_core[] = { "/usr/bin/nvidia-settings", "-a", attr, NULL };
const char *exec_args_core[] = { "nvidia-settings", "-a", attr, NULL };
if (run_external_process(exec_args_core, NULL, -1) != 0) {
LOG_ERROR("Failed to set %s!\n", attr);
return -1;