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: Jeremy Huddleston <email@hidden>
- Date: Fri, 31 Dec 2010 12:33:54 -0800
On Dec 31, 2010, at 08:41, Doug Carter wrote:
>
> 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.
But that will result in changing the key binding for *ALL* X11 clients. Changing the binding in inputrc will make things continue to work properly in all other X11 applications. Also, he wants this for bash, so I assume he wants this functionality when he ssh's in or uses Terminal.app ... in which case this really has nothing to do with X11.
>
>> 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
This config is still leaving 71 as another Meta_R (and leaving it untied to a mod). Plus I believe emacs is still handicapped and needs mod2 to be meta (hence why it was setup that way by default).
>
> 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
Make sure the script is set executable or it will be ignored. It's sourced by xinitrc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden