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.

Mother dropped some tea in the keyboard and as a result of that the shift key died.I mean it is always on. I researched and found out that there is a comand to solve that:

xmodmap -e 'keycode 50 = NoSymbol'

so I open terminal and copy paste. Works Perfect.

The only problem is that on startup the order is gone and it is trcky to "teach her" how to do it again.So i like to fix it forever without having to go to the terminal everytime I start the computer...It has been 2 weeks without restarting...:-)

I read a couple of post about "expect " command but could not figure it out.

share|improve this question
    
You don't need to involve a terminal at all. Just run the command at the right time. What release of Ubuntu does that computer run? –  Gilles Jun 26 '12 at 23:21
add comment

3 Answers 3

This may be a bad response, but have you tried outputting the command in the program "Startup Applications"? I had to do that for Conky to start upon login.

share|improve this answer
    
Unfortunately, this will not work until the user logs in. The "Startup Applciations" are run when you log in, not when Ubuntu starts up. –  Aaron Jun 26 '12 at 23:09
    
@Aaron This command needs to be run when the X server runs. Compt's answer is mostly right, but it won't handle the login screen. –  Gilles Jun 26 '12 at 23:16
add comment

To do this, press AltF2, and type in gksudo gedit /etc/init.d/keybordfix.sh. You will be prompted to enter in your password, and then the Gedit Text Editor will appear. Juts add the following two lines of code to the file, and save it with Control-S.

Code:

!#/bin/bash

xmodmap -e 'keycode 50 = NoSymbol'

When Ubuntu starts up, the command you use will be run automatically. The !#/bin/bash line tells Ubuntu to use the Bash shell (information about Bash can be found here)

share|improve this answer
add comment

To execute a script at startup of Ubuntu

Edit /etc/rc.local and add your commands
The script must always end with exit 0 

Source

share|improve this answer
1  
That won't work. The command needs to be executed after the X server starts. /etc/rc.local can't help here. Also, I wouldn't trust a source that claims that /etc/rc.local must end with exit 0, this is not at all necessary. –  Gilles Jun 26 '12 at 23:18
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.