I'm using Xfce in Linux, and I need to run the following command at every startup, otherwise my touchpad is impossible to use: xinput --set-prop 13 'Synaptics Finger' 12, 12, 0

I've put the command in a shell script which works fine if I manually execute it.

The problem I'm having is making it run on startup. I can't add it to /etc/rc.local, because this is executed before X starts, and an xinput command won't work without X started. Also, I can't place the script in my startup programs (i.e. by placing it in a .desktop file in ~/.config/autostart), because things here are executed only after I log in. But I want to use my touchpad to log in, and I can't use it until after the xinput script has been run.

So is there any way I can run the script on startup before I log in?


I think the place to do that would be your display manager. For example, if you use gdm3, you can drop that line of code into


To quote the man page gdm3(8):

When managing a display, gdm3 attempts to execute


An even better place to put that bit of code would be your xinitrc. On my Debian box, for example, this lives under /etc/X11/xinit/xinitrc.

  • Is adding the line to /etc/X11/xinit/xinitrc preferable to adding it to ~/.xinitrc or ~/.xsession? – EmmaV Sep 29 '14 at 15:48
  • @EmmaV for your personal computer, it shouldn't make much of a difference. The only difference that I know of is that putting it in your home affects your user account only. – Joseph R. Sep 29 '14 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.