Next: (heks-linux lambdock), Previous: (heks-linux gtk), Up: API
Renders ~/.config/kitty/kitty.conf.
kitty’s configuration language is terse but has sharp edges: key
bindings are expressed as map <mods>+<key> <action>, where
modifiers are spelled out in full (ctrl, alt,
shift, super) and joined with a +, while the action
may or may not take arguments. The module keeps the ergonomic short
forms used everywhere else in this repository (C, M,
S, s) in kitty-bindings and translates them in
translate-kitty-mods, so the binding table reads the same way as
the Niri and Alacritty ones.
The generated file uses the same Emacs-flavoured clipboard bindings as the other terminals (Ctrl+Y paste, Alt+W copy) so muscle memory is portable across them.
Transparency is delegated to the compositor: kitty declares
background_opacity and leaves background_blur off, because
Niri already applies a blur effect to the kitty window (see
niri-blur-rules).
Two kitty settings exist mainly to serve other Heks Linux features:
allow_remote_control plus listen_on let external tools -
most notably the Emacs bridges and the RMPC launcher - drive a running
kitty.
Default value:
"/root/.config/kitty"
Default value:
"kitty.conf"
Write the kitty configuration to kitty-config-dir.
Local overrides are read from
$XDG_CONFIG_HOME/heks-linux/kitty-settings.scm first, then the
configuration and the binding table are serialized into one file.
Return the list of rendered kitty key-binding lines.
The set is intentionally small and Emacs-flavoured: clipboard access,
font resizing and scrollback navigation. The font-size and scrollback
bindings use kitty’s own kitty_mod (ctrl+shift) spellings -
equal, plus, minus, page_up,
page_down, home and end - because kitty silently
ignores a map line whose key name it does not recognise.
Everything else is left to kitty’s defaults so that upstream additions
keep working.
Scrollback paging deliberately avoids C-v and M-v: unlike Alacritty, kitty has no way to make a binding conditional on the alternate screen, so any binding on those chords would be taken from the pager for good. The pager owns them (see the shared lesskey file: forw-screen / back-screen), so kitty pages its scrollback with C-S-page_up / C-S-page_down instead.
Return the kitty configuration as a mixed list of comment strings and pairs.
The result is fed to mk-kv-conf-lines with the
spaced-conf-pair template, giving kitty’s key value
syntax. Colours come from the current palette, the terminal font comes
from heks-linux-mono-font, and the map lines produced by
kitty-bindings are appended at the end.
(mk-kv-conf-lines (kitty-config) #:template spaced-conf-pair)
Render a single kitty map line.
mods uses the short modifier syntax translated by
translate-kitty-mods, k is the key and action is
either a symbol (rendered bare, e.g. paste_from_clipboard) or a
full action string with arguments (e.g. change_font_size all
+2.0).
For example, the mods C with the key y and the action
paste_from_clipboard renders the standard clipboard-paste
mapping.
Translate the project’s short modifier syntax into kitty’s spelling.
C becomes ctrl, M becomes alt, S
becomes shift and s becomes super; unknown parts
are passed through unchanged so that literal key names survive.
For example, the mods C-S become ctrl+shift.
Next: (heks-linux lambdock), Previous: (heks-linux gtk), Up: API