@kecan0406/ttheme 0.1.1 → 0.1.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 CHANGED
@@ -62,16 +62,17 @@ came from — `ttheme` prints it, and it is in the theme's TOML.
62
62
  npx @kecan0406/ttheme@latest init
63
63
  ```
64
64
 
65
- It detects your terminal, asks which ones to wire, places the zsh layer under
66
- `~/.config/ttheme`, and edits your terminal config and `~/.zshrc` between
67
- `# ttheme begin` / `# ttheme end` markers everything outside the markers is
68
- left alone. Running it again updates in place; `--yes` skips every prompt and
69
- takes the defaults.
70
-
71
- **`init` installs no palettes.** It sets the machinery up and then offers the
72
- catalog a series at a time — `tab` marks a series, enter installs every palette
73
- in it; `ttheme browse` opens the full catalog any time, to add or drop single
74
- palettes.
65
+ It asks which terminals to wire and which series to install — `space` marks
66
+ one, enter moves on, and `select all` takes the lot then shows what it is
67
+ about to change and writes it all at once, so cancelling before that touches
68
+ nothing. It places the zsh layer under `~/.config/ttheme` and edits your
69
+ terminal config and `~/.zshrc` between `# ttheme begin` / `# ttheme end`
70
+ markers — everything outside the markers is left alone. It ends with a receipt,
71
+ paints the first palette onto the tab you ran it in and lists what to do next
72
+ (`exec zsh` for the `ttheme` command here, a terminal restart for new tabs).
73
+ Running it again updates in place; `--yes` skips every prompt and installs no
74
+ palettes — `ttheme browse` opens the full catalog any time, to add or drop
75
+ single palettes.
75
76
 
76
77
  **WezTerm and iTerm2** — one archive per terminal in the
77
78
  [latest release](https://github.com/kecan0406/ttheme/releases/latest):
@@ -177,28 +178,76 @@ rather than the palette painted on one tab.
177
178
  A palette with no background yet can find one: on it in `preview`, tab opens
178
179
  **find**, which searches a booru for the palette's character tag
179
180
  (`meta.booru`) and lays the results out as a grid of thumbnails. It starts on
180
- safebooru; `p` moves to yande.re, then konachan, then back — the three share
181
- one tag vocabulary, so the same tag works on each. The site you are on sits in
182
- a colored badge at the top right, and again at the start of the line above a
183
- picture you try on, next to the site the artwork itself came from when the post
184
- records one (`pixiv.net`, `deviantart.com`). The grid starts
185
- with **cutouts** posts carrying the site's transparency tags
186
- (`transparent_background` or `vector_trace` on safebooru, `transparent_png` on
187
- yande.re, `transparent` or `vector` on konachan) whose PNG header says they have
181
+ safebooru; tab moves to yande.re, then konachan, then danbooru, then back — they
182
+ share one tag vocabulary, so the same tag works on each, and danbooru here is
183
+ `safebooru.donmai.us`, the mirror that carries general-rated posts only. The
184
+ sites sit in a strip of tabs under the query, the one you are on lit in its own
185
+ color, and it comes again as a badge at the start of the line above a picture
186
+ you try on, next to the site the artwork itself came from when the post records
187
+ one (`pixiv.net`, `deviantart.com`). The grid starts
188
+ with every post of the character; `c` narrows it to **cutouts** posts carrying
189
+ the site's transparency tags (`transparent_background` or `vector_trace` on
190
+ safebooru, `transparent_png` on yande.re, `transparent` or `vector` on konachan,
191
+ `transparent_background` on danbooru) whose PNG header says they have
188
192
  an alpha channel; yande.re's `transparent_png` already means exactly that, so
189
193
  its posts skip the header check, which its slow file server would drag out —
