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?
-
Are you talking about this answer? You tried to comment on it using an answer, which I flagged for removal.– gertvdijkJan 26, 2013 at 22:53
-
1Possible duplicate of How to start applications at startup automatically?– Eric CarvalhoJan 26, 2013 at 23:12
-
@EricCarvalho Almost. He'll need to make a script file to run several commands.– gertvdijkJan 26, 2013 at 23:18
-
1@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 CarvalhoJan 26, 2013 at 23:29
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
.
-
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. Jan 26, 2013 at 22:54
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
?