mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 11:32:42 +00:00
docs: add kitty‑day‑save support and update related documentation
This commit is contained in:
1 parent
7e2ae53560
commit
472695e596
6 files changed
+39
-12
No files matched your search
@@ -61,7 +61,7 @@ Colors come from the active Omarchy theme; it is included last so it wins. `syml
|
||||
| `allow_remote_control` | `socket-only` |
|
||||
| `listen_on` | `unix:@kitty-{kitty_pid}` |
|
||||
| `enabled_layouts` | `splits:split_axis=vertical,stack` |
|
||||
| Tab bar | `powerline`, `angled`, aligned left, top edge, `tab_title_template "{custom}"` |
|
||||
| Tab bar | `powerline`, `slanted`, centered, top edge, always shown (`tab_bar_min_tabs 1`, so the stack-layout indicator is visible with one tab), `tab_title_template "{custom}"` |
|
||||
|
||||
:::note
|
||||
Transparency uses kitty's own alpha, so text stays opaque. This alpha is also what lets the compositor blur the window: Hyprland enables blur globally and opts out every window except terminal classes.
|
||||
@@ -86,7 +86,7 @@ The socket also exports `KITTY_LISTEN_ON` into each pane. nvim reads it to know
|
||||
| Key | Action |
|
||||
| --- | --- |
|
||||
| `super+n` | Vertical split 50/50 (`launch_vs50`) |
|
||||
| `super+z` | Toggle `stack` layout (zoom) |
|
||||
| `super+z` | Toggle `stack` layout (zoom); the tab title gains a layers icon and pane count (`nf-md-layers 3`) while other panes are hidden |
|
||||
| `ctrl+shift+t`, `super+enter` | New tab in current cwd |
|
||||
| `ctrl+space`, `ctrl+shift+j` | Horizontal split, 30% (`launch_hs`) |
|
||||
| `ctrl+enter`, `ctrl+shift+l` | Vertical split, 40% (`launch_vs`) |
|
||||
@@ -100,7 +100,6 @@ The socket also exports `KITTY_LISTEN_ON` into each pane. nvim reads it to know
|
||||
| `super+a` | Spawn a separate kitty (`--class=kitty-herdr`, `--config ~/.config/kitty/herdr.conf`) |
|
||||
| `ctrl+shift+c` / `ctrl+shift+v` | Copy / paste clipboard |
|
||||
| `alt+q w e r t y u i o` | Go to tab 1–9 |
|
||||
| `ctrl+shift+d` | `day_session.py` picker: reopen any archived day's session |
|
||||
| `ctrl+h/j/k/l` | `pass_keys.py`: move to neighbor window left/bottom/top/right, or pass the key through |
|
||||
| `super+left` / `super+right` | Resize window narrower / wider |
|
||||
| `super+up` / `super+down` | Resize window taller / shorter (by 3) |
|
||||
@@ -118,10 +117,12 @@ The tmux and herdr hosts are separate kitty processes because `launch` cannot ta
|
||||
|
||||
| Directive | Role |
|
||||
| --- | --- |
|
||||
| `geninclude day_session.py` | Creates today's (empty) session file and emits `startup_session <path>` whenever no running kitty owns today's session. Ownership is an `flock` on `$XDG_RUNTIME_DIR/kitty-day-<day>.kitty-session.lock`, held until that kitty exits, so closing kitty and launching it again always reopens the day, even if other kitties (or yesterday's) are still running. A second concurrent instance starts plain instead of duplicating today's tabs. |
|
||||
| `geninclude day_session.py` | Creates today's (empty) session file and emits `startup_session <path>` whenever no running kitty owns today's session. Ownership is an `flock` on `$XDG_RUNTIME_DIR/kitty-day-<day>.kitty-session.lock`, held until that kitty exits, so closing kitty and launching it again always reopens the day, even if other kitties (or yesterday's) are still running. A second concurrent instance starts plain instead of duplicating today's tabs. A kitty started with `--session` for another day never takes the lock. |
|
||||
| `watcher day_session.py` | About 1 s after a window opens, closes, resizes or splits, changes focus or finishes a command (catches `cd`), and every 30 s for output from long-running programs, rewrites the session this instance started with. Title changes are ignored so spinners don't trigger saves. Skips the save once the session has no windows, so closing kitty keeps the last good state. |
|
||||
| `map ctrl+shift+d kitten day_session.py` | Picker over every archived day, newest first; opens the choice with `goto_session`. Past days are snapshots: tabs opened from them are not saved back. |
|
||||
| `tab_bar_filter session:~ or session:^$` | Tab bar shows only the active day's tabs plus tabs outside any session. |
|
||||
|
||||
Earlier days open with the [`kitty-days`](/tools/television#kitty-days) tv cable (`tv kitty-days`), each in its own kitty (`kitty --session <file>`). A past day is a read-only snapshot: nothing in that kitty saves it back. Today's file opened that way, while no kitty owns it, becomes the live day again.
|
||||
|
||||
Before shutdown or reboot, the `kitty-day-save.service` user unit runs [`kitty-day-save`](/shell/scripts#kitty-day-save) under a logind delay inhibitor. On `PrepareForShutdown(true)` it sends `kitten day_session.py flush` to every `@kitty-<pid>` socket: the owning kitty saves at once (all windows are still alive), then skips saves for 60 s so windows dying during the shutdown can't shrink the file. [`30-user-services`](/chezmoi/scripts#30-user-services) enables the unit.
|
||||
|
||||
What a restored window gets back:
|
||||
|
||||
@@ -211,12 +212,12 @@ Kitten `ssh` config: for `hostname goliath`, `share_connections yes`.
|
||||
|
||||
| File | Purpose |
|
||||
| --- | --- |
|
||||
| `tab_bar.py` | Provides `draw_title` for `{custom}` in the tab template. Title is `<index> <icon> <label>`: the label is the git repo root name of the tab's cwd (walks up for `.git`), or the file nvim is editing (parsed from nvim's title). Icon comes from the foreground process cmdline (editors, AI agents like claude/omp/opencode/codex, git tools, docker, herdr, tmux, yazi, btop, atuin, ssh, chezmoi, …) with a folder fallback. Labels are elided at 28 chars. No subprocesses or timers. |
|
||||
| `tab_bar.py` | Provides `draw_title` for `{custom}` in the tab template. Title is `<index> <icon> <label>`: the label is the git repo root name of the tab's cwd (walks up for `.git`), or the file nvim is editing (parsed from nvim's title). Icon comes from the foreground process cmdline (editors, AI agents like claude/omp/opencode/codex, git tools, docker, herdr, tmux, yazi, btop, atuin, ssh, chezmoi, …) with a folder fallback. Labels are elided at 28 chars. In the `stack` layout with more than one pane, ` <nf-md-layers> <panes>` is appended; kitty repaints the tab bar on every layout change. No subprocesses or timers. |
|
||||
| `pass_keys.py` | Bound to `ctrl+h/j/k/l`. If the window's foreground process matches `vim`, `nvim`, `fzf`, `tv`, `tmux` or `herdr`, the key is forwarded; otherwise kitty moves to the neighboring window. |
|
||||
| `navigate_kitty.py` | No-UI kitten that calls `neighboring_window` with a direction argument; the counterpart nvim can invoke. Not mapped in `kitty.conf`. |
|
||||
| `select_tab.py` | Full-screen fuzzy tab picker using `kitty @ ls` data; shows cwds zsh-style. Keys: Up/Down/PgUp/PgDn scroll, Enter selects, typing filters, `ctrl+c`/Esc quits. Not mapped in `kitty.conf`. |
|
||||
| `switchtab.py` | Focuses the tab whose `vt` user var matches the argument, or launches one with that var and reorders tabs by `vt`. Not mapped. |
|
||||
| `window_titler.py` | Watcher that appends `[<vt> <pty>]` to window titles. Not referenced in `kitty.conf`. |
|
||||
| `day_session.py` | Daily sessions: `geninclude` script, global watcher and no-UI picker kitten in one file. See [Daily sessions](#daily-sessions). |
|
||||
| `day_session.py` | Daily sessions: `geninclude` script, global watcher and the `flush` no-UI kitten in one file. See [Daily sessions](#daily-sessions). |
|
||||
|
||||
Related: the [tmux](/terminal/tmux) `is_vim` check and herdr's `vim-herdr-navigation` plugin complete the `ctrl+h/j/k/l` chain. Niri window rules match the `kitty`, `kitty-tmux` and `kitty-herdr` app-ids ([Niri](/desktop/niri)).
|
||||
Reference in new issue
Block a user