Re: xmodmap, readline, and ye olde meta key
Re: xmodmap, readline, and ye olde meta key
- Subject: Re: xmodmap, readline, and ye olde meta key
- From: Doug Carter <email@hidden>
- Date: Fri, 31 Dec 2010 08:41:36 -0800
Hi James,
On Fri, Dec 31, 2010 at 12:33:30AM -0500, James K. Lowden wrote:
> Greetings,
>
> I got a brand new MacBook Pro running 10.6.5 for Christmas. I'm having a
> little trouble understanding how X and xterms are initialized, and what I
> can and can't expect to work. My search of this list's archives finds
> many references to readline, but most of them seem to have to do with
> emacs or some Java thing.
>
> My issue is with bash. Specifically, I'd like:
>
> 1. move-by-word to work by pressing alt-f and alt-b
It's really more of a X config thing, not directly related to bash.
The default meta key is the command key, (the key with a Bowen knot image)
right next to the alt/option key. If you want to change your meta key,
you need to remap it with xmodmap.
> 2. bash to run ${HOME}/.profile when I press cmd-n to open a new xterm
You are correct in your statement below. "xterm -ls" will open an xterm
as a login window, which will read all of the standard profile files.
> 3. to invoke xmodmap when X initializes
By default at startup, X will run any xmodmap commands in $HOME/.Xmodmap,
if it exists. If you want to swap the command and alt keys (so you can
use alt-f to move-by-word) create $HOME/.Xmodmap with this content:
clear Mod1
clear Mod2
keycode 63 = Mode_switch
keycode 66 = Meta_L
keycode 69 = Meta_R
add Mod1 = Meta_L
add Mod1 = Meta_R
add Mod2 = Mode_switch
Then restart X to pickup the new settings.
Lastly, if there are other server default behaviors you want on startup,
add a shell script to the $HOME/.xinitrc.d/ directory. For example,
I turn off the bell volume by creating $HOME/.xinitrc.d/belloff.sh,
with this content in the file:
/opt/X11/bin/xset -b
Hope this helps,
Doug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden