@kecan0406/ttheme 1.0.31 → 1.0.32
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 +53 -8
- package/bin/ttheme.js +182 -128
- package/dist/manifest.json +1 -1
- package/package.json +1 -1
- package/shell/adapters/_bg.zsh +3 -0
- package/shell/adapters/_osc.zsh +9 -3
- package/shell/adapters/alacritty.zsh +1 -0
- package/shell/adapters/kitty.zsh +50 -27
- package/shell/adapters/windows-terminal.zsh +2 -0
- package/shell/ttheme.zsh +4 -4
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ get it.
|
|
|
30
30
|
| **Runtime repaint** | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![Done][done] | ![Partial][partial] |
|
|
31
31
|
| **Font** | ![Done][done] | ![No][no] | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![No][no] | ![No][no] | ![No][no] |
|
|
32
32
|
| **Shader** | ![Done][done] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] | ![No][no] |
|
|
33
|
-
| **Background pictures** | ![Done][done] | ![Done][done] | ![
|
|
33
|
+
| **Background pictures** | ![Done][done] | ![Done][done] | ![Done][done] | ![No][no] | ![Partial][partial] | ![No][no] | ![No][no] | ![No][no] | ![No][no] |
|
|
34
34
|
|
|
35
35
|
- **Setup with `init`** — iTerm2 is offered on macOS only, Windows Terminal
|
|
36
36
|
from WSL (or a native Windows zsh), where init writes a settings fragment on
|
|
@@ -39,8 +39,12 @@ get it.
|
|
|
39
39
|
- **Palette files** — iTerm2 gets one dynamic profile per palette, plus
|
|
40
40
|
`.itermcolors` in the archive; Windows Terminal gets one fragment carrying
|
|
41
41
|
every installed scheme.
|
|
42
|
-
- **Runtime repaint** —
|
|
43
|
-
|
|
42
|
+
- **Runtime repaint** — OSC escape sequences everywhere, per pane in kitty,
|
|
43
|
+
WezTerm and Windows Terminal, one color per sequence (Alacritty drops an OSC 4
|
|
44
|
+
carrying more than seven). kitty and Windows Terminal reset every OSC color
|
|
45
|
+
when their config reloads, so a changed default would undo the palettes open
|
|
46
|
+
tabs wear: kitty's watcher puts each window's palette back as the reload ends,
|
|
47
|
+
and a Windows Terminal tab repaints itself at its next prompt or focus.
|
|
44
48
|
Terminal.app takes every OSC color but no OSC reset, so ttheme reads its
|
|
45
49
|
colors when the shell starts and puts them back itself. Warp answers OSC
|
|
46
50
|
color queries but paints one theme app-wide and never the background an OSC
|
|
@@ -52,10 +56,11 @@ get it.
|
|
|
52
56
|
Terminal and Warp the one you set in them.
|
|
53
57
|
- **Background pictures** — `find`, `ttheme image` and `preview`'s live
|
|
54
58
|
backdrop. Ghostty shows one picture app-wide, following the focused tab;
|
|
55
|
-
iTerm2 (3.7 or newer) shows one per tab
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
and
|
|
59
|
+
iTerm2 (3.7 or newer) shows one per tab and kitty one per window (a split
|
|
60
|
+
pane included), both with the same preview, tuning and find. WezTerm shows the
|
|
61
|
+
picture of the active tab per window and switches it as `preview` moves, but
|
|
62
|
+
has no in-terminal preview or tuning — find and tune from Ghostty, iTerm2 or
|
|
63
|
+
kitty. Alacritty has no graphics at all. Cut-outs and baked crops need macOS.
|
|
59
64
|
|
|
60
65
|
[done]: https://img.shields.io/badge/Done-2ea44f?style=flat-square
|
|
61
66
|
[partial]: https://img.shields.io/badge/Partial-e3b341?style=flat-square
|
|
@@ -329,6 +334,26 @@ half remember; `↑`/`↓` pick one and enter searches it. A palette with no `me
|
|
|
329
334
|
find on that empty query, so it can have a background too. `o` opens the post's
|
|
330
335
|
page in a browser.
|
|
331
336
|
|
|
337
|
+
A picture of your own goes in the same way. Drop an image file on the window
|
|
338
|
+
while find is open, or paste it — a file copied in Finder, its path, or a link
|
|
339
|
+
to the image — and find tries it on as if it were a post. `ctrl+v` (or `v`
|
|
340
|
+
outside the search field, `alt+v` on Windows) reads the clipboard itself, which
|
|
341
|
+
is how a screenshot or a browser's "Copy Image" gets in, since no terminal
|
|
342
|
+
pastes picture data as text — on macOS ctrl+shift+cmd+4 takes a screenshot
|
|
343
|
+
straight to the clipboard. When the window comes back into focus with a picture
|
|
344
|
+
on the clipboard, find says so for a few seconds; text on the clipboard that is
|
|
345
|
+
neither a file nor a link goes into the search field instead. Every terminal hands a dropped
|
|
346
|
+
file over as its path, each quoted its own way, and find reads them all; kitty
|
|
347
|
+
and iTerm2 3.7 also deliver the dropped picture itself through kitty's
|
|
348
|
+
drag-and-drop protocol, so a picture dragged out of a browser works there too,
|
|
349
|
+
and kitty's clipboard protocol makes Cmd+V with a picture on the clipboard work
|
|
350
|
+
directly, over ssh as well. PNG and JPEG work everywhere; macOS converts any
|
|
351
|
+
other picture (HEIC, WebP, GIF, TIFF…) and shrinks one over 25 megapixels. The
|
|
352
|
+
installed picture is named `local` in the conf's `# from` line, with the file or
|
|
353
|
+
link it came from, and keeps its original under `backgrounds/originals/` like a
|
|
354
|
+
booru post. Over ssh `ctrl+v` can only reach the clipboard through kitty's protocol,
|
|
355
|
+
since the clipboard is on your own machine.
|
|
356
|
+
|
|
332
357
|
Enter tries the picture on: ttheme downloads the original and paints the whole
|
|
333
358
|
window with it the way the installed background will look — tinted with the
|
|
334
359
|
palette, cropped with headroom above the face, at the opacity the contrast gate
|
|
@@ -371,7 +396,7 @@ conf opens with where the picture came from —
|
|
|
371
396
|
panel shows it next to the palette's name.
|
|
372
397
|
|
|
373
398
|
`preview` shows the background of the palette under the cursor while you
|
|
374
|
-
browse: through the kitty graphics protocol (Ghostty, and iTerm2 3.7 or newer)
|
|
399
|
+
browse: through the kitty graphics protocol (Ghostty, kitty, and iTerm2 3.7 or newer)
|
|
375
400
|
it draws that palette's `background-image` where Ghostty would place it, faded by
|
|
376
401
|
`background-image-opacity`, behind the list — or just its plain background when
|
|
377
402
|
it has no file. Only PNG images preview.
|
|
@@ -524,6 +549,26 @@ which the shell layer sets whenever the tab's palette changes, and reads the
|
|
|
524
549
|
picture from `backgrounds/<palette>.conf` itself — so a picture installed or
|
|
525
550
|
tuned from Ghostty or iTerm2 reaches WezTerm within a second.
|
|
526
551
|
|
|
552
|
+
kitty gets a watcher, `~/.config/ttheme/kitty.py`, which the kitty block loads:
|
|
553
|
+
the shell layer tells it what a window wears and shows through user vars
|
|
554
|
+
(`ttheme_worn`, `ttheme_shown`, `ttheme_startup`), and it answers with the
|
|
555
|
+
window's logo — kitty's per-window picture, drawn above the default background
|
|
556
|
+
and below any cell with a background of its own, which does not scroll — read
|
|
557
|
+
from `backgrounds/<palette>.conf` itself, so a picture tuned in another terminal
|
|
558
|
+
shows the next time a kitty window takes focus. kitty 0.49 draws every logo at
|
|
559
|
+
the global `window_logo_alpha` and scales every logo by `window_logo_scale`, so
|
|
560
|
+
the block sets those to 1 and 100 and the watcher fades the picture's own alpha
|
|
561
|
+
to the tuned opacity instead. kitty reloads its config by itself whenever
|
|
562
|
+
`kitty.conf` or a file it includes changes, and a reload resets every color an
|
|
563
|
+
OSC set; the watcher wraps the reload and puts each window's palette back, and
|
|
564
|
+
`sync` writes a file only when its content changed, so installing palettes
|
|
565
|
+
reloads nothing. The watcher reaches kitty windows opened after `init`.
|
|
566
|
+
|
|
567
|
+
Alacritty reloads its config by itself and keeps OSC colors through a reload.
|
|
568
|
+
`sync` puts its import in the config's own `[general]` table when there is one —
|
|
569
|
+
TOML allows a table once — and leaves a config that already imports files
|
|
570
|
+
there alone, with a note.
|
|
571
|
+
|
|
527
572
|
iTerm2 reads the colors an OSC sets as Display P3 — its default color space — so
|
|
528
573
|
its profiles and `.itermcolors` files are written in P3 too: a tab opened on a
|
|
529
574
|
`ttheme · <palette>` profile and a tab repainted to that palette land on the
|