2

Possible Duplicate:
How to make xinput settings persist after devices are unplugged, replugged, and after shutdown, restart, etc?

How can I run the terminal command sudo xinput set-button-map "Logitech Unifying Device. Wireless PID:101b" 1 10 3 4 5 6 7 8 9 2 at every startup?

user118993
  • 23
  • 1
  • 3

2 Answers2

3

This command affects the GUI, so it must be executed after the GUI is set up. If you can live without your custom mouse button assignment on the login screen, add the command to your startup applications. Don't use sudo, it isn't useful here (and in fact might not work).

With a Gnome interface, the startup applications are in "System > Preferences > Startup Applications". With the Unity interface, they are in "Applications > Other > Startup Applications". See Adding program to session startup in the Ubuntu community documentation for more details.

1

Use Upstart.

description     "Configuring Logitech Unifying Device"

task

# Start when a user logs in graphically
start on desktop-session-start

stop on runlevel [016]

console output

exec xinput set-button-map "Logitech Unifying Device. Wireless PID:101b" 1 10 3 4 5 6 7 8 9 2

The script should be placed in /etc/init/logitech-unifying-device.conf You can use a different name as long as extension is .conf.

I assumed that it is wireless device. However you can exec command on any event you find to be suitable. For details see Upstart Cookbook.