I am trying to disable a device at boot.
I have put my commands in the /etc/rc.local
file (before the exit 0
) but it doesn't seem to work.
Here is how my file looks like :
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "OK 1" >> /tmp/rclocal_test
xinput disable "N-trig DuoSense"
xinput disable "N-trig DuoSense Pen"
echo "OK 2" >> /tmp/rclocal_test
exit 0
In my rclocal_test
file, I only get OK 1
.
When I execute rc.local
from shell once the system is started, it works fine.
I also tried to put the commands in the gnome-session-properties
thing but nothing happens either.
I am suspecting it is a problem of timing (maybe I cannot execute xinput disable
at that time ?). Do you have any idea ?