Skip to content

Commit de4d908

Browse files
committed
Support for invoking xinput command in ydotoold to disable mouse accel
1 parent e9d4ed8 commit de4d908

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Daemon/ydotoold.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,24 @@ int main(int argc, char **argv) {
352352

353353
uinput_setup(fd_ui, opt_ui_setup);
354354

355+
sleep(1);
356+
357+
const char *xinput_path = "/usr/bin/xinput";
358+
359+
if (stat(xinput_path, &sbuf) == 0) {
360+
pid_t npid = vfork();
361+
362+
if (npid == 0) {
363+
execl(xinput_path, "xinput", "--set-prop", "pointer:ydotoold virtual device", "libinput Accel Profile Enabled", "0,", "1", NULL);
364+
perror("failed to run xinput command");
365+
_exit(2);
366+
} else if (npid == -1) {
367+
perror("failed to fork");
368+
}
369+
} else {
370+
printf("xinput command not found in `%s', not disabling mouser pointer acceleration", xinput_path);
371+
}
372+
355373
puts("READY");
356374

357375
struct input_event uev;

0 commit comments

Comments
 (0)