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: Thu, 30 Dec 2010 22:30:05 -0800
On Dec 30, 2010, at 21:33, 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
That's not really an X11 issue. That's a bash issue. You should create/edit /etc/inputrc or ~/.inputrc ... Search google for help (or possibly just copy over whatever you had from your old system that supported that behavior).
> 2. bash to run ${HOME}/.profile when I press cmd-n to open a new xterm
Then you want a login xterm. Edit ~/.Xdefaults appropriately or change the command invoked by editing the Applications menu.
> 3. to invoke xmodmap when X initializes
It is (by xinitrc). Edit ~/.Xmodmap with what you want.
>
> (Regarding #2, I think I want "xterm -ls".)
>
> If this is documented in the man pages, I'd appreciate a pointer. (The
> docs could use a little TLC. X(1)
I assume you mean X(7) ... I don't think there is an X(1). The Xorg docs have been needing TLC for quite some time and this past year has seed a *TON* of documentation progress. As for your specific complaint here, the newer versions of X(7) refer to XQuartz(1) rather than XDarwin(1).
> refers to XDarwin, which has no man
> page, in SEE ALSO. xinit(1) mentions Xquartz without aaying anything
> about how Xquartz supersedes some of what xinit claims to do.
XQuartz doesn't supersede anything that xinit does. XQuartz is a DDX.
> I find no
> reliable information on whether or no ${HOME}/.xinitrc is supposed to
> work.
As with all recent distributions, ~/.xinitrc is deprecated in favor of ~/.xinitrc.d, but it will work ... chances are your ~/.xinitrc as why xmodmap wasn't being run.
> When I tried, it prevented X from starting.)
What did you put in it? What errors were printed (to /var/log/system.log)?
> Back in the XFree86 days
So glad those are over
> on my G4, alt-f and alt-b moved forward and back
> by word on the command line
That has nothing to do with XFree86. That's a shell feature.
> , much as they do on my PC keyboard running
> NetBSD.
Ok, so copy your inputrc from NetBSD.
> I would like that to work on my new machine, too.
>
> I think I could do this with xmodmap(1)
Nope ... nothing to do with xmodmap.
> or ~/.inputrc (for readline(3))
yep.
> or
> with defaults(1).
Nope. That is just for editing NSDefaults ... which has nothing to do with what you're talking about here.
> Having tried and failed with xmodmap, I'm guessing I
> should use defaults, but I'd like to understand why.
>
> With the following, bash lets me move back and forth by word using
> cmd-alt-b and cmd-alt-f (!) Which knob do I turn to relieve me of using
> the cmd key?
~/.inputrc
>
> $ xmodmap -p
> xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
>
> shift Shift_L (0x40), Shift_R (0x44)
> lock Caps_Lock (0x41)
> control Control_L (0x43), Control_R (0x46)
> mod1 Meta_L (0x42), Mode_switch (0x45)
> mod2 Meta_L (0x3f), Meta_R (0x47)
> mod3
> mod4
> mod5
> $ cat ~/.xmodmaprc
> keycode 84 = Multi_key
> keycode 66 = Meta_L
So you want to remap KP_Enter to Multi_Key and one of your alts to be another Meta? If you do that, you should also make sure you move 66 to mod2 instead of mod1 or things will freak out (I'm not sure why you would want that though). This is an issue still purely in X11 land and has nothing to do with XQuartz.
> (keycode 84 was the "Enter" (not return) on my old Powerbook. I see that
> key's gone now. What's your favorite Compose key?)
I think Fn+Return will still send that keycode (not that it's much help for you).
I actually don't use Multi_key. I do map one of my alts to Mode_switch and the other to Alt. You've got 3 metas in your current list, you might as well repurpose one of them.
>
> $ defaults read org.x.X11
> {
> "NSWindow Frame x11_prefs" = "266 365 484 330 0 0 1920 1178 ";
> "app_to_run" = "/usr/X11/bin/xterm";
> "cache_fonts" = 1;
> "done_xinit_check" = 1;
> "enable_fake_buttons" = 1;
> "enable_key_equivalents" = 1;
> "login_shell" = "/bin/sh";
> "no_auth" = 0;
> "nolisten_tcp" = 1;
> "sync_keymap" = 0;
> }
>
> Below are messages from the console, in case that helps. It seems to show
> X11.app invoking xterm without options via /bin/sh. Not sure how to get
> it to pass "-ls".
That's just the initial "app_to_run" in defaults which is an unfortunate bit of legacy-foo to cause an xterm to run upon launching X11.app. You can disable it by setting app_to_run to /bin/true or you can edit it to anything you want (including xterm -ls).
>
> Many thanks for any guidance.
>
> --jkl
>
> 12/30/10 12:21:57 AM [0x0-0x38038].org.x.X11[5417] Quitting Xquartz...
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: main():
> argc=2
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[0] =
> /Applications/Utilities/X11.app/Contents/MacOS/X11.bin
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[1] =
> -psn_0_245820
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] Waiting for startup
> parameters via Mach IPC.
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Listening
> on socket for fd handoff: (4) /var/tmp/tmp.0.mV2bJ4
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Thread
> created for handoff. Returning success to tell caller to connect and push
> the fd.
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Received
> new $DISPLAY fd: 6 ... sleeping to allow xinitrc to catchup.
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app:
> do_start_x11_server(): argc=6
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[0] =
> /usr/X11/bin/X
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[1] = :0
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[2] =
> -nolisten
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[3] = tcp
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[4] = -auth
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[5] =
> /Users/jklowden/.serverauth.5644
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] Xquartz starting:
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X.Org X Server
> 1.4.2-apple56
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] Build Date: 20100624
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] (EE) XKB: Couldn't
> open rules file /usr/X11/share/X11/xkb/rules/base
> 12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] (EE) XKB: Couldn't
> open rules file /usr/X11/share/X11/xkb/rules/base
> 12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] X11.app Handing off
> fd to server thread via DarwinListenOnOpenFD(6)
> 12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634]
> DarwinListenOnOpenFD: 6
> 12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] Calling
> ListenOnOpenFD() for new fd: 6
> 12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Launching
> /usr/X11/bin/xterm:
> 12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] argv[0] = /bin/sh
> 12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] argv[1] = -c
> 12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] argv[2] =
> /usr/X11/bin/xterm
> 12/30/10 10:15:15 PM [0x0-0x3c03c].org.x.X11[5634] mieqEnequeue:
> out-of-order valuator event; dropping.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> X11-users mailing list (email@hidden)
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden