How to run commands at login on ubuntu 12.04?

Solution 1:

search for "startup applications" in your dash. -Click on add -Name it and enter the command you want to execute -Click ok and restart to verify

Solution 2:

Use "greeter-setup-script" and "session-setup-script" with Lightdm in /etc/lightdm/lightdm.conf.

The greeter-setup-script option runs the script (as root) before login.

greeter-setup-script = (Script to run when starting a greeter)

The session-setup script runs the script (as root) after login.

session-setup-script = (Script to run when starting a user session)