On Wed, 16 Nov 2005, Isaac Atilano wrote: > I wrote a shell script that toggles my keyboard mapping in my X session > between us and dvorak using setxkbmap. I run it through a button I > created on my desktop panel. I originally tried exporting an environment > variable to use as the toggle flag but then found out that changes to > the variable are not carried over to parent shells (duh!) thus making my > script worthless. To solve this I created a file that contains one > line, namely the toggle value and I read the value with the command: > CURMAP=`cat file` > I then check that value to figure whether I should set the keyboard to > us or dvorak. > I then overwrite the file with the new value. If you use a script to change an environment variable, it will be changed only within the subshell of the script and it will not change the environment from which you called the script. You need to use an alias. Put this line in your .bashrc: alias curmap="CURMAP=value" Just put your value in there instead of "value." Then when you enter "curmap" (without the quotes), it will sent your environment variable. I can't see how anything will carry to *parent* shells. Your script won't do it and neither will this. Mike