Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have the file ~/.xmodmap where i swap a few keys on my keyboard. This file was loaded properly on my previous Ubuntu desktop but since the upgrade to 12.04 it's no longer loaded when I login to my desktop.

What's the proper way to execute commands when we login to the desktop in ubuntu 12.04?

share|improve this question
    
Try putting the xmodmap command in with the rest of your startup apps. –  Chan-Ho Suh Apr 18 '12 at 8:11
add comment

3 Answers

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

share|improve this answer
add comment

Actually there is a way to execute user specific commands during boot up time. The commands or scripts that we want to execute should be added to the script /etc/rc.local

The script /etc/rc.local will be similar to a shell script. Make sure it's exit status is 0, add the following line to that script "exit 0".

This /etc/rc.local script is executed at the end of each multiuser runlevel.

Thanks & Regards,

M Ram Murthy

share|improve this answer
1  
This answer is incorrect. rc.local is a shell script, and is executed outside of the X environment, and indeed as root, so it won't work for this requirement. –  Robin Green Aug 28 '12 at 12:28
add comment

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)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.