@kecan0406/ttheme 1.0.33 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,8 +28,6 @@ get it.
28
28
  | **Setup with `init`** | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![No][no] |
29
29
  | **Palette files** | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![No][no] |
30
30
  | **Runtime repaint** | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![Done][done] | ![Partial][partial] |
31
- | **Font** | ![Done][done] | ![No][no] | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![No][no] | ![No][no] | ![No][no] |
32
- | **Shader** | ![Done][done] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] |
33
31
  | **Background pictures** | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![Partial][partial] | ![No][no] | ![No][no] | ![No][no] | ![No][no] |
34
32
 
35
33
  - **Setup with `init`** — iTerm2 is offered on macOS only, Windows Terminal
@@ -48,12 +46,11 @@ get it.
48
46
  Terminal.app takes every OSC color but no OSC reset, so ttheme reads its
49
47
  colors when the shell starts and puts them back itself. Warp answers OSC
50
48
  color queries but paints one theme app-wide and never the background an OSC
51
- sets, so the shell layer stays off there and `ttheme <palette>` points you at
49
+ sets, so the shell layer stays off there and `ttheme use <palette>` points you at
52
50
  `ttheme default <palette>`, which puts the palette on every Warp window; any other terminal that speaks OSC 4/10/11 (foot, Konsole,
53
51
  VTE-based terminals…) gets repainting and nothing else.
54
- - **Font** — family and size everywhere it is marked; Ghostty also maps
55
- codepoints to fonts. iTerm2 keeps the font of your own profile, Windows
56
- Terminal and Warp the one you set in them.
52
+ - **Colors only** — ttheme sets no font, font size or shader anywhere; those
53
+ stay what you configured in your terminal.
57
54
  - **Background pictures** — `find`, `ttheme image` and `preview`'s live
58
55
  backdrop. Ghostty shows one picture app-wide, following the focused tab;
