docs(docs): add television documentation and update shell docs for TV integration

This commit is contained in:
Prad Nukala committed 2026-09-30 11:14:18 -04:00
1 parent 3c4af515fa
commit 7c786f9349
11 files changed
+198 -57

No files matched your search

+2 -2
View File
@@ -105,8 +105,8 @@ These git-adjacent commands live in `~/.local/bin` and the shell function direct
| Command | What it does |
| --- | --- |
| `gdc` | Asks for confirmation with `gum confirm`, then runs `git reset --hard HEAD` and `git clean -fd`. |
| `gop` | Opens a repo's web page for any forge whose layout is `https://<host>/<owner>/<repo>`; defaults to `origin`, then `upstream`. |
| `gop` | Opens a repo's web page for any forge whose layout is `https://<host>/<owner>/<repo>`; defaults to `origin`, then `upstream`. Also the <kbd>ctrl-b</kbd> action of the `ghq-repos` [television](/tools/television#ghq-repos) cable. |
| `git-summary` | Aggregates every `AGENTS.md` in the current repo through `code2prompt`. |
| `ghg` / `ghg-clone` | `ghq get` a repo and `cd` into the clone. |
| `ghn` | Creates a private repo on prad.codes (via `tea`) or github.com (via `gh`), clones it with ghq, and `cd`s into it. |
| `gho` | Picks a ghq repo or Obsidian vault with fzf and `cd`s into it. |
| `gho` | Picks a ghq repo or Obsidian vault with the `ghq-repos` [television](/tools/television#ghq-repos) cable and `cd`s into it. |
+2 -1
View File
@@ -22,6 +22,7 @@ Packages come from `.chezmoidata/packages.yaml` and are installed by `run_onchan
| [bat](/tools/bat) | bat | `dot_config/bat/` | cyberdream tmTheme |
| [Topgrade](/tools/topgrade) | topgrade | `dot_config/topgrade.toml` | n/a |
| [Hunk](/tools/hunk) | hunk diff viewer | `dot_config/hunk/config.toml` | `auto` |
| [television](/tools/television) | tv fuzzy picker, custom cables | `television/` (symlinked) | `cyberdream-transparent` |
| [LeetCode](/tools/leetcode) | leetcode CLI, `lc-elir` | `dot_leetcode/` | n/a |
<CardGroup cols={2}>
@@ -45,7 +46,7 @@ These packages are declared in `.chezmoidata/packages.yaml` but have no config f
| Tool | Role | Wired in |
| --- | --- | --- |
| `fzf` | Fuzzy finder | `FZF_DEFAULT_OPTS` in `dot_config/fish/conf.d/10-env.fish` (rounded border, cyberdream colors: highlight `#5ef1ff`, pointer `#ffaecf`, marker `#5eff6c`). Used by fish functions `c2p`, `cp-appid`, `fab`, `gtm`, `mdp`, `lc-elir`, by `~/.local/bin` scripts (`gho`, `pj`, `lc-elir`), and as `fuzzy_cmd` of the yazi bunny plugin. |
| `fzf` | Fuzzy finder | `FZF_DEFAULT_OPTS` in `dot_config/fish/conf.d/10-env.fish` (rounded border, cyberdream colors: highlight `#5ef1ff`, pointer `#ffaecf`, marker `#5eff6c`). Used by fish functions `c2p`, `cp-appid`, `fab`, `gtm`, `mdp`, `lc-elir`, by `~/.local/bin` scripts (`lc-elir`), and as `fuzzy_cmd` of the yazi bunny plugin. The shell pickers (`gho`, `pj`, <kbd>ctrl-e</kbd>) use [television](/tools/television). |
| `fd` | File finder | `c2p`, `cp-appid`, `extract_agents`, `mdp`, `lc-elir`, `conf.d/pnpm-filter.fish`. |
| `ripgrep` | Content search | `cp-appid`, `gtm`, `gh-sonr-org-migrate` fish functions; niri focus script. |
| `zoxide` | Frecency `cd` | `zoxide init fish` in `conf.d/40-tools.fish`; the `cd` function in fish/bash/zsh falls back to `zoxide query` when the argument is not a directory, and `ghg-clone` registers new clones. |
+1
View File
@@ -12,6 +12,7 @@ export default defineMeta({
"lazygit",
"lazydocker",
"bat",
"television",
"topgrade",
"hunk",
"leetcode",
+111
View File
@@ -0,0 +1,111 @@
---
title: television
description: tv config symlinked from the repo, a transparent cyberdream theme, and the custom cables behind gho, pj, and ctrl-e in fish, zsh, and bash.
---
[television](https://github.com/alexpasmantier/television) (`tv`) is a fuzzy picker built on "cables": TOML files that define a source command, a preview, and actions. Every shell picker in the repo runs on a tv cable, with the same keys in fish, zsh, and bash.
| | |
| --- | --- |
| Source | `television/config.toml`, `television/cable/*.toml`, `television/themes/cyberdream-transparent.toml` |
| Link | `dot_config/symlink_television.tmpl` → `~/.config/television` is a symlink to `{{ .chezmoi.sourceDir }}/television` |
| Target | `~/.config/television/` |
| Ignore | `.chezmoiignore.tmpl` lists `television`, so it is not copied to `~/television` |
| Install | Not listed in `.chezmoidata/packages.yaml`; install separately |
The whole directory is a symlink into the source tree, so edits apply without `chezmoi apply`. `cable/` holds tv's stock cables plus the repo's own and overridden ones.
## config.toml
| Key | Value |
| --- | --- |
| `default_channel` | `files` |
| `ui.theme` | `cyberdream-transparent` |
| `ui.input_bar.position` | `top`, prompt `>` |
| Borders | `rounded` on the input bar, results, and preview |
| `ui.preview_panel.size` | `50` |
| `ui.help_panel.hidden` | `true` |
Global keys added on top of the defaults:
| Key | Action |
| --- | --- |
| <kbd>ctrl-e</kbd> | `actions:edit`: the channel's `edit` action |
| <kbd>ctrl-h</kbd> | `actions:goto_parent_dir`; the help panel loses <kbd>ctrl-h</kbd> |
| <kbd>end</kbd> | `go_to_input_end` (unchanged) |
## Theme
`themes/cyberdream-transparent.toml` is a separate file because tv 0.15's builtin `cyberdream` shadows a user theme of the same name and paints an opaque `#16181a` background. This theme omits `background`, so kitty's translucent background shows through (tv 0.15 rejects `background = 'none'`).
| Key | Color |
| --- | --- |
| `border_fg` | `#3c4048` |
| `text_fg`, `input_text_fg`, `result_value_fg` | `#ffffff` |
| `dimmed_text_fg` | `#7b8496` |
| `result_name_fg` | `#5ea1ff` |
| `result_line_number_fg` | `#f1ff5e` |
| `match_fg` | `#5ef1ff` |
| `selection_fg` / `selection_bg` | `#5eff6c` on `#3c4048` |
| `preview_title_fg` | `#ffaecf` |
| `result_count_fg` | `#ffbd5e` |
| `channel_mode_bg` | `#5ef1ff` on `#16181a` |
| `remote_control_mode_bg` | `#5eff6c` on `#16181a` |
| `action_picker_mode_bg` | `#bd5eff` on `#16181a` |
## Sorting
Every custom cable pipes its source through [`mtime-sort`](/shell/scripts#mtime-sort), which orders lines newest-first by the mtime of the path in the line's last tab-separated field (`--repo` stats `<path>/.git/index` first). tv then ranks match quality and frecency on top of that order. All custom cables set `shell = "bash"`, because `$SHELL` is fish.
## Custom cables
| Cable | File | Opened by |
| --- | --- | --- |
| [`ghq-repos`](#ghq-repos) | `cable/ghq-repos.toml` | <kbd>ctrl-o</kbd> (`gho`) |
| [`git-files`](#git-files) | `cable/git-files.toml` | <kbd>ctrl-e</kbd> |
| [`pj`](#pj) | `cable/pj.toml` | <kbd>ctrl-p</kbd>, <kbd>down</kbd> on an empty prompt (`pj`) |
| [`files`](#files) | `cable/files.toml` | `tv`, <kbd>ctrl-t</kbd> autocomplete |
The keys are bound in fish (`fish_user_key_bindings.fish`), zsh (`keybinds.zsh`), and bash (`keybinds.bash`). See [fish](/shell/fish#key-bindings) and [bash and zsh](/shell/bash-zsh).
### ghq-repos
Entries are `name<TAB>path`: tv shows and matches the name and prints the path. <kbd>ctrl-s</kbd> cycles between the two sources.
| Source | Entries | Sort |
| --- | --- | --- |
| Repos | `ghq list` under `ghq root`, plus the chezmoi source (`~/.local/share/chezmoi`) listed as `github.com/prdlk/dotfiles` | `mtime-sort --repo` |
| Vaults | Every directory under `~/Documents/Obsidian` (depth 3) that contains `.obsidian`, named relative to that directory | `mtime-sort` |
**Preview.** `onefetch --no-art` for git directories, otherwise `eza --tree --level 2` (falling back to `ls -la`).
| Key | Action |
| --- | --- |
| <kbd>enter</kbd> | Print the path. The `gho` function cds into it, clears, and runs `onefetch` in git repos |
| <kbd>ctrl-e</kbd> | `edit`: `cd <path> && nvim .` on `/dev/tty` |
| <kbd>ctrl-b</kbd> | `browse`: `cd <path> && gop` in fork mode, so tv stays open ([gop](/shell/scripts#gop)) |
**Needs:** `ghq`, `fd`, `onefetch`, `mtime-sort`.
### git-files
| Source | Entries |
| --- | --- |
| Tracked | `git ls-files` of the whole repo (from the toplevel), or `fd -t f` outside a repo |
| All | `fd -t f -H -E .git` |
Both are sorted with `mtime-sort`. The preview is `bat -n` with `BAT_THEME=ansi`. <kbd>enter</kbd> runs `edit`: `nvim {}` on `/dev/tty`.
**Needs:** `git`, `fd`, `bat`, `mtime-sort`.
### pj
Source `pj --list`; tv shows the display column. The preview runs `pj --preview`, the preview panel is 40% wide, and <kbd>enter</kbd> runs `pj --run`. Running `pj` scans the project and opens this cable with its own records. See [pj](/shell/scripts#pj).
**Needs:** `pj`, `mtime-sort`.
### files
Overrides tv's stock `files` cable. Sources `Default` (`fd -t f`) and `Hidden` (`fd -t f -H`), both piped through `mtime-sort`. The `edit` action opens the selection in `nvim` on `/dev/tty`, so it also works from <kbd>ctrl-t</kbd>, where the shell captures tv's stdout.
**Needs:** `fd`, `bat`, `mtime-sort`.
+1 -1
View File
@@ -103,7 +103,7 @@ All bindings in `keymap.toml` are `[[mgr.prepend_keymap]]` entries, so they take
| <kbd>;</kbd> | Open the bunny hop menu |
| <kbd>'</kbd> | Bunny fuzzy search over hops |
`$GHQ_ROOT` is `~/Code`, exported in `dot_config/fish/conf.d/10-env.fish`. The `g m` bindings need the SFTP services in `vfs.toml`, which are commented out (see [vfs.toml](#vfstoml)).
`$GHQ_ROOT` is `~/Code`, exported in `dot_config/fish/conf.d/10-env.fish`, `dot_zshrc`, and `dot_bashrc`. The `g m` bindings need the SFTP services in `vfs.toml`, which are commented out (see [vfs.toml](#vfstoml)).
### Finding and opening