keymap for Linux apps on Chromebook

324 views
Skip to first unread message

Alan Bram

unread,
Jun 28, 2022, 2:41:47 AM6/28/22
to chromium-hterm
I have installed "Linux apps" on my Chromebook (or, apparently it's now called "Linux development environment"). Then I used "apt" to install the emacs-lucid Debian package. This runs a graphical Emacs, in its own window, with full mouse support, graphical menus, etc.; and it's wonderful!

Does this use hterm at all? or is that completely separate?

The reason I ask is, the keyboard mappings are not quite right, and I'm wondering if there is some way I could modify them (I gather that hterm does offer such a configuration capability).

Mike Frysinger

unread,
Jun 28, 2022, 2:51:57 AM6/28/22
to Alan Bram, chromium-hterm
the Terminal app uses hterm, but it doesn't currently have a keybindings editor

however, you seem to be asking about the graphical emacs mode.  i'm not an emacs users, so i can be wrong, but i'm fairly certain this mode doesn't go through Terminal or hterm at all and handles everything itself.  so i don't know the actual answer to your question, sorry.
-mike

--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-hter...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/f1ade24f-e2c0-4d9b-8397-7de41bbaed9fn%40chromium.org.

Lester Longley

unread,
Jun 28, 2022, 8:53:20 AM6/28/22
to Mike Frysinger, Alan Bram, chromium-hterm
Hi Alan,

(1) if you start emacs as "emacs --no-window-system ...", then it will be operating in hterm
You can make some adjustments from Terminal → Settings (or Ctrl+Shift+P).

In addition, changes here also affect Terminal (I think):
chrome-untrusted://terminal/html/nassh_preferences_editor.html#options_Keyboard (paste that into Chrome)→ Keyboard bindings/shortcuts


(2) otherwise, if you're using emacs in default X windows mode, there are some mappings ("accelerators") which you can change if you launch w/ "sommelier"

Further down this page, in "Examples", see:

Start sommelier that runs gedit with some accelerators reserved to the host compositor instead of being sent to gedit:

$ sommelier --accelerators="<Alt>Bracketright,<Alt>Bracketleft" gedit

I usually launch emacs as

sommelier -X --accelerators="<Alt>Bracketright,<Alt>Bracketleft,<Alt>minus,<Alt>equal" --frame-color=#24282c emacs --display :0 ...

... so that Alt+[, Alt+], Alt+-, Alt+= can be used for system-standard dock left, dock right, minimize, and maximize, respectively.

(I believe that only "Alt+[" and "Alt+]" are configured, by default.)



Dock a window on the left
Alt + [ (left square bracket)
Maximize windowAlt + =
Minimize windowAlt + - (minus)
Dock a window on the right

Alt + ] (right square bracket)


If you launch as per above, you may see some warnings from "xkbcomp". (I filter these out w/  "sommelier -X ... emacs -d :0 ... 2>&1 | grep -v ...", though there may be cleaner ways.)

And of course, also see

sommelier --help
usage: sommelier [options] [program] [args...]

options:
  -h, --help                    Print this help
  -X                            Enable X11 forwarding
  --parent                      Run as parent and spawn child processes
  --socket=SOCKET               Name of socket to listen on
  --display=DISPLAY             Wayland display to connect to
  --scale=SCALE                 Scale factor for contents
  --dpi=[DPI[,DPI...]]          DPI buckets
  --peer-cmd-prefix=PREFIX      Peer process command line prefix
  --accelerators=ACCELERATORS   List of keyboard accelerators
  --application-id=ID           Forced application ID for all X11 windows
  --vm-identifier=NAME          Name of the VM, used to identify X11 windows.
                                Ignored if --application-id is set.
  --application-id-x11-property=PROPERTY
        A cardinal window property used to identify X11 windows, as follows:
          org.chromium.<vm-identifier>.xprop.<application-id-x11-property>
        Ignored if --application-id is set.
  --x-display=DISPLAY           X11 display to listen on
  --xwayland-path=PATH          Path to Xwayland executable
  --xwayland-gl-driver-path=PATH        Path to GL drivers for Xwayland
  --xwayland-cmd-prefix=PREFIX  Xwayland command line prefix
  --no-exit-with-child          Keep process alive after child exists
  --no-clipboard-manager        Disable X11 clipboard manager
  --frame-color=COLOR           Window frame color for X11 clients
  --no-support-damage-buffer    Disable wl_surface::damage_buffer support.
  --virtwl-device=DEVICE        VirtWL device to use
  --drm-device=DEVICE           DRM device to use
  --glamor                      Use glamor to accelerate X11 clients
  --timing-filename=PATH        Path to timing output log
  --trace-filename=PATH         Path to Perfetto trace filename
  --trace-system                Perfetto trace to system daemon
  --fullscreen-mode=MODE        Default fullscreen behavior (immersive, plain)

(You might find the "--scale" and "--dpi" options helpful, dep. on your screen resolution, whether you're using an external monitor, and so forth.)

An alternative approach (which I haven't tried myself) is described in https://www.reddit.com/r/Crostini/wiki/enable-chrome-shortcuts-in-linux-apps

Regards,
Lester

Chris Gerber

unread,
Jun 28, 2022, 9:03:56 AM6/28/22
to chromium-hterm, sf.f...@gmail.com
The graphical version of Emacs does not use hterm. Which keyboard mappings are you having trouble with? You can try enabling the flag chrome://flags#deprecate-alt-based-six-pack to free up some of the ChromeOS shortcuts (like Alt+<arrows>) to be passed through to the Linux development environment and then used by Emacs.

Alan Bram

unread,
Jun 29, 2022, 10:49:14 AM6/29/22
to chromium-hterm, gerb...@gmail.com
Thanks, everyone!

My complaint was that Alt+Backspace was getting transformed to <delete> before being passed through to Emacs. I was able to fix this by turning on the #deprecate-alt-based-six-pack flag. This Google support thread clarified for me that the six Alt mappings are redundant (they're available via the Search key, n.k.a. "Everything" key).

Thanks for indulging me in what turned out to be irrelevant to hterm!

Reply all
Reply to author
Forward
0 new messages