From bb1da10948f4b019fc2a591d8390005a3be3ae9f Mon Sep 17 00:00:00 2001 From: Andre Paiusco <2374887+Paiusco@users.noreply.github.com> Date: Fri, 18 Oct 2024 23:54:57 +0200 Subject: [PATCH] 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 --- Daemon/ydotoold.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Daemon/ydotoold.c b/Daemon/ydotoold.c index de09904..fed38d7 100644 --- a/Daemon/ydotoold.c +++ b/Daemon/ydotoold.c @@ -361,14 +361,17 @@ int main(int argc, char **argv) { pid_t npid = vfork(); if (npid == 0) { + // Make sure we don't warning unnecessarily if user is on XWayland session + freopen("/dev/null", "w", stderr); + execl(xinput_path, "xinput", "--set-prop", "pointer:ydotoold virtual device", "libinput Accel Profile Enabled", "0,", "1", NULL); - perror("failed to run xinput command"); + printf("failed to run xinput command\n"); _exit(2); } else if (npid == -1) { perror("failed to fork"); } } else { - printf("xinput command not found in `%s', not disabling mouser pointer acceleration", xinput_path); + printf("xinput command not found in `%s', not disabling mouser pointer acceleration\n", xinput_path); } }