@kecan0406/ttheme 1.0.0 → 1.0.2
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 +38 -16
- package/bin/ttheme.js +98 -97
- package/dist/manifest.json +1970 -122
- package/package.json +1 -1
- package/shell/adapters/_bg.zsh +521 -0
- package/shell/adapters/_osc.zsh +2 -0
- package/shell/adapters/ghostty.zsh +8 -515
- package/shell/adapters/iterm2.zsh +67 -0
- package/shell/ttheme.zsh +62 -16
package/README.md
CHANGED
|
@@ -74,9 +74,13 @@ so cancelling before that touches nothing. It places the zsh layer under
|
|
|
74
74
|
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
|
-
iTerm2 reloads by itself whenever `ttheme browse` adds or drops one.
|
|
78
|
-
|
|
79
|
-
|
|
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`), 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
|
|
80
84
|
ran it in (not under `keep`) and lists what to do next (`exec zsh` for the
|
|
81
85
|
`ttheme` command here, a terminal restart for new tabs).
|
|
82
86
|
Running it again updates in place; `--yes` skips every prompt and installs no
|
|
@@ -160,11 +164,12 @@ the cursor. The list and the sample widen with the window (the sample up to 64
|
|
|
160
164
|
columns) and the gap between them takes the rest; the tuning panel takes the
|
|
161
165
|
sample's place while open, and so does the key list once the sample is 48
|
|
162
166
|
columns wide.
|
|
163
|
-
Under Ghostty with `TTHEME_TAB_PALETTE=off` (the default), enter asks **this tab** or
|
|
167
|
+
Under Ghostty or iTerm2 with `TTHEME_TAB_PALETTE=off` (the default), enter asks **this tab** or
|
|
164
168
|
**default**: default records the palette as your default palette (so a later
|
|
165
169
|
`add` or `remove` keeps it), rewrites `theme =` in the `# ttheme begin` block of
|
|
166
|
-
your Ghostty config and sends `SIGUSR2` to the Ghostty that owns the tab,
|
|
167
|
-
|
|
170
|
+
your Ghostty config and sends `SIGUSR2` to the Ghostty that owns the tab, and
|
|
171
|
+
rewrites iTerm2's `ttheme · default` profile, which iTerm2 reloads by itself — so new tabs, and open tabs you have not
|
|
172
|
+
painted by hand, take the palette without a restart. Painting is per surface
|
|
168
173
|
otherwise: a new tab starts from the configured theme, not from what the last
|
|
169
174
|
tab was painted.
|
|
170
175
|
|
|
@@ -192,6 +197,18 @@ none. A tab busy with a command catches up at its next prompt, focus reporting
|
|
|
192
197
|
is off while that command runs, and a tab whose colors are not a ttheme palette
|
|
193
198
|
leaves the picture where it is.
|
|
194
199
|
|
|
200
|
+
iTerm2 keeps a picture per tab. There the picture lives in the palette's own
|
|
201
|
+
profile — `ttheme · kagami` carries the file, its opacity as Blend and cover or
|
|
202
|
+
contain as the image mode, rewritten whenever the picture or its tuning
|
|
203
|
+
changes — and putting a palette with a picture on, or taking one off, moves the
|
|
204
|
+
tab to that palette's profile with `OSC 1337 SetProfile`. The first time,
|
|
205
|
+
iTerm2 asks at the top of the tab whether a control sequence may change the
|
|
206
|
+
profile: Always Allow lets every later switch through — put the palette on once
|
|
207
|
+
more for the one that asked — and a tab it refuses still wears the palette's
|
|
208
|
+
colors, only without the picture. iTerm2 has no
|
|
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.
|
|
211
|
+
|
|
195
212
|
A palette with no background yet can find one: on it in `preview`, tab opens
|
|
196
213
|
**find**, which searches a booru for the palette's character tag
|
|
197
214
|
(`meta.booru`) and lays the results out as a grid of thumbnails. It starts on
|
|
@@ -267,8 +284,10 @@ When a site asks ttheme to slow down, find waits as long as it names, up to a
|
|
|
267
284
|
minute, with a countdown at the bottom. ttheme keeps no
|
|
268
285
|
list of images — the tag is all it knows about a character.
|
|
269
286
|
|
|
270
|
-
An install writes `<palette>.png` (the tinted figure),
|
|
271
|
-
(the window-shaped crop)
|
|
287
|
+
An install writes `<palette>.<hash>.png` (the tinted figure),
|
|
288
|
+
`<palette>.<hash>@fill-<focus>.png` (the window-shaped crop) — the hash is of
|
|
289
|
+
their content, because Ghostty and iTerm2 reload a background only when its path
|
|
290
|
+
changes, so no two pictures may share a name — `<palette>.conf` and the untouched original under
|
|
272
291
|
`backgrounds/originals/`, and starts it untuned — the picture it replaces moves
|
|
273
292
|
to the shelf with the tuning it had. The
|
|
274
293
|
conf opens with where the picture came from —
|
|
@@ -276,8 +295,8 @@ conf opens with where the picture came from —
|
|
|
276
295
|
panel shows it next to the palette's name.
|
|
277
296
|
|
|
278
297
|
`preview` shows the background of the palette under the cursor while you
|
|
279
|
-
browse: through the kitty graphics protocol
|
|
280
|
-
`background-image` where Ghostty would place it, faded by
|
|
298
|
+
browse: through the kitty graphics protocol (Ghostty, and iTerm2 3.7 or newer)
|
|
299
|
+
it draws that palette's `background-image` where Ghostty would place it, faded by
|
|
281
300
|
`background-image-opacity`, behind the list — or just its plain background when
|
|
282
301
|
it has no file. Only PNG images preview.
|
|
283
302
|
|
|
@@ -287,7 +306,7 @@ steps at a time). Size walks 1% at a time, shown large in the middle of the
|
|
|
287
306
|
screen as it changes: 100% is the whole image fitted into the window
|
|
288
307
|
(`contain`), below that it shrinks to 20%, above it the image grows around the
|
|
289
308
|
face until it covers the window, and the top step is **fill** (`cover`). Fill
|
|
290
|
-
uses `<palette>@fill-<focus>.png` when it sits beside the image — a crop made
|
|
309
|
+
uses `<palette>.<hash>@fill-<focus>.png` when it sits beside the image — a crop made
|
|
291
310
|
to fill the window, whose name carries the height of the face in percent, which
|
|
292
311
|
the sizes above 100% zoom around — and the image itself otherwise. Position
|
|
293
312
|
steps through the nine `background-image-position` anchors, or `1`–`9` jump to
|
|
@@ -307,13 +326,16 @@ picture before `,` or `.` moves off it.
|
|
|
307
326
|
The palette's `.conf` holds those defaults; the preview only appends two
|
|
308
327
|
optional includes to it and keeps everything else in `<palette>.tune.conf` (the
|
|
309
328
|
tuning) and `<palette>.off.conf` (the off switch), which Ghostty loads after
|
|
310
|
-
the conf. Kept changes are written when the preview closes, by whichever key,
|
|
311
|
-
|
|
329
|
+
the conf. Kept changes are written when the preview closes, by whichever key,
|
|
330
|
+
and reach both terminals from whichever one ran the preview: Ghostty reloads
|
|
331
|
+
when it is showing that palette, and iTerm2's profiles are rewritten. Ghostty has no scale setting,
|
|
312
332
|
so every size but 100% and fill is baked into a copy beside the image and the
|
|
313
333
|
tuning points at it: below 100% onto a transparent canvas of the image's own
|
|
314
|
-
size (`kagami@60-bottom-right.png`, fitted with `contain`), above it onto
|
|
315
|
-
the window's size at the time (`kagami@130-center-2880x1800.png`,
|
|
316
|
-
`cover`).
|
|
334
|
+
size (`kagami.1a2b3c4d@60-bottom-right.png`, fitted with `contain`), above it onto
|
|
335
|
+
one of the window's size at the time (`kagami.1a2b3c4d@130-center-2880x1800.png`,
|
|
336
|
+
with `cover`). With iTerm2 wired, a size of 100% or less that is not centered
|
|
337
|
+
goes onto the window-sized canvas too, since iTerm2 cannot place an image.
|
|
338
|
+
Baking runs `sips`, so those sizes are offered on macOS only.
|
|
317
339
|
|
|
318
340
|
The preview draws inside the cell grid, and Ghostty's `window-padding` around
|
|
319
341
|
it keeps showing the configured background. While the cursor rests on the
|