190
- and the counter reads shown out of checked, `13/33`. Pictures by the uploader of the backgrounds you already have
191
- in the same series come first and carry `≈`, so a series keeps one hand;
192
- anything under 1600 px on its long edge shows its size in yellow. Enter tries
193
- the picture on: ttheme downloads the original and paints the whole window with
194
- it the way the installed background will look tinted with the palette,
195
- cropped with headroom above the face, at the opacity the contrast gate allows —
196
- over a sample of shell output, with the share of transparent pixels next to its
197
- size (`opaque` when there are none). `←`/`→` try the neighbours, enter installs,
198
- and the preview carries on straight into the tuning panel below. Tab switches to
199
- every post of the character, esc goes back. Only `safe` and `general` posts are
200
- ever shown yande.re and konachan are always asked for `rating:s`, whatever
201
- else is searched and downloads stay in `~/.cache/ttheme/<site>/`. ttheme keeps no
194
+ and the counter reads shown out of checked, `13/33`. find checks only as far as
195
+ the grid reaches and checks more as you scroll; each answer is remembered, so
196
+ coming back to a site or a palette never asks its file server again, and a site
197
+ you have already seen comes back the moment you tab to it. Newer series carry
198
+ few of those tags, so `TTHEME_FIND_CUTOUTS` names the ones to look for, site by
199
+ site.
200
+
201
+ Under each thumbnail is its post id and size, and under that whoever made it:
202
+ the artist where the site names one yande.re, konachan and danbooru answer
203
+ with the tag types, so it costs no extra request — and the uploader as
204
+ `@name` where it does not, which is every safebooru post. A score follows as
205
+ `★22` on the sites that keep one. When the same hand uploads the same picture at
206
+ the same size over and over, find folds that run into one tile marked `×9`;
207
+ space unfolds it and folds it again. Pictures by the uploader of the backgrounds
208
+ you already have in the same series come first and carry `≈`, so a series keeps
209
+ one hand; anything under 1600 px on its long edge shows its size in yellow.
210
+
211
+ `s` opens the settings — the ratings to list, the nudity and underwear tags to
212
+ block, cutouts or all, newest or score, and whether runs fold — with ↑↓ on the
213
+ setting, enter to save them to `config.zsh` and esc to put them back. ←→ change
214
+ a value; on the two rows of checkboxes (rating and block) they move between the
215
+ boxes and space ticks one, so `safe` and `explicit` can be listed without
216
+ `questionable`, or underwear let through while nudity stays blocked. At least
217
+ one rating stays ticked. Whatever is not the default shows next to the query, so
218
+ the screen never hides what it is filtering by.
219
+
220
+ `/` opens the query for editing — type a tag to search for something else, or paste a post url or id
221
+ (`https://yande.re/post/show/214705`, `konachan:244200`, `7159377`) to go
222
+ straight to that one picture. A palette with no `meta.booru` tag at all opens
223
+ find on that empty query, so it can have a background too. `o` opens the post's
224
+ page in a browser.
225
+
226
+ Enter tries the picture on: ttheme downloads the original and paints the whole
227
+ window with it the way the installed background will look — tinted with the
228
+ palette, cropped with headroom above the face, at the opacity the contrast gate
229
+ allows — over a sample of shell output, with the share of transparent pixels
230
+ next to its size (`opaque` when there are none). On macOS an opaque picture is
231
+ cut out first: ttheme asks the system's own Vision framework (macOS 14 or newer,
232
+ through `osascript` — nothing is installed or uploaded) for the character alone,
233
+ marks the picture `cut out`, and `x` switches between the cut-out and the picture
234
+ as it is. When Vision finds no character, or would leave almost nothing or
235
+ remove almost nothing, the picture stays opaque; elsewhere it always does. A post over 25 megapixels is
236
+ fetched as the site's own smaller copy instead — up to 3500 px on yande.re and
237
+ konachan, 850 px on safebooru and danbooru — and its size carries `↓`; those
238
+ copies are JPEGs, so a cutout tried on that way comes out opaque. `←`/`→` try
239
+ the neighbours, which find fetches ahead of you two at a time, enter installs,
240
+ and the preview carries on straight into the tuning panel below. `c` switches
241
+ between every post and the cutouts, esc goes back. Unless the settings say otherwise,
242
+ only `safe` and `general` posts are shown, and none tagged with nudity or
243
+ underwear (`nude`, `panties` and each site's own spelling of them) — with only
244
+ `safe` ticked yande.re and konachan are asked for `rating:s`, whatever else is
245
+ searched; ticking more ratings or unticking a block in the `s` panel widen it. danbooru takes only two tags from a
246
+ signed-out search, so on it a cutout search leaves the score order out and says
247
+ so. Thumbnails and header checks stay in
248
+ `~/.cache/ttheme/<site>/`; the pictures you try on last only while find is open.
249
+ When a site asks ttheme to slow down, find waits as long as it names, up to a
250
+ minute, with a countdown at the bottom. ttheme keeps no
202
251
  list of images — the tag is all it knows about a character.
203
252
 
204
253
  An install writes `<palette>.png` (the tinted figure), `<palette>@fill-<focus>.png`
@@ -267,8 +316,8 @@ New tabs take the next palette in group order, with the counter shared across
267
316
  tabs — so opening four tabs walks you through four different characters rather
268
317
  than rolling the same one twice.
269
318
 
270
- Settings live in `~/.config/ttheme/config.zsh` — `init` seeds it from your
271
- answers, `ttheme config` opens it in `$EDITOR` and alt-c in `preview` edits it in place. Each line is a plain zsh
319
+ Settings live in `~/.config/ttheme/config.zsh` — `init` seeds it with the
320
+ defaults and never overwrites a line you changed, `ttheme config` opens it in `$EDITOR` and alt-c in `preview` edits it in place. Each line is a plain zsh
272
321
  `: ${VAR:=value}` assignment, so a variable exported before the layer loads
273
322
  still wins:
274
323
 
@@ -278,23 +327,35 @@ still wins:
278
327
  | `TTHEME_ANNOUNCE` | `1` | `0` silences the one-line notice under "Last login:" |
279
328
  | `TTHEME_FX` | `typewriter` | search hint animation — `typewriter`, `decode` or `glitch` |
280
329
  | `TTHEME_SORT` | `abc` | `series` lists series and palettes in the order they were added instead of by name — in `ttheme`, `preview` and, once exported, the `init` picker |
330
+ | `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` |
331
+ | `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 …` |
332
+ | `TTHEME_FIND_POSTS` | `all` | what `find` opens on — every post of the character, or only the transparent cutouts (`cutouts`) |
333
+ | `TTHEME_FIND_CUTOUTS` | — | the tags `find` calls a transparent cutout, as `key=tag,tag` pairs separated by spaces, keyed by `safebooru`, `yande`, `konachan` or `danbooru` (`safebooru=transparent_background yande=transparent_png,vector`). 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 |
334
+ | `TTHEME_FIND_ORDER` | `newest` | the order `find` lists posts in — `newest` or `score` |
335
+ | `TTHEME_FIND_SETS` | `fold` | a run of the same picture at the same size from one uploader: `fold` shows it as one tile marked `×N`, `show` lists every one |
336
+ | `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` |
337
+ | `TTHEME_FIND_UNBLOCK` | `0` | `1` sends `find`'s own requests through a proxy it runs on `127.0.0.1`, which splits the TLS handshake across two records so a network that blocks boorus by hostname cannot read the name. 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 |
338
+ | `TTHEME_FIND_HOSTS` | — | send a `find` site somewhere else, as `key=https://host` pairs (`konachan=https://konachan.com danbooru=https://danbooru.donmai.us`). The tab keeps its name and carries `*`. ttheme ships the safe mirrors only; the hosts that serve everything are yours to name, and plenty of networks block them |
281
339
 
282
340
  ## The catalog
283
341
 
284
- A fresh install carries no palettes at all. `ttheme browse` opens the catalog as
285
- a live picker groups fold and unfold, typing filters, the tab repaints as the
286
- cursor lands on a palette, `tab` marks one (or a whole series from its header),
287
- and enter installs exactly what is marked and removes what is not:
342
+ The catalog is not installed wholesale: `init` installs the series you pick, and
343
+ `init --yes` none at all. `ttheme browse` opens the catalog as a live picker
344
+ groups fold and unfold, typing filters (a query has no spaces, `space` is the
345
+ pick key), the tab repaints as the cursor lands on a palette, `space` marks one
346
+ (a series from its header, everything shown from `select all`), and enter
347
+ installs exactly what is marked and removes what is not:
288
348
 
289
349
  ```
290
350
  ◆ catalog (4/107 · 2 picked)
291
351
  │ ⌕ bo_
352
+ │ ○ select all (4)
292
353
  │ ▾ Bocchi the Rock! (2/4) ぼっち・ざ・ろっく!
293
354
  │ ▶ ● bocchi ● ▁▁▁▁▁▁ Sakura + Kessoku
294
355
  │ ● kita ● ▁▁▁▁▁▁ Wild Cherry + Kessoku
295
356
  │ ○ nijika ● ▁▁▁▁▁▁ Medallion
296
357
  │ ○ ryo ● ▁▁▁▁▁▁ TokyoNight Storm
297
- └ ↑↓ move · ←→ fold · tab pick · type to filter · enter install · esc cancel
358
+ └ ↑↓ move · ←→ fold · space pick · type to filter · enter install · esc cancel
298
359
  ```
299
360
 
300
361
  The counts stay honest: `4/107` is what the filter matched out of the catalog,