Take the 2-minute tour ×

This question already has an answer here:

I used a command i saw here to make my touch pad in lenovo 330 to scroll with 2 fingers and it worked exactly as i wanted but after each reset to the computer I need to retype the commend. Can you please tell me how i can make this command stay after i close my computer?

share|improve this question
Are you talking about this answer? You tried to comment on it using an answer, which I flagged for removal. –  gertvdijk Jan 26 '13 at 22:53
Possible duplicate of How to start applications at startup automatically? –  Eric Carvalho Jan 26 '13 at 23:12
@EricCarvalho Almost. He'll need to make a script file to run several commands. –  gertvdijk Jan 26 '13 at 23:18
@gertvdijk That's OK, but I still think this question should be rephrased or maybe the answer you pointed should be improved to include persistence between reboots. –  Eric Carvalho Jan 26 '13 at 23:29
add comment

marked as duplicate by Eliah Kagan, Luis Alvarado Mar 2 at 21:25


2 Answers

Depends on the command. If X doesn't need to be running to do it, and it can be run as root, just add it to /etc/rc.local.

share|improve this answer
Well, usually they're depending on X, so running in rc.local isn't really recommended/reliable. I should recommend starting this in the DE session as a startup script. –  gertvdijk Jan 26 '13 at 22:54
add comment

Commands can't "stay" after rebooting the computer. When you shut it down and the power gets cut off, or when you reboot and the memory is cleared, things are gone from the memory.

You can, though, either keep the system state, by hibernating and resuming, or, what I expect to be the best solution for you, run the command after each boot.

As your command is probably something for X Windows, it must be executed after starting X Windows. Here I do that by adding the command to ~/.xinitrc, but that's for startx, I think Ubuntu by default uses a graphical login screen, so you would need to use some other ~/.xsomething file. Perhaps ~/.xprofile?

share|improve this answer
add comment
