rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:HarmlessFunny/dsh-background-by-model
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
Forked from
Tkingxiao/dsh-any-backgroundand renamed todsh-background-by-model.
A DeepSeek Harness appearance plugin built around an ordered list of model rules: each rule carries its own images, and each image its own layout mode, framing, theme color, opacity, brightness and blur. Switch the model and the background switches with it, through the global switch effect you choose on the Config page.
v0.3.0 was a breaking release — video wallpapers, generated backgrounds and the single global theme color were removed. See the v0.3.0 entry in CHANGELOG.md.
A rule is a match string plus one complete set of background settings. On a model switch the plugin reads the current session's model name, scans the list top-down, and applies the first rule whose match string appears anywhere in it (case-insensitive) — with rule 1 as the fallback when nothing matches.
Example list:
| # | Match string | Wallpaper |
|---|---|---|
| 1 | deepseek |
Image A |
| 2 | flash |
Image B |
| 3 | glm |
Image C |
| Current model | Result | Why |
|---|---|---|
DeepSeek-Flash |
Rule 1 → Image A | deepseek matches first |
GLM-Flash |
Rule 2 → Image B | flash is earlier in the list than glm |
Qwen-Flash |
Rule 2 → Image B | flash matches |
GLM-Turbo |
Rule 3 → Image C | only glm matches |
Kimi-K3 |
Fallback → Rule 1 → Image A | no rule matches |
modelSelection projection the composer's own picker renders), so switching models inside a session takes effect immediately; the page shows what was read, and marks it host default when only the host-wide default was available.The example above has no
kimientry, so Kimi falls back to rule 1 = Image A and looks like "nothing happened" — add a rule with the match stringkimi.
One interface, one config — only the current model differs:
DeepSeek V4.1 Flash · matched the rule containing deepseek: a light wallpaper with a matching theme color
Kimi K2.7 Code · matched the rule containing kimi: a dark wallpaper, and the whole interface reskinned with it
One rule on the Model Background tab · the layout mode, the framing, the theme color and the opacity/brightness/blur all belong to the image being edited
Example wallpaper art from ZipZipPipe on bilibili
An ordered list of rules, matched first-hit against the current model's name, with rule 1 as the fallback.
dsh-background-by-model-theme.json with every image inlined; files written by earlier releases still import.localStorage — everything lives under ~/.dsh/.dsh-background-by-model-data/, and old single-wallpaper configs migrate in place on first read.Per rule, and off by default — cycling spends real bandwidth, memory and battery, so nothing turns it on for you.
What a wallpaper change looks like — one setting on the Config page, shared by every rule, covering a model switch, a rotation step, Next image and a holiday taking over.
transform on the incoming layer, so neither costs a byte of extra transfer.0–3000 ms where 0 is a hard cut rather than "unset". It replaced the per-rule rotate.fadeMs, which had no control anywhere; a hand-tuned value is folded into it on first read.One switch on the Config page and nothing else: on 中秋节 and 国庆节 the wallpaper switches to that holiday's own art and theme color, and back the next morning. It ships off, and the recommended profile turns it on.
i0/i1/i2.hdslb.com, three edges falling back to each other) and cached under holiday-cache/<hash>/ on the first read of the day. The directory is named after the content hash in the URL: new art means a new address, therefore a new directory and a guaranteed re-download — there is no version constant to remember to bump. The download is gated on the calendar, so an ordinary day fetches nothing at all and every later boot is answered from disk.0–100%, image brightness 0–200% (100% is the picture as saved) and image blur 0–60 px, all three saved per image and edited through one slider with a menu beside it that picks the effect — so a daylight photo and a night shot in one rotation keep their own exposures. They treat the image (wallpaper) layer only; the Interface tab's opacity treats interface surfaces. A rule with no image has all three disabled rather than hidden.One click on the Config tab installs the author's own configuration — seven model rules and their interface numbers ship inside the plugin, and only the seven wallpapers are downloaded, from Bilibili's image CDN.
@3840w.webp is load-bearing — the uploads are 2.4–12 MB PNGs (76 MB for the set); with that suffix they are the 250–365 KB 4K WebPs an existing data directory already holds, byte for byte.The first card on the Config tab: one switch deciding whether the AI may change this appearance through tools.
confirm: true and otherwise refuses before touching anything. Download first, wipe second: if any picture cannot be fetched, your rules are not touched at all.true is overruled by the importing machine's own value.The last card on the Config tab. Images are stored at full fidelity, so an interrupted upload, a failed file deletion or a wholesale config replacement can leave a file on disk that no rule references any more — and on a tidy machine that number is normally 0. The card reads the numbers, and the button deletes without asking.
.bak does, the sweep runs against the backup's rules, because that is the config you are about to get back; only when neither parses does it read as unknown and disable the button.** — that slot belongs to no config (festival art lives inholiday-cache/`, and the slot is read-only), so this is the only path that can ever remove such a file.Settings → Theme now has three tabs:
| Tab | Scope | Contents |
|---|---|---|
| Interface | Global, shared by every model | Opacity for the main background, left panel, right panel, cards & panels, input & controls, settings panel, conversation text box, trajectory page and every plugin page |
| Model Background | Per rule, per image | The ordered rule list, the live match readout, and each rule's images (filmstrip), per-image layout mode, framing and theme color, plus the rule's opacity, brightness, blur and rotation |
| Config | — | The let the AI change the background switch, the global switch effect, the whole rule set as a file — recommended profile, import and export (dsh-background-by-model-theme.json) — plus the single holiday background switch and the image storage cleanup |
The old Color tab is gone — the theme color is now a property of each rule — and the old Background tab became Model Background.
Data directory: ~/.dsh/.dsh-background-by-model-data/ (Windows: C:\Users\<you>\.dsh\.dsh-background-by-model-data\)
| File | Contents |
|---|---|
theme-config.json |
The rule list (each rule with its image list, and each image with its own look and rotation settings) plus the global Interface settings, the global switch effect and the holiday overrides |
theme-config.json.bak |
The previous config, as of the last successful save. Every save writes a temp file and renames it over the live one, rotating the current good file into .bak first; a live file that will not parse is restored from here instead of falling back to the factory defaults. With neither readable, the cleanup card refuses to delete images |
modelbg-<slot> |
One image, stored as raw bytes without a file extension — one file per image, so a rule with three images owns three slots |
holiday-cache/<hash>/<asset> |
Festival art downloaded from Bilibili's image CDN, one file per holiday (mid-autumn.webp, national-day.webp) inside a directory named after the first eight characters of that picture's content hash (42e22801, 30e97211 today). The hash is part of the path so that new art lands in a directory nobody has written to — it cannot be answered with the previous generation's bytes, and there is no version constant to keep in step. The file inside is named after the asset, deliberately outside the slot namespace, which is what keeps a holiday slot read-only. Superseded generations (including every holiday-cache/<tag>/ from 0.10 and earlier) are pruned once the new art is on disk. Delete a file here and it is simply re-downloaded the next time that holiday is in force |
dsh plugin --profile web add dsh-background-by-model
This is the only source — a github: install would clone a tree with no lib/ in it, and nothing there would build one.
Then restart dsh web.
The plugin appears as a "Theme" section in Settings.
npx @deepseek-ai/dsh plugin --profile web add dsh-background-by-model
npx @deepseek-ai/dsh web
lib/ is not in the repository — it is built from src/, by the package's prepack hook when the tarball is packed, and by you for a working copy. Clone, install, then build:
git clone https://github.com/HarmlessFunny/dsh-background-by-model.git
cd dsh-background-by-model
pnpm install
pnpm test # builds lib/, typechecks, runs the fifteen checks
pnpm run bundle rebuilds lib/ on its own. Either has to run before the plugin can load: a fresh clone has no lib/.
To mount a working copy into a profile instead, add it to the profile's package.json and register the bundle:
{
"dependencies": {
"dsh-background-by-model": "link:E:/DeepSeek/dsh-background-by-model"
},
"dsh": {
"profile": {
"bundles": ["dsh-background-by-model"]
}
}
}
After changing anything under src/, run pnpm run bundle again — the mounted profile loads lib/, so edits do not take effect until the bundle is rebuilt.
pnpm test builds, typechecks and runs seventeen checks, none of which needs a dependency, a transformer or a browser. Each can also be run on its own with pnpm check:holiday / pnpm check:rotation / pnpm check:transition / pnpm check:repaint / pnpm check:code-plate / pnpm check:image-mode / pnpm check:rules / pnpm check:preset / pnpm check:ui / pnpm check:watchdogs / pnpm check:scheme / pnpm check:store / pnpm check:agent / pnpm check:rev / pnpm check:meta / pnpm check:mark / pnpm check:node:
check:holiday — the two holiday windows, the Beijing day boundary, leap eighth months across 1900–2100, and the four gates pickHoliday applies.check:rotation — nextIndex / isRotating: no walking off the end, shuffle never repeating the image on screen, and nothing called "rotating" with nothing to rotate.check:transition — resolveFadeMs / transitionPlan: the shipped default still producing byte-for-byte the transition string earlier releases wrote, every route to a hard cut being one, reduced motion vetoing rather than shortening, and every effect ending visible and unscaled.check:repaint — shouldRepaint, including the edit that creates the winner, plus a failure if any write path stops asking, or if a rotation step stops re-emitting the interface palette.check:code-plate — the code block's plate: its tokens declared on both :root and body, the light branch emitting the banner, and each surface reading its own plugin variable.check:image-mode — the lift onto the image for the layout mode and the three paint effects, and which image a control edits against which the render layer reads.check:rules — the two decisions behind the tab strip, which live in src/client/rules-view.ts, plus the page structure the layout rests on.check:preset — the profile itself (its rules, its slot → URL table and its generation constant) alongside the retry policy and what a failed attempt holds for the next one, with both halves shown using them. The rules are compiled in now, so this is also what catches a rule pointing at a slot the table does not carry — a mistake that would otherwise only show up after a release.check:ui — both dictionaries carrying the same keys, every dab-… class styled, no dead entry, and every var(--dsw-…) published by the installed theme.check:watchdogs — one heartbeat, entries firing on their own due time, paused while the tab is hidden, no timer left by dispose, and no module outside the entry starting its own interval.check:scheme — the data-ds-dark-theme hand-off: the plugin only rewrites the value it wrote, hands the flag back when it drops its tokens, and repaints when the scheme moves. It no longer reaches the network: the recommended profile's manifest it used to compare against is compiled in now.check:store — the two decisions behind the storage cleanup, referencedSlots and orphanSlots: a picture in use is never an orphan, a stray holiday-slot file always is, and the browser half sends RULE slots rather than the whole config.check:agent — agent access and the config revision: off by default, only an explicit true granting it ('yes' / 1 / null do not), the recommended profile not turning it on, an export not carrying it, the revision only ever moving forward, and a config written before either field reading as revision 0.check:rev — the panel's revision chain: a write carries expectedRev, a successful one records the host's answer, setRev mutates the live object, an import neither zeroes the revision nor reads it after the wipe, installing the recommended profile goes through one adoptRecommended call rather than a resetStore plus a write, config writes are chained while picture bytes are released only after the config lands (imports included), a tool-added picture derives a slot name from the clock, and two callers cannot adopt at once. Miss any link and the next save refuses itself, so an edit visibly undoes itself ("click + once, the card flashes and disappears").check:meta — how the plugin describes ITSELF in the plugin manager and the settings pages: locale/<language>.json carrying a title and a description per language, both files EXPORTED (the reader resolves them through Node's ESM resolver, so a file on disk that exports does not name resolves to nothing and is silently treated as absent), both listed in files (or the published tarball is missing them and looks identical), and an icon that is a relative path, inside the package, SVG/PNG/JPEG/WebP under 256 KiB, with a 36×36 viewBox and nothing referenced externally. When the harness is installed next door it ends by asking readPluginMeta itself, because the fallback it otherwise answers with — the bare package name — is exactly what a reader sees on the card.check:mark — how the plugin's own mark reaches the settings navigation: a settings.section.icon registration rather than a DOM patch over the host's markup, its id read from the same constant the section registers under (only: row.id silently drops any other id), no MutationObserver or <svg> surgery coming back, a glyph on the 16-unit grid drawn in currentColor (so one drawing suits the sidebar's text tint and the brand tile's foreground), and the published artwork's scale staying under the factor at which the viewBox starts clipping it. The DOM patch this replaced never matched, so the gear stayed and nothing reported anything.check:node — the built node half through its real RPC handler with DSH_HOME redirected and fetch stubbed: the holiday block, the festival art's content-hash cache and its pruning, fallback across the three edges, the per-image color AND effect lifts, the global switch effect, the atomic config write with its backup and its recovery, the store's usage report and cleanup, and the recommended profile's seven pictures end to end (including the old manifest method being gone, the slot whitelist, and the retry budget).Every model looks the same — why? Rule 1 probably has an empty match string, which makes it a pure fallback holding the whole list. Give it a match string, or add more specific rules above it.
GLM-Flash picked the wrong rule.
Matching is first-hit, not best-hit: put the more specific rule higher in the list, or reorder.
Where are my wallpapers?
In ~/.dsh/.dsh-background-by-model-data/, one modelbg-<slot> file per image plus theme-config.json and its .bak backup.
What is theme-config.json.bak, and can I delete it?
The previous config as of the last successful save. Every save writes a temp file and renames it over the live one, keeping the then-current parseable file as the backup — so if the live file ever stops parsing (a crash, a pulled cable, a hand edit gone wrong), the plugin restores from it instead of falling back to the factory defaults. You can delete it; the cost is having nothing to restore the next time the live file really is broken.
I turned the rotation on and the background never changed. Three things can hold it: the rule needs two or more images, the tab has to be visible, and only the rule the current model resolved to rotates.
Does rotating cost anything? Yes, which is why it is off by default: each image is stored at full fidelity and every switch repaints the whole interface. Two to five images is the sweet spot — boot only reads each rule's first image, so the cost is memory and disk rather than start-up time.
Why did the theme color stop working after I removed a rule's images? That was the old behaviour, and it is fixed: a rule now counts while it has an image, or a theme color of its own, so it still matches and still serves as the fallback while painting the interface alone.
I updated the plugin and the panel says my edits are not being saved. The browser half and the host half update separately, so a refreshed page can run the new client against DSH's process still running the previous node half, which cannot read the new config shape. The client holds its writes until you restart DSH.
I set a color for one image and the other images did not change. That is the design: since 0.7.1 a theme color belongs to the image, so a rotation can move through pictures with different accents. A rule with no image at all is the one case where the controls edit the rule's own color.
Where did the theme color I set before this update go?
Nowhere: an image written before per-image colors has no color key at all, which is how the loader tells "never had one" from "cleared on purpose", and it lifts the rule's color onto every such image.
Can I share a setup? Yes — export it from the Config tab; the JSON inlines every rule's image.
Are video or generated backgrounds supported? No. Both were removed in 0.3.0; each rule uses a static image.
After switching a rule back to "System theme", why is the settings dialog a different palette? That was a bug and it is fixed: every surface is now driven by one palette source, so clearing the color reads the host's own tokens back and re-emits them with your alpha.
Why does "Custom color" produce a color the moment I press it? Pressing it means leaving the system-theme state, so it has to hand out a starting color — it runs the extract-from-image pass first and falls back to a default swatch only when the image has nothing vivid.
After switching back to "System theme" the interface stays light until I drag a slider — why?
The other half of the same bug, also fixed: the plugin forces body[data-ds-dark-theme] while it owns a color, and the host only rewrites that flag when it projects a theme snapshot. The switch now hands the flag back synchronously, and a one-second watchdog re-reads the host palette.
I picked a new switch effect and the wallpaper still cuts instantly.
The effect is Instant, or the duration is 0 — an effect and a duration are two ways of asking for the same hard cut, and the effect wins. Outside the plugin, a system reduced motion setting means nothing animates at all.
Only the two most recent releases are listed here; older ones live in CHANGELOG.md.
visibility, so nothing is lost — the app's subtree stays mounted and laid out, which keeps the scroll position, the draft and every component's state. The wallpaper is painted beside that subtree, not inside it.visible in eight of its own stylesheets, and !important on the root cannot stop that: an inherited value loses to any declaration a descendant makes for itself. check:peek pins it, along with both exits.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、模型。