Sunday, December 18, 2016

Script not running at startup



I'm an Ubuntu 13.04 user and I'm trying to run a script at startup. I created it in /etc/init.d/, gave it chmod 755 and ran the update-rc.d defaults command. The script is remapping my mouse's keybindings and contains the following:



#! /bin/sh
xinput set-button-map 10 1 2 3 4 5 6 7 9 8


It runs correctly if I do it manually, but I want it to run with startup.




Wouldn't that run it before there's an X Server around for it to interface with?



The simplest way to get this to work would just be to add sh -c "xinput set-button-map 10 1 2 3 4 5 6 7 9 8" to your start-up applications and that'll run it when you log in.



There's also /etc/xdg/autostart for all users, into which you can write .desktop files (look at the existing ones for syntax help).


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...