@kecan0406/ttheme 1.0.31 → 1.0.33

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
@@ -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] | ![No][no] | ![No][no] | ![Partial][partial] | ![No][no] | ![No][no] | ![No][no] | ![No][no] |
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** — Ghostty and kitty through native adapters, the rest
43
- through OSC escape sequences, per pane in WezTerm and Windows Terminal.
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. WezTerm shows the picture of the
56
- active tab per window and switches it as `preview` moves, but has no
57
- in-terminal preview or tuning — find and tune from Ghostty or iTerm2. Cut-outs
58
- and baked crops need macOS.
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
@@ -195,6 +200,7 @@ ttheme homura paint this tab (a unique prefix works: ttheme ho)
195
200
  ttheme preview browse live — focus repaints the tab, enter keeps it (this tab or default)
196
201
  ttheme next advance this tab to the next palette
197
202
  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
198
204
  ttheme pin pick a palette for this directory — cd into it repaints, cd out restores
199
205
  ttheme unpin drop the palette pinned to this directory
200
206
  ttheme config edit settings in $EDITOR — they apply in new tabs
@@ -329,6 +335,26 @@ half remember; `↑`/`↓` pick one and enter searches it. A palette with no `me
329
335
  find on that empty query, so it can have a background too. `o` opens the post's
330
336
  page in a browser.
331
337
 
338
+ A picture of your own goes in the same way. Drop an image file on the window
339
+ while find is open, or paste it — a file copied in Finder, its path, or a link
340
+ to the image — and find tries it on as if it were a post. `ctrl+v` (or `v`
341
+ outside the search field, `alt+v` on Windows) reads the clipboard itself, which
342
+ is how a screenshot or a browser's "Copy Image" gets in, since no terminal
343
+ pastes picture data as text — on macOS ctrl+shift+cmd+4 takes a screenshot
344
+ straight to the clipboard. When the window comes back into focus with a picture
345
+ on the clipboard, find says so for a few seconds; text on the clipboard that is
346
+ neither a file nor a link goes into the search field instead. Every terminal hands a dropped
347
+ file over as its path, each quoted its own way, and find reads them all; kitty
348
+ and iTerm2 3.7 also deliver the dropped picture itself through kitty's
349
+ drag-and-drop protocol, so a picture dragged out of a browser works there too,
350
+ and kitty's clipboard protocol makes Cmd+V with a picture on the clipboard work
351
+ directly, over ssh as well. PNG and JPEG work everywhere; macOS converts any
352
+ other picture (HEIC, WebP, GIF, TIFF…) and shrinks one over 25 megapixels. The
353
+ installed picture is named `local` in the conf's `# from` line, with the file or
354
+ link it came from, and keeps its original under `backgrounds/originals/` like a
355
+ booru post. Over ssh `ctrl+v` can only reach the clipboard through kitty's protocol,
356
+ since the clipboard is on your own machine.
357
+
332
358
  Enter tries the picture on: ttheme downloads the original and paints the whole
333
359
  window with it the way the installed background will look — tinted with the
334
360
  palette, cropped with headroom above the face, at the opacity the contrast gate
@@ -371,7 +397,7 @@ conf opens with where the picture came from —
371
397
  panel shows it next to the palette's name.
372
398
 
373
399
  `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)
400
+ browse: through the kitty graphics protocol (Ghostty, kitty, and iTerm2 3.7 or newer)
375
401
  it draws that palette's `background-image` where Ghostty would place it, faded by
376
402
  `background-image-opacity`, behind the list — or just its plain background when
377
403
  it has no file. Only PNG images preview.
@@ -524,6 +550,26 @@ which the shell layer sets whenever the tab's palette changes, and reads the
524
550
  picture from `backgrounds/<palette>.conf` itself — so a picture installed or
525
551
  tuned from Ghostty or iTerm2 reaches WezTerm within a second.
526
552
 
553
+ kitty gets a watcher, `~/.config/ttheme/kitty.py`, which the kitty block loads:
554
+ the shell layer tells it what a window wears and shows through user vars
555
+ (`ttheme_worn`, `ttheme_shown`, `ttheme_startup`), and it answers with the
556
+ window's logo — kitty's per-window picture, drawn above the default background
557
+ and below any cell with a background of its own, which does not scroll — read
558
+ from `backgrounds/<palette>.conf` itself, so a picture tuned in another terminal
559
+ shows the next time a kitty window takes focus. kitty 0.49 draws every logo at
560
+ the global `window_logo_alpha` and scales every logo by `window_logo_scale`, so
561
+ the block sets those to 1 and 100 and the watcher fades the picture's own alpha
562
+ to the tuned opacity instead. kitty reloads its config by itself whenever
563
+ `kitty.conf` or a file it includes changes, and a reload resets every color an
564
+ OSC set; the watcher wraps the reload and puts each window's palette back, and
565
+ `sync` writes a file only when its content changed, so installing palettes
566
+ reloads nothing. The watcher reaches kitty windows opened after `init`.
567
+
568
+ Alacritty reloads its config by itself and keeps OSC colors through a reload.
569
+ `sync` puts its import in the config's own `[general]` table when there is one —
570
+ TOML allows a table once — and leaves a config that already imports files
571
+ there alone, with a note.
572
+
527
573
  iTerm2 reads the colors an OSC sets as Display P3 — its default color space — so
528
574
  its profiles and `.itermcolors` files are written in P3 too: a tab opened on a
529
575
  `ttheme · <palette>` profile and a tab repainted to that palette land on the