59
56
  iTerm2 (3.7 or newer) shows one per tab and kitty one per window (a split
@@ -119,7 +116,14 @@ alone and only installs. Then it shows what it is about to change and writes it
119
116
  so cancelling before that touches nothing. It places the zsh layer under
120
117
  `~/.config/ttheme` and edits your terminal config and `~/.zshrc` between
121
118
  `# ttheme begin` / `# ttheme end` markers — everything outside the markers is
122
- left alone. iTerm2 has no config file to edit, so it gets one profile per
119
+ left alone, and what goes in is colors only. Before its first edit of a file it
120
+ keeps a copy beside it, `<file>.ttheme.bak`, and it writes through symlinks, so a
121
+ dotfiles repo keeps its links. A key you set yourself stays yours: a Ghostty
122
+ `command` or `shell-integration`, kitty's `window_logo_scale` and
123
+ `window_logo_alpha`. Every file it adds to a terminal's own folders is named
124
+ `ttheme-<palette>`, so a theme of yours is never overwritten. Alacritty lets its
125
+ own config win over an import, so colors set in `alacritty.toml` hide the
126
+ default palette — init says so when it finds them. iTerm2 has no config file to edit, so it gets one profile per
123
127
  installed palette instead — `ttheme · miku` and so on, in
124
128
  `~/Library/Application Support/iTerm2/DynamicProfiles/ttheme.json`, which
125
129
  iTerm2 reloads by itself whenever `ttheme browse` adds or drops one. One more,
@@ -142,9 +146,21 @@ palette as the one `theme` key of `[appearance.themes]` in `~/.warp/settings.tom
142
146
  It ends with a receipt, paints the first palette onto the tab you
143
147
  ran it in (not under `keep`) and lists what to do next (`exec zsh` for the
144
148
  `ttheme` command here, a terminal restart for new tabs).
145
- Running it again updates in place; `--yes` skips every prompt and installs no
146
- palettes — `ttheme browse` opens the full catalog any time, to add or drop
147
- single palettes.
149
+ Running it again updates in place; `--yes` (`-y`) skips every prompt and installs no
150
+ palettes, and init refuses to run without a terminal unless it is given —
151
+ `ttheme browse` opens the full catalog any time, to add or drop single palettes.
152
+
153
+ ```sh
154
+ npx @kecan0406/ttheme@latest uninstall
155
+ ```
156
+
157
+ takes it all back out, after listing what it will do: every ttheme block
158
+ leaves its config, Warp gets its theme back and iTerm2 its own default profile,
159
+ and the `ttheme-*` theme files, `~/.config/ttheme` (installed pictures
160
+ included), the cache and the iTerm2 and Windows Terminal files are deleted. A
161
+ config you did not touch since ttheme first edited it comes back byte for byte
162
+ and its backup goes; one you edited since keeps `<file>.ttheme.bak`. Open shells
163
+ drop the layer at their next prompt.
148
164
 
149
165
  **Any of them by hand** — one archive per terminal in the
150
166
  [latest release](https://github.com/kecan0406/ttheme/releases/latest):
@@ -154,19 +170,19 @@ REL=https://github.com/kecan0406/ttheme/releases/latest/download
154
170
 
155
171
  # kitty
156
172
  curl -L $REL/ttheme-kitty.tar.gz | tar xz
157
- cp kitty/themes/miku.conf ~/.config/kitty/themes/
158
- # kitty.conf: include themes/miku.conf
173
+ cp kitty/themes/ttheme-miku.conf ~/.config/kitty/themes/
174
+ # kitty.conf: include themes/ttheme-miku.conf
159
175
 
160
176
  # alacritty
161
177
  curl -L $REL/ttheme-alacritty.tar.gz | tar xz
162
- cp alacritty/themes/miku.toml ~/.config/alacritty/themes/
178
+ cp alacritty/themes/ttheme-miku.toml ~/.config/alacritty/themes/
163
179
  # alacritty.toml: [general]
164
- # import = ["~/.config/alacritty/themes/miku.toml"]
180
+ # import = ["~/.config/alacritty/themes/ttheme-miku.toml"]
165
181
 
166
182
  # wezterm
167
183
  curl -L $REL/ttheme-wezterm.tar.gz | tar xz
168
- cp wezterm/colors/miku.toml ~/.config/wezterm/colors/
169
- # wezterm.lua: config.color_scheme = "miku"
184
+ cp wezterm/colors/ttheme-miku.toml ~/.config/wezterm/colors/
185
+ # wezterm.lua: config.color_scheme = "ttheme-miku"
170
186
 
171
187
  # iTerm2 — open a .itermcolors to add it to Settings > Profiles > Colors presets
172
188
  curl -L $REL/ttheme-iterm2.tar.gz | tar xz
@@ -181,11 +197,8 @@ curl -L $REL/ttheme-warp.tar.gz | tar xz
181
197
  cp warp/themes/ttheme-miku.yaml ~/.warp/themes/
182
198
  ```
183
199
 
184
- The kitty, Alacritty and WezTerm archives also carry a `config/` file per theme
185
- with that theme's font — separate so you can take the colors without the rest. Ghostty is laid out
186
- differently: the dock-icon colors travel inside each theme file (they derive
187
- from the palette), and the font + shader — identical across themes — ship as
188
- one shared `ttheme.conf` you include once with `config-file`.
200
+ Each Ghostty theme file also carries the dock-icon colors, derived from the
201
+ palette.
189
202
 
190
203
  Building from a checkout works too: `mise install && bun install && mise run
191
204
  build` writes the same tree to `dist/`, `mise run sandbox` tries it in a
@@ -196,23 +209,28 @@ it for real.
196
209
 
197
210
  ```
198
211
  ttheme list every palette, grouped, with previews
199
- ttheme homura paint this tab (a unique prefix works: ttheme ho)
212
+ ttheme use paint this tab (a unique prefix works: ttheme use ho)
200
213
  ttheme preview browse live — focus repaints the tab, enter keeps it (this tab or default)
201
214
  ttheme next advance this tab to the next palette
202
215
  ttheme default make a palette the one new tabs open with
203
- ttheme off open new tabs in the terminal's own colors — ttheme on wears the default again
216
+ ttheme on wear the default palette in new tabs again
217
+ ttheme off take the palette and picture off every tab — the terminal's own colors until ttheme on
204
218
  ttheme pin pick a palette for this directory — cd into it repaints, cd out restores
205
219
  ttheme unpin drop the palette pinned to this directory
206
220
  ttheme config edit settings in $EDITOR — they apply in new tabs
207
221
  ttheme help the list above, in your terminal
208
222
 
209
223
  ttheme browse pick palettes from the catalog in a live picker
210
- ttheme list the catalog, ● installed and ○ not (a query filters it)
224
+ ttheme list the catalog, ● installed and ○ not (a query filters it, --json prints it as JSON)
211
225
  ttheme add install palettes from the catalog
212
226
  ttheme remove uninstall palettes
213
227
  ttheme update refresh the catalog from the registry
214
228
  ```
215
229
 
230
+ `ttheme <command> --help` (or `ttheme help <command>`) describes one command
231
+ without running it, and `ttheme --version` prints the version. `TTHEME_DEBUG=1`
232
+ in front of any command prints where an error came from, for a bug report.
233
+
216
234
  In `preview`, series and palettes are listed by name (`TTHEME_SORT=series`
217
235
  keeps the order they were added), groups start folded with the cursor on the
218
236
  current palette;
@@ -245,7 +263,7 @@ tab was painted.
245
263
  A palette can also bring a Ghostty background image. The block `init` writes
246
264
  includes `~/.config/ttheme/backgrounds/shown.conf` with an optional
247
265
  `config-file = ?…`, and that one line names the palette whose picture is up.
248
- Putting a palette on — `ttheme <name>`, enter in `preview`, `ttheme next`,
266
+ Putting a palette on — `ttheme use <name>`, enter in `preview`, `ttheme next`,
249
267
  `ttheme default`, cd into a pinned directory — rewrites the line and sends
250
268
  `SIGUSR2`, so whatever Ghostty settings you put in `<palette>.conf` arrive with
251
269
  the palette, and palettes without a file show no image:
@@ -540,10 +558,6 @@ catalog is cached in `~/.config/ttheme/catalog.json`.
540
558
 
541
559
  ## Terminal notes
542
560
 
543
- Ghostty is the only terminal here with GLSL shaders, and the only one with
544
- per-codepoint font mapping — which is why the Hangul→D2Coding rule survives only
545
- in its build.
546
-
547
561
  WezTerm keeps an OSC-set palette per pane, but a picture belongs to the window:
548
562
  the Lua module ttheme runs follows the active pane's `ttheme_shown` user var,
549
563
  which the shell layer sets whenever the tab's palette changes, and reads the
@@ -599,8 +613,7 @@ ansi = [ ... 16 colors ... ]
599
613
  ```
600
614
 
601
615
  The series title and its `native` reading live once in `themes/_groups.toml`,
602
- never in a theme file. `[font]` and `[ghostty]` are inherited from
603
- `themes/_defaults.toml` unless the theme overrides them. Then:
616
+ never in a theme file. Then:
604
617
 
605
618
  ```sh
606
619
  mise run build # regenerates dist/ for every terminal — fails on bad contrast
@@ -612,7 +625,7 @@ mise run compat # the terminal compatibility cases, in each instal
612
625
  `mise run compat` opens each installed terminal behind your windows on a
613
626
  throwaway home (`mise run sandbox`), runs the cases in `tests/compat/cases.zsh`
614
627
  inside it — adapter detection, OSC set/query/reset, what the window really
615
- paints (read off a screenshot), `ttheme <palette>` and its restore, cell size,
628
+ paints (read off a screenshot), `ttheme use <palette>` and its restore, cell size,
616
629
  kitty graphics, synchronized output and focus reporting — and compares them
617
630
  with `tests/compat/expect.tsv`: a case that used to pass and fails is a
618
631
  regression and fails the run, and `--update` records what was measured.
@@ -640,9 +653,7 @@ and `magi` from [lotap/magi-theme](https://github.com/lotap/magi-theme) (MIT).
640
653
  Every palette records its input in `meta.ansi_source`, and only that input's
641
654
  hues survive: the harmonizer normalizes lightness and saturation away and
642
655
  rotates each non-signature hue toward the palette's own seed, so no scheme is
643
- reproduced here. Shaders come from
644
- [sahaj-b/ghostty-cursor-shaders](https://github.com/sahaj-b/ghostty-cursor-shaders)
645
- (MIT), see `ghostty/shaders/`.
656
+ reproduced here.
646
657
 
647
658
  Palettes are inspired by characters from the listed works; this project is
648
659
  unaffiliated with and unendorsed by their rights holders. No character art,