2

I'm trying to run on startup via cronjob/rc.local/upstart a script which will change the settings of my mouse. My scripts when invoking xinput echo nothing (they echo as they should when I'm logged in).

When is xinput available? When is it loaded?

I wish to run the following command as root at startup: xinput 1> /var/log/xinput.log 2>&1

1 Answers1

0

I actually had to use xinput for my own mouse to swap the buttons around.

Typically what I do (running KDE, though any distro should have something similar) is open the "startup" application manager. In KDE it's called Autostart. Then you just add your script file and you are done. On next reboot it will load up and your mouse will be working as you set it.

As for doing it in cron or anything else... (at least in cron) DO NOT type out the command itself in cron. I know when I have run scripts in the past in cron it is necessary to point it to the file itself. This will of course cause it to run that file you pointed it to at the specified time.

What else? Make sure your script file is correct. It's completely possible you accidentally did something wrong. I know I did it at first unintentionally just transposing a couple things.

Example file:

mouse.sh

#!/bin/bash
xinput set-button-map "9" 1 2 3 4 5 8 9 6 7 10 11 12 13

(command) (option) ("Device ID") (Button Order)

Carolus
  • 587
David
  • 146
  • 10
  • 1
    Yea I have the script file complete so that's not the issue. I've realized that xinput command isn't working as it should. I'm suspecting that xserver hasn't started before the scripts are run. – Karl Morrison Dec 02 '15 at 04:13