@kecan0406/ttheme 1.0.1 → 1.0.3
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 +62 -37
- package/bin/ttheme.js +102 -102
- package/dist/manifest.json +3011 -231
- package/package.json +1 -1
- package/shell/adapters/_bg.zsh +5 -1
- package/shell/ttheme.zsh +11 -4
package/README.md
CHANGED
|
@@ -75,9 +75,12 @@ left alone. iTerm2 has no config file to edit, so it gets one profile per
|
|
|
75
75
|
installed palette instead — `ttheme · miku` and so on, in
|
|
76
76
|
`~/Library/Application Support/iTerm2/DynamicProfiles/ttheme.json`, which
|
|
77
77
|
iTerm2 reloads by itself whenever `ttheme browse` adds or drops one. One more,
|
|
78
|
-
`ttheme · default`, always wears your default palette (none under `keep`)
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
`ttheme · default`, always wears your default palette (none under `keep`), and
|
|
79
|
+
init makes it iTerm2's default profile, so new tabs and windows open wearing the
|
|
80
|
+
palette and its picture from their first frame and follow `ttheme default` from
|
|
81
|
+
then on. iTerm2 reads its default profile only when it starts, so quit and
|
|
82
|
+
reopen it once after init. The profile it replaces stays the parent of every
|
|
83
|
+
ttheme profile, so your font and keys carry over, and `keep` gives it back. It ends with a receipt, paints the first palette onto the tab you
|
|
81
84
|
ran it in (not under `keep`) and lists what to do next (`exec zsh` for the
|
|
82
85
|
`ttheme` command here, a terminal restart for new tabs).
|
|
83
86
|
Running it again updates in place; `--yes` skips every prompt and installs no
|
|
@@ -203,22 +206,27 @@ iTerm2 asks at the top of the tab whether a control sequence may change the
|
|
|
203
206
|
profile: Always Allow lets every later switch through — put the palette on once
|
|
204
207
|
more for the one that asked — and a tab it refuses still wears the palette's
|
|
205
208
|
colors, only without the picture. iTerm2 has no
|
|
206
|
-
position setting, so a picture that
|
|
209
|
+
position setting, so a tuned picture that is not centered is baked onto a canvas
|
|
210
|
+
the size of the window, as the sizes above 100% are.
|
|
207
211
|
|
|
208
212
|
A palette with no background yet can find one: on it in `preview`, tab opens
|
|
209
213
|
**find**, which searches a booru for the palette's character tag
|
|
210
214
|
(`meta.booru`) and lays the results out as a grid of thumbnails. It starts on
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
danbooru; tab moves to konachan, then yande.re, then back — they share one tag
|
|
216
|
+
vocabulary, so the same tag works on each. danbooru and yande.re carry every
|
|
217
|
+
rating and `TTHEME_FIND_RATING` picks which come through; konachan is
|
|
218
|
+
`konachan.net`, the mirror that carries safe posts only, since `konachan.com`
|
|
219
|
+
answers with a Cloudflare challenge. When a site's connection is cut off — the
|
|
220
|
+
way a network that blocks boorus by name drops danbooru — find asks whether to
|
|
221
|
+
turn on the unblock proxy (`TTHEME_FIND_UNBLOCK`); `y` saves the setting and
|
|
222
|
+
opens find again through it, `n` leaves it off. The
|
|
214
223
|
sites sit in a strip of tabs under the query, the one you are on lit in its own
|
|
215
224
|
color, and it comes again as a badge at the start of the line above a picture
|
|
216
225
|
you try on, next to the site the artwork itself came from when the post records
|
|
217
226
|
one (`pixiv.net`, `deviantart.com`). The grid starts
|
|
218
227
|
with every post of the character; `c` narrows it to **cutouts** — posts carrying
|
|
219
|
-
the site's transparency tags (`transparent_background`
|
|
220
|
-
|
|
221
|
-
`transparent_background` on danbooru) whose PNG header says they have
|
|
228
|
+
the site's transparency tags (`transparent_background` on danbooru,
|
|
229
|
+
`transparent` or `vector` on konachan, `transparent_png` on yande.re) whose PNG header says they have
|
|
222
230
|
an alpha channel; yande.re's `transparent_png` already means exactly that, so
|
|
223
231
|
its posts skip the header check, which its slow file server would drag out —
|
|
224
232
|
and the counter reads shown out of checked, `13/33`. find checks only as far as
|
|
@@ -229,12 +237,14 @@ few of those tags, so `TTHEME_FIND_CUTOUTS` names the ones to look for, site by
|
|
|
229
237
|
site.
|
|
230
238
|
|
|
231
239
|
Under each thumbnail is its post id and size, and under that whoever made it:
|
|
232
|
-
the artist
|
|
233
|
-
|
|
234
|
-
`@name` where it does not, which is every safebooru post. A score follows as
|
|
240
|
+
the artist, which every site names through its tag types at no extra
|
|
241
|
+
request, and the uploader as `@name` where a post has no artist tag. A score follows as
|
|
235
242
|
`★22` on the sites that keep one. When the same hand uploads the same picture at
|
|
236
|
-
the same size over and over, find folds that run into one tile marked `×9
|
|
237
|
-
|
|
243
|
+
the same size over and over, find folds that run into one tile marked `×9`,
|
|
244
|
+
wherever the order puts its pictures, and folds in the same way a picture
|
|
245
|
+
another site holds too — re-encoded at the same shape, cut from the post its
|
|
246
|
+
source names, or hung under the same parent; space unfolds it and folds it
|
|
247
|
+
again. Pictures by the uploader of the backgrounds
|
|
238
248
|
you already have in the same series come first and carry `≈`, so a series keeps
|
|
239
249
|
one hand; anything under 1600 px on its long edge shows its size in yellow.
|
|
240
250
|
|
|
@@ -249,7 +259,10 @@ the screen never hides what it is filtering by.
|
|
|
249
259
|
|
|
250
260
|
`/` opens the query for editing — type a tag to search for something else, or paste a post url or id
|
|
251
261
|
(`https://yande.re/post/show/214705`, `konachan:244200`, `7159377`) to go
|
|
252
|
-
straight to that one picture.
|
|
262
|
+
straight to that one picture. While you type, danbooru's tag completion lists
|
|
263
|
+
up to eight tags that start like the last word, each with its post count — the
|
|
264
|
+
way to find a costume variant such as `amane_suzuha_(beta)` or a tag you only
|
|
265
|
+
half remember; `↑`/`↓` pick one and enter searches it. A palette with no `meta.booru` tag at all opens
|
|
253
266
|
find on that empty query, so it can have a background too. `o` opens the post's
|
|
254
267
|
page in a browser.
|
|
255
268
|
|
|
@@ -264,10 +277,12 @@ marks the picture `cut out`, and `x` switches between the cut-out and the pictur
|
|
|
264
277
|
as it is. When Vision finds no character, or would leave almost nothing or
|
|
265
278
|
remove almost nothing, the picture stays opaque; elsewhere it always does. A post over 25 megapixels is
|
|
266
279
|
fetched as the site's own smaller copy instead — up to 3500 px on yande.re and
|
|
267
|
-
konachan, 850 px on
|
|
280
|
+
konachan, 850 px on danbooru — and its size carries `↓`; those
|
|
268
281
|
copies are JPEGs, so a cutout tried on that way comes out opaque. `←`/`→` try
|
|
269
|
-
the neighbours, which find fetches ahead of you two at a time, enter installs
|
|
270
|
-
and the
|
|
282
|
+
the neighbours, which find fetches ahead of you two at a time, and enter installs
|
|
283
|
+
and returns to the grid with the tile marked `✓`, the tab, search and scroll as
|
|
284
|
+
you left them; esc then hands the last one installed to the preview, which
|
|
285
|
+
carries on straight into the tuning panel below. `c` switches
|
|
271
286
|
between every post and the cutouts, esc goes back. Unless the settings say otherwise,
|
|
272
287
|
only `safe` and `general` posts are shown, and none tagged with nudity or
|
|
273
288
|
underwear (`nude`, `panties` and each site's own spelling of them) — with only
|
|
@@ -280,8 +295,12 @@ When a site asks ttheme to slow down, find waits as long as it names, up to a
|
|
|
280
295
|
minute, with a countdown at the bottom. ttheme keeps no
|
|
281
296
|
list of images — the tag is all it knows about a character.
|
|
282
297
|
|
|
283
|
-
An install writes `<palette>.png` (the tinted figure),
|
|
284
|
-
(the
|
|
298
|
+
An install writes `<palette>.<hash>.png` (the tinted figure),
|
|
299
|
+
`<palette>.<hash>@fill-<focus>.png` (the picture made at the shape of the window
|
|
300
|
+
find ran in: a cut-out stands whole from its head down against the right edge, a
|
|
301
|
+
little taller than the window, and a wallpaper covers it from its top) — the hash is of
|
|
302
|
+
their content, because Ghostty and iTerm2 reload a background only when its path
|
|
303
|
+
changes, so no two pictures may share a name — `<palette>.conf` and the untouched original under
|
|
285
304
|
`backgrounds/originals/`, and starts it untuned — the picture it replaces moves
|
|
286
305
|
to the shelf with the tuning it had. The
|
|
287
306
|
conf opens with where the picture came from —
|
|
@@ -300,8 +319,8 @@ steps at a time). Size walks 1% at a time, shown large in the middle of the
|
|
|
300
319
|
screen as it changes: 100% is the whole image fitted into the window
|
|
301
320
|
(`contain`), below that it shrinks to 20%, above it the image grows around the
|
|
302
321
|
face until it covers the window, and the top step is **fill** (`cover`). Fill
|
|
303
|
-
uses `<palette>@fill-<focus>.png` when it sits beside the image — a crop made
|
|
304
|
-
to fill the window, whose name carries the height of the
|
|
322
|
+
uses `<palette>.<hash>@fill-<focus>.png` when it sits beside the image — a crop made
|
|
323
|
+
to fill the window, whose name carries the height of the figure at the window's middle, which
|
|
305
324
|
the sizes above 100% zoom around — and the image itself otherwise. Position
|
|
306
325
|
steps through the nine `background-image-position` anchors, or `1`–`9` jump to
|
|
307
326
|
one in reading order; opacity moves by 0.01. Space turns the palette's
|
|
@@ -320,13 +339,16 @@ picture before `,` or `.` moves off it.
|
|
|
320
339
|
The palette's `.conf` holds those defaults; the preview only appends two
|
|
321
340
|
optional includes to it and keeps everything else in `<palette>.tune.conf` (the
|
|
322
341
|
tuning) and `<palette>.off.conf` (the off switch), which Ghostty loads after
|
|
323
|
-
the conf. Kept changes are written when the preview closes, by whichever key,
|
|
324
|
-
|
|
342
|
+
the conf. Kept changes are written when the preview closes, by whichever key,
|
|
343
|
+
and reach both terminals from whichever one ran the preview: Ghostty reloads
|
|
344
|
+
when it is showing that palette, and iTerm2's profiles are rewritten. Ghostty has no scale setting,
|
|
325
345
|
so every size but 100% and fill is baked into a copy beside the image and the
|
|
326
346
|
tuning points at it: below 100% onto a transparent canvas of the image's own
|
|
327
|
-
size (`kagami@60-bottom-right.png`, fitted with `contain`), above it onto
|
|
328
|
-
the window's size at the time (`kagami@130-center-2880x1800.png`,
|
|
329
|
-
`cover`).
|
|
347
|
+
size (`kagami.1a2b3c4d@60-bottom-right.png`, fitted with `contain`), above it onto
|
|
348
|
+
one of the window's size at the time (`kagami.1a2b3c4d@130-center-2880x1800.png`,
|
|
349
|
+
with `cover`). With iTerm2 wired, a size of 100% or less that is not centered
|
|
350
|
+
goes onto the window-sized canvas too, since iTerm2 cannot place an image.
|
|
351
|
+
Baking runs `sips`, so those sizes are offered on macOS only.
|
|
330
352
|
|
|
331
353
|
The preview draws inside the cell grid, and Ghostty's `window-padding` around
|
|
332
354
|
it keeps showing the configured background. While the cursor rests on the
|
|
@@ -355,9 +377,11 @@ With `TTHEME_TAB_PALETTE=seq`, new tabs take the next palette in group order, wi
|
|
|
355
377
|
tabs — so opening four tabs walks you through four different characters rather
|
|
356
378
|
than rolling the same one twice.
|
|
357
379
|
|
|
358
|
-
Settings live in `~/.config/ttheme/config.zsh` — `init` seeds it with
|
|
359
|
-
|
|
360
|
-
|
|
380
|
+
Settings live in `~/.config/ttheme/config.zsh` — `init` seeds it with every
|
|
381
|
+
setting at its default on a commented line, so a default a later version changes
|
|
382
|
+
reaches you, and never overwrites a line you changed — bar `TTHEME_TAB_PALETTE`, which its
|
|
383
|
+
default/rotate/keep question sets — `ttheme config` opens it in `$EDITOR` and alt-c in `preview` edits it in place. Only a value that differs from the default
|
|
384
|
+
is left uncommented; setting one back comments it out again. Each line is a plain zsh
|
|
361
385
|
`: ${VAR:=value}` assignment, so a variable exported before the layer loads
|
|
362
386
|
still wins:
|
|
363
387
|
|
|
@@ -370,12 +394,13 @@ still wins:
|
|
|
370
394
|
| `TTHEME_FIND_RATING` | `safe` | the ratings `find` lists, any of `safe`, `questionable` and `explicit` separated by spaces (`"safe explicit"`). Each site is read in its own vocabulary, so danbooru's `s` (sensitive) is not mistaken for yande.re's `s` (safe). The set shows next to the query whenever it is not just `safe` |
|
|
371
395
|
| `TTHEME_FIND_BLOCK` | `nudity underwear` | the posts `find` drops by tag: `nudity` (`nude`, `naked`, `topless`…), `underwear` (`panties`, `bra`, `lingerie`… — each with the site's own spelling), both, or `none` to keep every post. What is let through shows next to the query as `allows …` |
|
|
372
396
|
| `TTHEME_FIND_POSTS` | `all` | what `find` opens on — every post of the character, or only the transparent cutouts (`cutouts`) |
|
|
373
|
-
| `TTHEME_FIND_CUTOUTS` | — | the tags `find` calls a transparent cutout, as `key=tag,tag` pairs separated by spaces, keyed by `
|
|
374
|
-
| `
|
|
375
|
-
| `
|
|
397
|
+
| `TTHEME_FIND_CUTOUTS` | — | the tags `find` calls a transparent cutout, as `key=tag,tag` pairs separated by spaces, keyed by `danbooru`, `konachan` or `yande` (`konachan=transparent,vector yande=transparent_png`). A site with several tags matches any of them; `danbooru=` names none, so its cutouts are the posts whose PNG header has an alpha channel. A site named here loses yande.re's shortcut of skipping that header check. Sites left out keep the built-in tags |
|
|
398
|
+
| `TTHEME_FIND_SOLO` | `on` | `on` keeps only the posts tagged `solo` — the character alone, which is what a backdrop needs. konachan and yande.re do not tag how many people a picture shows, so their posts borrow the tags danbooru holds for the same file, one request per page; a post danbooru does not have is left alone. The query line says `solo` while it is on |
|
|
399
|
+
| `TTHEME_FIND_ORDER` | `fit` | the order `find` lists posts in — `fit` ranks each page it fetches by how well a post makes a backdrop (solo, resolution against the window, a cutout or an aspect close to the window's, score within the page, the palette's colors in its preview; comics, monochrome, sketches and landscapes sink) and appends it below what is already shown, so nothing moves under you; `newest`; or `score` |
|
|
400
|
+
| `TTHEME_FIND_SETS` | `fold` | a run of the same picture at the same size from one uploader, and a picture another site holds too: `fold` shows it as one tile marked `×N`, `show` lists every one |
|
|
376
401
|
| `TTHEME_FIND_REMOVE_BG` | `on` | on macOS, `on` cuts the character out of an opaque picture `find` tries on, with the system's Vision framework; `off` leaves it as it is. The row is in the `s` panel as `remove bg` |
|
|
377
|
-
| `TTHEME_FIND_UNBLOCK` | `0` | `1` sends `find`'s
|
|
378
|
-
| `TTHEME_FIND_HOSTS` | — | send a `find` site somewhere else, as `key=https://host` pairs (`
|
|
402
|
+
| `TTHEME_FIND_UNBLOCK` | `0` | find offers to turn it on when a site's connection is cut off. `1` sends `find`'s requests to danbooru through a proxy it runs on `127.0.0.1`, which splits the TLS handshake across two records so a network that blocks it by hostname cannot read the name; konachan and yande.re, which no network is known to block, still go direct. It is not a VPN: the address you reach is unchanged and nothing else on the machine is affected. Needs node 22.21 or newer, and the query line says `unblock` while it is on |
|
|
403
|
+
| `TTHEME_FIND_HOSTS` | — | send a `find` site somewhere else, as `key=https://host` pairs (`danbooru=https://safebooru.donmai.us`, the general-rated mirror, reachable where danbooru is blocked). The tab keeps its name and carries `*` |
|
|
379
404
|
|
|
380
405
|
## The catalog
|
|
381
406
|
|
|
@@ -459,7 +484,7 @@ name = "madoka" # must match the filename
|
|
|
459
484
|
group = "Madoka Magica" # needs a [[group]] in themes/_groups.toml
|
|
460
485
|
order = 15 # position in the rotation
|
|
461
486
|
ansi_source = "Elegant + Magica" # what the harmonizer was fed
|
|
462
|
-
booru = "kaname_madoka" #
|
|
487
|
+
booru = "kaname_madoka" # booru character tag find searches
|
|
463
488
|
signature = ["cursor", "ansi1", "ansi3"] # the three slots the site draws as identity
|
|
464
489
|
|
|
465
490
|
[colors]
|