feat: custom kitty tab bar with system status + install scripts

Custom tab_bar.py with flat tabs, right-aligned status area (git branch,
CPU%, memory, uptime, hostname, clock) using Nerd Font icons. F12/Shift+F12
toggle for tab bar. Added Kitty-setup.md, theme-setup.md, and install
scripts for kitty-only and full Debian theme deployment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mortdecai
2026-04-09 07:26:15 -04:00
parent 03407654d6
commit 0c0066fef1
12 changed files with 692 additions and 109 deletions
+74 -98
View File
@@ -1,114 +1,90 @@
MAIN OBJECTIVE: Create SESSION.md in your project directory according to the folliwing template. Do NOT modify this source file.
# SESSION.md — Persistent AI Session Memory
# SESSION.md — Seth Linux Theme
This is the template and guide for `SESSION.md` files used across projects in this homelab.
## Project Summary
Centralized Linux desktop theme for Seth's GNOME setup. Black titlebars, square corners, ultra-thin headerbars, dark mode with orange accent (#D35400). Configs for GTK3/4 CSS, kitty terminal, and GNOME gsettings.
---
## What SESSION.md is for
`SESSION.md` is a **persistent memory file** — it accumulates decisions, discoveries, and context across AI coding sessions so the assistant doesn't start cold each time.
It is **not** a chat transcript.
It is **not** static documentation of how something works.
It is a living record of *why things are the way they are*, plus a map to the right context files.
---
## Where to put it
| Scope | Location | Purpose |
|---|---|---|
| Global homelab | `/root/bin/SESSION.md` ← this file | Cross-project memory, patterns, major decisions |
| Per-project | `<project-dir>/SESSION.md` | Project-specific session memory |
Each project `SESSION.md` should link back here and to any relevant context files.
---
## How to populate it
Copy the section structure below into your project's `SESSION.md` and fill it in.
### Mandatory sections
**Context pointers** — every `SESSION.md` must list the files the AI should load to understand the project:
```markdown
## Context Files
- `/root/bin/core_homelab.md` — cluster topology, SSH aliases
- `/root/bin/services_directory.md` — active service IPs and domains
- `/root/bin/SESSION.md` — global session memory (this file's parent)
- `./CONTEXT.md` — project-specific infrastructure and config
- `./README.md` — project overview
```
**Project summary** — one paragraph. What is this project? What problem does it solve?
**Gitea repo** — link to the Gitea remote (if version-controlled):
```markdown
## Gitea
- Repo: https://git.sethpc.xyz/Seth/seth-linux-theme
- Repo: https://git.sethpc.xyz/Seth/<repo-name>
- Remote: `https://Seth:<token>@git.sethpc.xyz/Seth/<repo-name>.git`
- API key: see `/root/bin/GITEA_API.md` (same key for all repos)
```
## Context Files
- `gtk-3.0/gtk.css` — GTK3/4 headerbar CSS (same file used for both)
- `kitty/kitty-theme.conf` — kitty terminal overrides (borderless, black titlebar, tab bar config, keybindings)
- `kitty/tab_bar.py` — custom tab bar: flat tabs + right-aligned status (git, cpu, mem, uptime, host, clock)
- `kitty/tab-bar-hide.conf` / `tab-bar-show.conf` — toggle snippets (may be unused now with inline --override approach)
- `gnome/apply-gnome-settings.sh` — GNOME dark mode, orange accent, Super+right resize
- `install.sh` — deploys all configs to target user's ~/.config
**Session notes** — the meat of the file. Append here each session.
---
## Session notes format
Group entries by topic, not by date. Update the relevant section rather than appending raw timestamped blocks. Example:
```markdown
## Session Notes
### Infrastructure decisions
- Chose LXC over Docker-in-LXC because the service doesn't need container isolation
- Enabled nesting=1 on CT 644 to allow Docker inside
### Architecture
- GTK CSS goes in `~/.config/gtk-3.0/gtk.css` and `~/.config/gtk-4.0/gtk.css` (same content)
- kitty uses its own config, not GTK — `wayland_titlebar_color` only works with CSD, not Mutter SSD
- `hide_window_decorations yes` removes Mutter's server-side decorations from kitty entirely (borderless)
- GNOME Shell rounded corners are Mutter-controlled, not GTK CSS — need GNOME Shell theme or extension to override DE-wide
- `resize-with-right-button true` enables Super+right-drag to resize (was disabled by default)
### Bug fixes & discoveries
- Service wasn't starting: mc1 had autoStart=false in MCSManager config
(fixed: set eventTask.autoStart=true in InstanceConfig/<id>.json)
- tail -F (capital F) is correct — waits for file to appear, handles log rotation
### Deployment
- Desktop runs on steel141 (192.168.0.141) under `seth@` user
- `claude@` is headless, no DE — GUI configs must target `/home/seth/.config/`
- From claude@: `sudo -u seth cp <file> /home/seth/.config/...`
- GTK3 apps pick up CSS changes live (open new window). GTK4/libadwaita apps need full relaunch. Kitty needs relaunch.
### Open threads
- [ ] Add Redis backend for session persistence (currently SQLite only)
- [ ] Web dashboard for recent AI god interactions
```
### Current state (2026-04-07)
- GTK CSS: black headerbar, square corners, white text, transparent buttons, #999 backdrop text/icons, 36px min-height
- Kitty: borderless (`hide_window_decorations yes`), JetBrainsMono Nerd Font, custom tab bar with status area
- Kitty tab bar: flat style (no powerline), user@ prefix for non-seth users, right-aligned status (git branch, CPU%, memory, uptime, hostname, clock) with Nerd Font icons in orange
- Kitty tab bar toggle: F12 hides (min_tabs=999), Shift+F12 shows (min_tabs=1) via `remote_control load-config --override`
- GNOME: dark mode, orange accent, Super+right resize enabled
---
### Open issues
- [ ] GNOME Shell rounded window corners — Mutter hardcodes CSD corner rounding at compositor level. No CSS override possible (tried `border-radius: 0 !important` on all nodes). No gsetting exists. GNOME Shell CSS `.window-frame` doesn't control it either. Only fix: patched Mutter or a GNOME Shell extension that modifies Mutter's clipping behavior. "Rounded Window Corners Reborn" extension only ADDS rounding (shader overlay), doesn't remove native rounding.
## How to keep it current
### Resolved issues (2026-04-07)
- [x] Nautilus sidebar/main headerbar height mismatch — Fixed by targeting `headerbar stackpage > box` and `headerbar stack` with `min-height: 0` and zero padding. Root cause: NautilusPathBar inside a GtkStack in the main headerbar was taller than the sidebar's simple AdwWindowTitle.
- [x] Thin gray border line at top of headerbar — Fixed by targeting `decoration`, `window.csd`, `.titlebar:not(headerbar)`, and `toolbarview > .top-bar` with `border: none; box-shadow: none; outline: none`. Was a CSD decoration border, not on the headerbar node itself.
- [x] User Themes extension — Installed (`gnome-shell-extension-user-theme` apt package), enabled, Sethian theme set via `gsettings set org.gnome.shell.extensions.user-theme name "Sethian"`. Required `gnome-shell --replace` to detect newly installed extension.
Run `/update-context` in OpenCode at the end of any session. The command will:
1. Scan the conversation for decisions, fixes, and discoveries not yet recorded
2. Append them to `SESSION.md` (both this file and the project-level one if applicable)
3. Commit and push to Gitea
### Design decisions
- 2026-04-07: Use stock Adwaita dark + CSS overrides, not a full third-party theme — minimal maintenance, survives GNOME updates
- 2026-04-07: Kitty borderless rather than trying to style Mutter's SSD — cleaner, no titlebar to fight with
- 2026-04-07: adw-gtk3 not needed if only overriding headerbar — stock Adwaita + user CSS is sufficient
- 2026-04-07: Flat tab style over powerline — powerline creates clipping artifacts with long titles, flat is simpler
- 2026-04-07: JetBrainsMono Nerd Font — needed for icon glyphs in tab bar status area
- 2026-04-07: Tab bar toggle via `remote_control load-config --override` — no scripts/sockets needed, inline kitty RC
Command defined at: `~/.config/opencode/commands/update-context.md`
### DANGER — never do these
- **NEVER run `gnome-shell --replace` from claude@ session** — it replaces seth's shell process, kills the active session, resets all extensions and theming to defaults. Use `dbus-send` reexec or ask seth to relog instead.
Mandatory per-reply discipline:
- Update `SESSION.md` immediately when a durable fact, decision, or fix is discovered.
- Before every final reply, run a memory check and append any missing durable notes.
- End every reply with one line: `Session memory: updated` or `Session memory: no new durable facts.`
### Kitty architecture notes
- Repo files (`seth-linux-theme/kitty/`) and Seth's live config (`/home/seth/.config/kitty/`) are separate copies, not symlinks — must deploy manually
- `tab_bar.py` custom draw function: kitty calls `draw_tab()` for each tab. `is_last=True` is the hook for drawing right-aligned status
- CPU % uses delta sampling from `/proc/stat` — first draw shows "..." (no prior sample), subsequent draws show real usage
- `kitty @ load-config` merges overrides into running instance without restart
- `remote_control` from a keymap runs inside kitty's process — no socket/listen_on needed
- Kitty does NOT hot-reload `tab_bar.py`, font changes, or keybindings — full restart required
- Ctrl+Shift+F5 only reloads colors/visuals
- `toggle_tab_bar` action does NOT exist in kitty 0.41.1
- `set-option` RC command does NOT exist — use `load-config --override` instead
- `load-config-file` is wrong command name — correct is `load-config`
- Nerd Font installed system-wide at `/usr/local/share/fonts/NerdFonts/`
---
### What was tried and didn't work
- `headerbar *` with `min-height: 0` — didn't equalize sidebar/main headerbar heights
- `headerbar > windowhandle > centerbox` targeting — no effect on height mismatch
- `wayland_titlebar_color` in kitty — ignored when Mutter uses server-side decorations
- `border: none` on headerbar — doesn't remove the gray line at top (it's not a headerbar border)
- `border-radius: 0 !important` on `window`, `window.csd`, `decoration`, `.titlebar` — doesn't remove rounded corners (Mutter compositor-level clipping)
- GNOME Shell theme `.window-frame { border-radius: 0 }` — doesn't control Mutter's window corner rounding
- GTK_DEBUG=interactive on Nautilus — inspector window doesn't open (GNOME 48, Nautilus 48.3). Ctrl+Shift+D/I also failed. Shell restart required for newly installed extensions.
- `draw_tab_with_powerline` — creates clipping artifacts with long tab titles (extra rectangle gets cut off)
- `toggle_tab_bar` kitty action — doesn't exist in 0.41.1
- `remote_control set-option` — not a valid RC command
- `remote_control load-config-file` — wrong name, correct is `load-config`
- `map ctrl+shift+f1` — produces capital P instead of triggering action (escape sequence issue)
- Toggle via background script + `kitty @` + socket — overcomplicated, socket discovery unreliable from background processes
- `listen_on unix:/tmp/kitty-{kitty_pid}` + script with `kitty @ --to` — still failed, too many moving parts
## Global session notes
### Patterns established across all projects
- **Gitea backup convention:** commit every meaningful change immediately; push on the same command. No squashing, no batching unrelated changes.
- **Session file naming:** `SESSION.md` (not `CONVERSATION.md`, not `CONTEXT.md`). `CONTEXT.md` = static infra facts. `SESSION.md` = accumulated AI memory.
- **Context file loading:** Always include `core_homelab.md` and `services_directory.md` in project instructions. Specific project context goes in `CONTEXT.md`.
- **autoStart for MCSManager instances:** Must be set in `InstanceConfig/<id>.json` (`eventTask.autoStart: true`), not just in the panel UI, to survive daemon restarts.
### Infrastructure discoveries
- `mc-godmode.service` on CT 644: already enabled and using `tail -F` correctly. The MC server itself had `autoStart: false` — that was the real issue.
- Gitea runs on port 443 via Caddy at `git.sethpc.xyz` (CT 146, node-173). Direct access to `192.168.0.125:80` does not work from CT 629 — always use the domain.
### Debugging notes (2026-04-07)
- Nautilus widget tree (from gresource): `NautilusWindow` (AdwApplicationWindow) → `AdwOverlaySplitView` → sidebar: `AdwToolbarView``AdwHeaderBar`; content: `AdwToolbarView``NautilusToolbar` (AdwBin) → `AdwHeaderBar` with title = `GtkBox` containing `NautilusPathBar` in a `GtkStack`
- The main headerbar height was driven by NautilusPathBar's default min-height/padding in the GtkStack
- The gray top line was from the CSD `decoration` node and/or `toolbarview > .top-bar` border