@kecan0406/ttheme 1.2.16 → 1.2.18
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 +35 -24
- package/bin/ttheme.js +232 -220
- package/bin/ttheme.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/package.json +3 -2
- package/shell/adapters/_bg.zsh +5 -5
- package/shell/adapters/_osc.zsh +2 -0
- package/shell/adapters/terminal-app.zsh +5 -0
- package/shell/preview.zsh +305 -140
- package/shell/ttheme.zsh +95 -32
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
20
|
<p align="center">
|
|
21
|
-
<img src="docs/demo.gif" alt="ttheme
|
|
21
|
+
<img src="docs/demo.gif" alt="ttheme: typing nichi filters to the Nichijou palettes, each one repaints the tab as the cursor lands on it, then rei is picked and applied" width="860">
|
|
22
22
|
</p>
|
|
23
23
|
|
|
24
24
|
## Why ttheme
|
|
@@ -40,8 +40,10 @@
|
|
|
40
40
|
npx @kecan0406/ttheme@latest init
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
It
|
|
44
|
-
|
|
43
|
+
It needs Node 22 or newer and zsh, which macOS ships — bash and fish get the
|
|
44
|
+
`ttheme` command too, run through zsh. It asks which terminals to wire and which
|
|
45
|
+
series to install, shows every file it is about to change, and writes nothing
|
|
46
|
+
until you confirm. Then:
|
|
45
47
|
|
|
46
48
|
```sh
|
|
47
49
|
exec zsh # the ttheme command in this tab
|
|
@@ -51,13 +53,17 @@ ttheme # preview and browse as tabs — tab switches
|
|
|
51
53
|
<details>
|
|
52
54
|
<summary><b>What init changes</b></summary>
|
|
53
55
|
|
|
54
|
-
- Your terminal config and `~/.zshrc` get
|
|
55
|
-
`# ttheme end
|
|
56
|
-
|
|
56
|
+
- Your terminal config and `~/.zshrc` get one line between `# ttheme begin` /
|
|
57
|
+
`# ttheme end` that loads a file ttheme keeps under `~/.config/ttheme`, and
|
|
58
|
+
only while it is there — so changing the default palette never touches your
|
|
59
|
+
config again, and a config synced to a machine without ttheme still works.
|
|
60
|
+
Everything outside the block is left alone, and what ttheme sets is colors —
|
|
61
|
+
no font, font size or shader — plus, in Ghostty while new tabs rotate
|
|
62
|
+
palettes, the `command` that opens them on the next one.
|
|
57
63
|
- Each file is backed up once to `<file>.ttheme.bak` before the first edit, and
|
|
58
64
|
written through symlinks, so a dotfiles repo keeps its links.
|
|
59
|
-
- A
|
|
60
|
-
folders is named `ttheme-<palette>`.
|
|
65
|
+
- A `command` or `shell-integration` you set in Ghostty stays yours, and every
|
|
66
|
+
file ttheme adds to a terminal's folders is named `ttheme-<palette>`.
|
|
61
67
|
- `npx @kecan0406/ttheme@latest uninstall` lists and then reverses all of it.
|
|
62
68
|
|
|
63
69
|
Per-terminal details, manual install from the release archives and building from
|
|
@@ -78,8 +84,8 @@ a checkout are in [docs/install.md](docs/install.md).
|
|
|
78
84
|
</details>
|
|
79
85
|
|
|
80
86
|
Both images are drawn from the live catalog, so they always match what
|
|
81
|
-
|
|
82
|
-
adds or drops single palettes any time, and a merged palette reaches everyone
|
|
87
|
+
Browse offers. `init` installs the series you pick; Browse, the second tab of
|
|
88
|
+
`ttheme`, adds or drops single palettes any time, and a merged palette reaches everyone
|
|
83
89
|
with the next release — `ttheme update` brings it, and ttheme says when one is
|
|
84
90
|
out.
|
|
85
91
|
|
|
@@ -87,7 +93,7 @@ out.
|
|
|
87
93
|
|
|
88
94
|
Anyone can publish palettes from a GitHub repository. A market is named
|
|
89
95
|
`<owner>@<name>` — its repository's owner and the name its `ttheme-market.toml` gives — and
|
|
90
|
-
sits below the series in
|
|
96
|
+
sits below the series in Preview and Browse, past a line, with
|
|
91
97
|
the folders under its `palettes/` as catalogs:
|
|
92
98
|
|
|
93
99
|
```
|
|
@@ -105,16 +111,16 @@ the folders under its `palettes/` as catalogs:
|
|
|
105
111
|
```sh
|
|
106
112
|
ttheme add dusk --market alice/ttheme-pastel # add alice's market and install from it
|
|
107
113
|
ttheme market add alice/ttheme-pastel#v1 # or add it alone, pinned to a tag
|
|
108
|
-
ttheme
|
|
114
|
+
ttheme # shift+tab to Browse: markets are rows there — add, remove, auto-update
|
|
109
115
|
```
|
|
110
116
|
|
|
111
|
-
|
|
117
|
+
Browse handles markets the way it handles palettes: in the same list it
|
|
112
118
|
adds one by repository or folder, finds the public ones on GitHub, marks one for
|
|
113
119
|
removal and switches its auto-update, and enter applies all of it with the
|
|
114
120
|
palettes you picked. The official catalog comes with ttheme and updates with it;
|
|
115
121
|
a repository asks when you add it whether its list updates on its own, and a
|
|
116
122
|
palette you installed from it keeps its colors until you take its update —
|
|
117
|
-
`ctrl+r` on a palette marked `↑` in
|
|
123
|
+
`ctrl+r` on a palette marked `↑` in Browse. Nobody reviews a market. Its
|
|
118
124
|
palettes are colors and post numbers, never code, and the contrast gate's
|
|
119
125
|
numbers are shown for them but never enforced — only the official catalog is
|
|
120
126
|
held to the gate. `ttheme update` updates ttheme and refreshes every market now; `ttheme market
|
|
@@ -129,8 +135,12 @@ twenty colors that pass the contrast gate, then each one is tuned in OKLCH while
|
|
|
129
135
|
the terminal repaints as you go. It makes `<you>@<market>/rei`, named after your
|
|
130
136
|
GitHub handle and a market name the first `new` asks for, in
|
|
131
137
|
`~/.config/ttheme/market/<market>`, and installs it; `--from rei` starts from
|
|
132
|
-
rei's colors instead. `ttheme edit rei` opens the same editor
|
|
133
|
-
|
|
138
|
+
rei's colors instead. `ttheme edit rei` opens the same editor — on any palette,
|
|
139
|
+
the official ones included: one that is not yours keeps your changes as a tone
|
|
140
|
+
over its own colors, and `R` then `s` in the editor puts them back. `ttheme check
|
|
141
|
+
--fix` writes colors that pass the gate (as a tone, for a palette that is not
|
|
142
|
+
yours). Left without a palette, `edit`, `check` and `share` ask to use the one
|
|
143
|
+
the tab wears; `share` into a pipe uses it without asking.
|
|
134
144
|
|
|
135
145
|
A local market is already a repository layout: `palettes/*.toml` (a folder
|
|
136
146
|
under it, such as `palettes/night/`, is a catalog) and the
|
|
@@ -145,22 +155,23 @@ gh repo create <you>/ttheme-<name> --public --source . --push
|
|
|
145
155
|
gh repo edit <you>/ttheme-<name> --add-topic ttheme-market
|
|
146
156
|
```
|
|
147
157
|
|
|
148
|
-
`ttheme share <palette>` prints a
|
|
149
|
-
carries the colors and the numbers of
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
`ttheme share <palette>` prints a link — `https://ttheme.vercel.app/p/tt2:…` —
|
|
159
|
+
and, in a terminal, its QR code. The link carries the colors and the numbers of
|
|
160
|
+
its background posts with their framing, so nothing is uploaded: the page it
|
|
161
|
+
opens draws the palette in a terminal, lists the posts, and gives the
|
|
162
|
+
`ttheme add` command, and its preview image for chat apps is drawn in the palette's colors.
|
|
163
|
+
`ttheme add <link>` (or the bare `tt2:…` code at its end) installs it anywhere
|
|
164
|
+
without a market, fetching those posts from the booru the way `find` does.
|
|
152
165
|
|
|
153
166
|
## Usage
|
|
154
167
|
|
|
155
168
|
| Command | |
|
|
156
169
|
|---|---|
|
|
157
|
-
| `ttheme` | Preview and
|
|
158
|
-
| `ttheme preview` | Browse live — the tab repaints as the cursor moves, enter applies it to this tab or makes it the default |
|
|
170
|
+
| `ttheme` | Preview and Browse as tabs of one screen — `tab` and `shift+tab` switch. Preview tries palettes live: the tab repaints as the cursor moves, enter applies it to this tab or makes it the default. Browse picks palettes and markets in one list: a market's row takes `delete`, `shift+←/→` for its auto-update and `ctrl+r` |
|
|
159
171
|
| `ttheme use <palette>` | Paint this tab (a unique prefix works) |
|
|
160
172
|
| `ttheme default <palette>` | The palette new tabs open with |
|
|
161
173
|
| `ttheme pin` / `unpin` | A palette for this directory, everything below it, its repository or an ssh host (`ssh:<host>`) — a panel shows what each choice reaches; `cd` or `ssh` in repaints, leaving restores |
|
|
162
|
-
| `ttheme pins` | Map every
|
|
163
|
-
| `ttheme browse` | Pick palettes and markets — `shift+←/→` moves between Catalog, Installed, Markets and Errors |
|
|
174
|
+
| `ttheme pins` | Map every pin as a file tree — the pinned directories in each palette's colors, with where you are marked, and every pinned ssh host |
|
|
164
175
|
| `ttheme market add <owner/repo>` | Add someone's market (`#v1` pins it) — `ttheme market` lists yours; `search`, `remove` too |
|
|
165
176
|
| `ttheme new <name>` | Make a palette of your own in the palette editor (`--from <palette>` starts from its colors); `edit`, `check`, `share` follow |
|
|
166
177
|
| `ttheme on` / `off` | Wear the default again / give the terminal its own colors back |
|