Skip to content

Commit bb1da10

Browse files
committed
Make sure xinput is run silently
Users of XWayland/Wayland that has xinput installed will be receiving warning/errors due to xinput being used in a wayland sesison, it's safe to ignore it. We could also try to find if we're in a wayland session by using Xlibs, but I think this would've been overkill
1 parent b0c5da3 commit bb1da10

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Daemon/ydotoold.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,17 @@ int main(int argc, char **argv) {
361361
pid_t npid = vfork();
362362

363363
if (npid == 0) {
364+
// Make sure we don't warning unnecessarily if user is on XWayland session
365+
freopen("/dev/null", "w", stderr);
366+
364367
execl(xinput_path, "xinput", "--set-prop", "pointer:ydotoold virtual device", "libinput Accel Profile Enabled", "0,", "1", NULL);
365-
perror("failed to run xinput command");
368+
printf("failed to run xinput command\n");
366369
_exit(2);
367370
} else if (npid == -1) {
368371
perror("failed to fork");
369372
}
370373
} else {
371-
printf("xinput command not found in `%s', not disabling mouser pointer acceleration", xinput_path);
374+
printf("xinput command not found in `%s', not disabling mouser pointer acceleration\n", xinput_path);
372375
}
373376
}
374377

0 commit comments

Comments
 (0)