@vellumai/assistant 0.12.2-dev.202609191222.757d196 → 0.12.2-dev.202609210049.b9f03ca
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/docs/desktop-browser-cli.md +4 -0
- package/package.json +1 -1
- package/scripts/smoke-desktop-window-theme.ts +2 -3
- package/src/desktop/desktop-browser-endpoint.ts +3 -0
- package/src/desktop/desktop-dependencies.ts +83 -35
- package/src/desktop/desktop-panel-config.test.ts +7 -3
- package/src/desktop/desktop-panel-config.ts +65 -14
- package/src/desktop/desktop-session-manager.test.ts +4 -2
- package/src/desktop/desktop-session-manager.ts +3 -7
- package/src/desktop/desktop-window-theme.ts +5 -25
|
@@ -16,6 +16,10 @@ flowchart LR
|
|
|
16
16
|
Chrome --> Stream[Existing desktop stream]
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
The Terminal dock launcher opens [WezTerm](https://wezterm.org/), with a plain dark native title bar, minimize/maximize/close controls, a new-tab button and split panes. Use Ctrl+Shift+T for a tab, Ctrl+Shift+D to split side by side, and Ctrl+Shift+E to split top and bottom. The desktop seeds an editable `data/desktop-panel/wezterm/wezterm.lua` configuration with software rendering and a dark theme. The managed launcher keeps its stable `data/desktop-panel/applications/xterm.desktop` path so existing dock pins remain valid. Setup installs an exact-version, SHA-256-verified WezTerm package for Linux x64 or ARM64, plus its rendering libraries.
|
|
20
|
+
|
|
21
|
+
Chrome and WezTerm use explicit desktop window classes shared with their launcher entries. The desktop session bus and Plank share `XDG_DATA_HOME` so the D-Bus-activated window matcher can resolve the generated launchers and group running windows under their pinned icons.
|
|
22
|
+
|
|
19
23
|
Chrome and its dock launcher share the managed profile and loopback debug port. For Chrome reopened from the dock, the profile singleton lock identifies a candidate PID, validated against the installed executable, profile and loopback debug arguments. Discovery checks `/proc` socket ownership against that browser PID, refuses redirects and validates the returned browser WebSocket endpoint. The connection stays within the container. No CDP endpoint or token is exposed to the renderer.
|
|
20
24
|
|
|
21
25
|
The desktop client bypasses personal-browser discovery, extension reconnect waits and backend fallback. It reuses the existing AX snapshot, DOM element resolution, mouse, keyboard, extraction and credential-fill implementations. Operation-scoped clients borrow the lease's connection; disposing one does not release the lease. `detach`, `close`, turn completion, cancellation, errors and idle expiry release control. Turn completion clears the activity indicator immediately and queues browser cleanup before the next automation session; it leaves Chrome and the current page open for the user. Only `tabs close` closes a Chrome tab.
|
package/package.json
CHANGED
|
@@ -91,15 +91,14 @@ try {
|
|
|
91
91
|
`<bindings xmlns="http://openbox.org/3.4/rc">${mouse}${keyboard}</bindings>`,
|
|
92
92
|
);
|
|
93
93
|
const configDir = join(directory, "managed & theme");
|
|
94
|
-
const config = writeDesktopWindowTheme(configDir, home
|
|
94
|
+
const config = writeDesktopWindowTheme(configDir, home);
|
|
95
95
|
const expanded = run("xmllint", "--xinclude", config);
|
|
96
96
|
assert(
|
|
97
97
|
expanded.includes("NextWindow") && expanded.includes("Move"),
|
|
98
98
|
"Relative includes must retain the actual keyboard and mouse bindings",
|
|
99
99
|
);
|
|
100
100
|
assert.equal(await readFile(sourcePath, "utf8"), source);
|
|
101
|
-
writeDesktopWindowTheme(configDir, home
|
|
102
|
-
writeDesktopWindowTheme(configDir, home, "#53b7aa");
|
|
101
|
+
writeDesktopWindowTheme(configDir, home);
|
|
103
102
|
assert.equal(await readFile(sourcePath, "utf8"), source);
|
|
104
103
|
const blocked = join(directory, "blocked");
|
|
105
104
|
await writeFile(blocked, "not a directory");
|
|
@@ -4,6 +4,8 @@ import { join } from "node:path";
|
|
|
4
4
|
|
|
5
5
|
import { shouldRestoreDesktopChromeSession } from "./desktop-chrome-session.js";
|
|
6
6
|
|
|
7
|
+
export const DESKTOP_CHROME_WINDOW_CLASS = "vellum-desktop-chrome";
|
|
8
|
+
|
|
7
9
|
export async function allocateDesktopDebugPort(): Promise<number> {
|
|
8
10
|
const server = createServer();
|
|
9
11
|
await new Promise<void>((resolve, reject) => {
|
|
@@ -129,6 +131,7 @@ export function desktopChromeArguments(
|
|
|
129
131
|
return [
|
|
130
132
|
"--no-sandbox",
|
|
131
133
|
"--no-first-run",
|
|
134
|
+
`--class=${DESKTOP_CHROME_WINDOW_CLASS}`,
|
|
132
135
|
"--force-renderer-accessibility",
|
|
133
136
|
"--disable-dev-shm-usage",
|
|
134
137
|
...(shouldRestoreDesktopChromeSession(profileDir)
|
|
@@ -12,6 +12,17 @@ import { getLogger } from "../util/logger.js";
|
|
|
12
12
|
import { getExternalDir } from "../util/platform.js";
|
|
13
13
|
|
|
14
14
|
const log = getLogger("desktop-dependencies");
|
|
15
|
+
const WEZTERM_VERSION = "20240203-110809-5046fc22";
|
|
16
|
+
const WEZTERM_PACKAGES = {
|
|
17
|
+
x64: {
|
|
18
|
+
suffix: "Debian12.deb",
|
|
19
|
+
sha256: "d3a5c97093fbc0a87e8f9616e44efc4c9503cfc495fd1cfe4ffeff88578d15f8",
|
|
20
|
+
},
|
|
21
|
+
arm64: {
|
|
22
|
+
suffix: "Debian12.arm64.deb",
|
|
23
|
+
sha256: "351f8791c6e9561d687afa63834a2132de84800dad6e7c3d035cc6518d6c3744",
|
|
24
|
+
},
|
|
25
|
+
} as const;
|
|
15
26
|
const CHROME_VERSION = "153.0.8010.36-1";
|
|
16
27
|
const CHROME_PACKAGES = {
|
|
17
28
|
x64: {
|
|
@@ -32,7 +43,7 @@ const DESKTOP_BINARIES = {
|
|
|
32
43
|
panel: ["plank"],
|
|
33
44
|
sessionBus: ["dbus-daemon"],
|
|
34
45
|
clipboard: ["tigervncconfig", "vncconfig"],
|
|
35
|
-
terminal: ["
|
|
46
|
+
terminal: ["wezterm"],
|
|
36
47
|
wallpaper: ["feh"],
|
|
37
48
|
input: ["xdotool"],
|
|
38
49
|
capture: ["scrot"],
|
|
@@ -54,11 +65,14 @@ const DESKTOP_PACKAGES = [
|
|
|
54
65
|
"xauth",
|
|
55
66
|
"xcompmgr",
|
|
56
67
|
"xfonts-base",
|
|
68
|
+
// Preserved Openbox menus and shortcuts can invoke xterm directly.
|
|
57
69
|
"xterm",
|
|
58
70
|
"xdotool",
|
|
59
71
|
"scrot",
|
|
60
72
|
"fonts-liberation",
|
|
61
73
|
"libgtk-3-0",
|
|
74
|
+
"libegl1",
|
|
75
|
+
"libgl1-mesa-dri",
|
|
62
76
|
"libvulkan1",
|
|
63
77
|
"libcurl4",
|
|
64
78
|
];
|
|
@@ -277,17 +291,36 @@ async function installDesktopComponents(
|
|
|
277
291
|
await rm(desktopChromePath() + ".ready", { force: true });
|
|
278
292
|
// Desktop binaries, X assets and the loader share the image root.
|
|
279
293
|
await run([...apt, "update"]);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
"-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
"
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
294
|
+
const terminal =
|
|
295
|
+
WEZTERM_PACKAGES[process.arch as keyof typeof WEZTERM_PACKAGES];
|
|
296
|
+
const terminalDownloadDir = await mkdtemp(
|
|
297
|
+
join(tmpdir(), "desktop-terminal-"),
|
|
298
|
+
);
|
|
299
|
+
try {
|
|
300
|
+
const deb = join(terminalDownloadDir, "wezterm.deb");
|
|
301
|
+
await downloadDesktopPackage(
|
|
302
|
+
`https://github.com/wezterm/wezterm/releases/download/${WEZTERM_VERSION}/wezterm-${WEZTERM_VERSION}.${terminal.suffix}`,
|
|
303
|
+
deb,
|
|
304
|
+
terminal.sha256,
|
|
305
|
+
caBundle,
|
|
306
|
+
);
|
|
307
|
+
await chmod(terminalDownloadDir, 0o755);
|
|
308
|
+
await chmod(deb, 0o644);
|
|
309
|
+
await run([
|
|
310
|
+
...apt,
|
|
311
|
+
"install",
|
|
312
|
+
"-y",
|
|
313
|
+
"--no-install-recommends",
|
|
314
|
+
"--no-upgrade",
|
|
315
|
+
"--no-remove",
|
|
316
|
+
"-o",
|
|
317
|
+
"DPkg::Lock::Timeout=120",
|
|
318
|
+
...DESKTOP_PACKAGES,
|
|
319
|
+
deb,
|
|
320
|
+
]);
|
|
321
|
+
} finally {
|
|
322
|
+
await rm(terminalDownloadDir, { recursive: true, force: true });
|
|
323
|
+
}
|
|
291
324
|
onStage("chrome");
|
|
292
325
|
if (!existsSync(desktopChromePath())) {
|
|
293
326
|
const downloadDir = await mkdtemp(join(tmpdir(), "desktop-chrome-"));
|
|
@@ -296,30 +329,12 @@ async function installDesktopComponents(
|
|
|
296
329
|
const staging = await mkdtemp(join(installRoot, ".install-"));
|
|
297
330
|
try {
|
|
298
331
|
const deb = join(downloadDir, "chrome.deb");
|
|
299
|
-
await
|
|
300
|
-
"curl",
|
|
301
|
-
...(caBundle ? ["--cacert", caBundle] : []),
|
|
302
|
-
"--fail",
|
|
303
|
-
"--location",
|
|
304
|
-
"--proto",
|
|
305
|
-
"=https",
|
|
306
|
-
"--proto-redir",
|
|
307
|
-
"=https",
|
|
308
|
-
"--retry",
|
|
309
|
-
"2",
|
|
310
|
-
"--max-time",
|
|
311
|
-
"300",
|
|
312
|
-
"--output",
|
|
313
|
-
deb,
|
|
332
|
+
await downloadDesktopPackage(
|
|
314
333
|
`https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_${chrome.arch}.deb`,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
if (hash.digest("hex") !== chrome.sha256) {
|
|
321
|
-
throw new Error("Chrome download checksum mismatch");
|
|
322
|
-
}
|
|
334
|
+
deb,
|
|
335
|
+
chrome.sha256,
|
|
336
|
+
caBundle,
|
|
337
|
+
);
|
|
323
338
|
await run(["dpkg-deb", "--extract", deb, staging]);
|
|
324
339
|
await rename(staging, join(installRoot, `chrome-${CHROME_VERSION}`));
|
|
325
340
|
} finally {
|
|
@@ -330,8 +345,41 @@ async function installDesktopComponents(
|
|
|
330
345
|
}
|
|
331
346
|
}
|
|
332
347
|
onStage("checking");
|
|
348
|
+
await run([resolveDesktopBinaries().terminal, "--version"]);
|
|
333
349
|
await run([desktopChromePath(), "--version"]);
|
|
334
350
|
await writeFile(desktopChromePath() + ".ready", "");
|
|
335
351
|
}
|
|
336
352
|
|
|
353
|
+
async function downloadDesktopPackage(
|
|
354
|
+
url: string,
|
|
355
|
+
destination: string,
|
|
356
|
+
sha256: string,
|
|
357
|
+
caBundle?: string,
|
|
358
|
+
): Promise<void> {
|
|
359
|
+
await run([
|
|
360
|
+
"curl",
|
|
361
|
+
...(caBundle ? ["--cacert", caBundle] : []),
|
|
362
|
+
"--fail",
|
|
363
|
+
"--location",
|
|
364
|
+
"--proto",
|
|
365
|
+
"=https",
|
|
366
|
+
"--proto-redir",
|
|
367
|
+
"=https",
|
|
368
|
+
"--retry",
|
|
369
|
+
"2",
|
|
370
|
+
"--max-time",
|
|
371
|
+
"300",
|
|
372
|
+
"--output",
|
|
373
|
+
destination,
|
|
374
|
+
url,
|
|
375
|
+
]);
|
|
376
|
+
const hash = createHash("sha256");
|
|
377
|
+
for await (const chunk of createReadStream(destination)) {
|
|
378
|
+
hash.update(chunk);
|
|
379
|
+
}
|
|
380
|
+
if (hash.digest("hex") !== sha256) {
|
|
381
|
+
throw new Error("Desktop package download checksum mismatch");
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
337
385
|
export const desktopDependencyInstaller = new DesktopDependencyInstaller();
|
|
@@ -33,7 +33,7 @@ test("initializes the dock and preserves user changes across restarts", () => {
|
|
|
33
33
|
configDir,
|
|
34
34
|
chromiumPath: "/opt/chrome-v1/chrome",
|
|
35
35
|
chromiumProfileDir: profileDir,
|
|
36
|
-
terminalPath: "/usr/bin/
|
|
36
|
+
terminalPath: "/usr/bin/wezterm",
|
|
37
37
|
};
|
|
38
38
|
writeDesktopPanelConfig(request);
|
|
39
39
|
const settingsPath = join(configDir, "glib-2.0", "settings", "keyfile");
|
|
@@ -59,6 +59,9 @@ test("initializes the dock and preserves user changes across restarts", () => {
|
|
|
59
59
|
rmSync(join(pinsDir, "mines.dockitem"));
|
|
60
60
|
const customSettings = settings.replace("icon-size=48", "icon-size=64");
|
|
61
61
|
writeFileSync(settingsPath, customSettings);
|
|
62
|
+
const terminalConfig = join(configDir, "wezterm", "wezterm.lua");
|
|
63
|
+
const customTerminalConfig = `${readFileSync(terminalConfig, "utf8")}\n-- Custom settings\n`;
|
|
64
|
+
writeFileSync(terminalConfig, customTerminalConfig);
|
|
62
65
|
writeDesktopPanelConfig({
|
|
63
66
|
...request,
|
|
64
67
|
chromiumPath: "/opt/chrome-v2/chrome",
|
|
@@ -66,6 +69,7 @@ test("initializes the dock and preserves user changes across restarts", () => {
|
|
|
66
69
|
expect(() => readFileSync(join(pinsDir, "chrome.dockitem"))).toThrow();
|
|
67
70
|
expect(() => readFileSync(join(pinsDir, "mines.dockitem"))).toThrow();
|
|
68
71
|
expect(readFileSync(settingsPath, "utf8")).toBe(customSettings);
|
|
72
|
+
expect(readFileSync(terminalConfig, "utf8")).toBe(customTerminalConfig);
|
|
69
73
|
expect(
|
|
70
74
|
readFileSync(
|
|
71
75
|
join(configDir, "applications", "google-chrome.desktop"),
|
|
@@ -89,7 +93,7 @@ test("initialization recovers partial pin creation", () => {
|
|
|
89
93
|
configDir,
|
|
90
94
|
chromiumPath: "/opt/chrome/chrome",
|
|
91
95
|
chromiumProfileDir: join(workspace, "data", "desktop-profile"),
|
|
92
|
-
terminalPath: "/usr/bin/
|
|
96
|
+
terminalPath: "/usr/bin/wezterm",
|
|
93
97
|
});
|
|
94
98
|
expect(readFileSync(join(pinsDir, "chrome.dockitem"), "utf8")).toBe(
|
|
95
99
|
"existing pin",
|
|
@@ -111,7 +115,7 @@ test("a failed settings write leaves initialization retryable", () => {
|
|
|
111
115
|
configDir,
|
|
112
116
|
chromiumPath: "/opt/chrome/chrome",
|
|
113
117
|
chromiumProfileDir: join(workspace, "data", "desktop-profile"),
|
|
114
|
-
terminalPath: "/usr/bin/
|
|
118
|
+
terminalPath: "/usr/bin/wezterm",
|
|
115
119
|
};
|
|
116
120
|
const write = fs.writeFileSync;
|
|
117
121
|
const interrupted = spyOn(fs, "writeFileSync").mockImplementation(
|
|
@@ -3,13 +3,21 @@ import {
|
|
|
3
3
|
existsSync,
|
|
4
4
|
linkSync,
|
|
5
5
|
mkdirSync,
|
|
6
|
+
readFileSync,
|
|
7
|
+
renameSync,
|
|
6
8
|
rmSync,
|
|
7
9
|
writeFileSync,
|
|
8
10
|
} from "node:fs";
|
|
9
11
|
import { dirname, join } from "node:path";
|
|
10
12
|
import { pathToFileURL } from "node:url";
|
|
11
13
|
|
|
12
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
DESKTOP_CHROME_WINDOW_CLASS,
|
|
16
|
+
desktopChromeArguments,
|
|
17
|
+
} from "./desktop-browser-endpoint.js";
|
|
18
|
+
|
|
19
|
+
const TERMINAL_WINDOW_CLASS = "vellum-desktop-terminal";
|
|
20
|
+
const TERMINAL_HEADER_CONFIG = " window_decorations = 'TITLE|RESIZE',\n";
|
|
13
21
|
|
|
14
22
|
// Absolute icon paths work without an installed icon theme.
|
|
15
23
|
const TERMINAL_ICON_BASE64 = [
|
|
@@ -50,41 +58,68 @@ export function writeDesktopPanelConfig(
|
|
|
50
58
|
"product_logo_64.png",
|
|
51
59
|
);
|
|
52
60
|
writeFileSync(terminalIcon, Buffer.from(TERMINAL_ICON_BASE64, "base64"));
|
|
61
|
+
const terminalConfig = join(configDir, "wezterm", "wezterm.lua");
|
|
62
|
+
mkdirSync(dirname(terminalConfig), { recursive: true });
|
|
63
|
+
const terminalConfigContents = `local wezterm = require 'wezterm'
|
|
64
|
+
return {
|
|
65
|
+
front_end = 'Software',
|
|
66
|
+
enable_wayland = false,
|
|
67
|
+
check_for_updates = false,
|
|
68
|
+
hide_tab_bar_if_only_one_tab = false,
|
|
69
|
+
${TERMINAL_HEADER_CONFIG} font_size = 11,
|
|
70
|
+
color_scheme = 'Catppuccin Mocha',
|
|
71
|
+
initial_cols = 110,
|
|
72
|
+
initial_rows = 28,
|
|
73
|
+
keys = {
|
|
74
|
+
{ key = 'd', mods = 'CTRL|SHIFT', action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' } },
|
|
75
|
+
{ key = 'e', mods = 'CTRL|SHIFT', action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' } },
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
seedFile(terminalConfig, terminalConfigContents, [
|
|
80
|
+
terminalConfigContents.replace(TERMINAL_HEADER_CONFIG, ""),
|
|
81
|
+
...["", " integrated_title_buttons = { 'Maximize', 'Close' },\n"].map(
|
|
82
|
+
(buttons) =>
|
|
83
|
+
terminalConfigContents.replace(
|
|
84
|
+
TERMINAL_HEADER_CONFIG,
|
|
85
|
+
` window_decorations = 'INTEGRATED_BUTTONS|RESIZE',\n integrated_title_button_style = 'Gnome',\n${buttons}`,
|
|
86
|
+
),
|
|
87
|
+
),
|
|
88
|
+
]);
|
|
53
89
|
|
|
54
90
|
const applicationsDir = join(configDir, "applications");
|
|
55
91
|
mkdirSync(applicationsDir, { recursive: true });
|
|
56
92
|
const chromiumEntry = join(applicationsDir, "google-chrome.desktop");
|
|
93
|
+
// Saved dock pins reference this stable launcher path.
|
|
57
94
|
const terminalEntry = join(applicationsDir, "xterm.desktop");
|
|
58
95
|
const minesEntry = join(applicationsDir, "org.gnome.Mines.desktop");
|
|
59
96
|
writeFileSync(
|
|
60
97
|
chromiumEntry,
|
|
61
98
|
desktopEntry({
|
|
62
99
|
name: "Google Chrome",
|
|
63
|
-
|
|
64
|
-
windowClass: `google-chrome (${request.chromiumProfileDir})`,
|
|
100
|
+
windowClass: DESKTOP_CHROME_WINDOW_CLASS,
|
|
65
101
|
icon: browserIcon,
|
|
66
|
-
exec: [
|
|
102
|
+
exec: desktopCommand([
|
|
67
103
|
request.chromiumPath,
|
|
68
104
|
...desktopChromeArguments(
|
|
69
105
|
request.chromiumProfileDir,
|
|
70
106
|
request.debugPort,
|
|
71
107
|
),
|
|
72
|
-
]
|
|
73
|
-
.map(
|
|
74
|
-
(arg) => `"${arg.replace(/[\\"`$]/g, "\\$&").replace(/%/g, "%%")}"`,
|
|
75
|
-
)
|
|
76
|
-
.join(" "),
|
|
108
|
+
]),
|
|
77
109
|
}),
|
|
78
110
|
);
|
|
79
111
|
writeFileSync(
|
|
80
112
|
terminalEntry,
|
|
81
113
|
desktopEntry({
|
|
82
114
|
name: "Terminal",
|
|
83
|
-
windowClass:
|
|
115
|
+
windowClass: TERMINAL_WINDOW_CLASS,
|
|
84
116
|
icon: terminalIcon,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
117
|
+
exec: desktopCommand([
|
|
118
|
+
request.terminalPath,
|
|
119
|
+
"start",
|
|
120
|
+
"--new-tab",
|
|
121
|
+
`--class=${TERMINAL_WINDOW_CLASS}`,
|
|
122
|
+
]),
|
|
88
123
|
}),
|
|
89
124
|
);
|
|
90
125
|
|
|
@@ -127,7 +162,17 @@ function dockItem(launcher: string): string {
|
|
|
127
162
|
return `[PlankDockItemPreferences]\nLauncher=${pathToFileURL(launcher).href}\n`;
|
|
128
163
|
}
|
|
129
164
|
|
|
130
|
-
function
|
|
165
|
+
function desktopCommand(args: string[]): string {
|
|
166
|
+
return args
|
|
167
|
+
.map((arg) => `"${arg.replace(/[\\"`$]/g, "\\$&").replace(/%/g, "%%")}"`)
|
|
168
|
+
.join(" ");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function seedFile(
|
|
172
|
+
path: string,
|
|
173
|
+
contents: string,
|
|
174
|
+
previousContents: readonly string[] = [],
|
|
175
|
+
): void {
|
|
131
176
|
const temporaryPath = `${path}.${randomUUID()}.tmp`;
|
|
132
177
|
try {
|
|
133
178
|
writeFileSync(temporaryPath, contents, { flush: true });
|
|
@@ -137,6 +182,12 @@ function seedFile(path: string, contents: string): void {
|
|
|
137
182
|
if ((err as NodeJS.ErrnoException).code !== "EEXIST") {
|
|
138
183
|
throw err;
|
|
139
184
|
}
|
|
185
|
+
if (
|
|
186
|
+
previousContents.length > 0 &&
|
|
187
|
+
previousContents.includes(readFileSync(path, "utf8"))
|
|
188
|
+
) {
|
|
189
|
+
renameSync(temporaryPath, path);
|
|
190
|
+
}
|
|
140
191
|
} finally {
|
|
141
192
|
rmSync(temporaryPath, { force: true });
|
|
142
193
|
}
|
|
@@ -219,6 +219,7 @@ describe("DesktopSessionManager process tree", () => {
|
|
|
219
219
|
expect(x[x.indexOf("-rfbport") + 1]).toBe(String(DESKTOP_VNC_PORT));
|
|
220
220
|
expect(x[x.indexOf("-geometry") + 1]).toBe("1600x900");
|
|
221
221
|
for (const role of [
|
|
222
|
+
"session-bus",
|
|
222
223
|
"window-manager",
|
|
223
224
|
"compositor",
|
|
224
225
|
"clipboard",
|
|
@@ -229,6 +230,7 @@ describe("DesktopSessionManager process tree", () => {
|
|
|
229
230
|
HOME: "/data",
|
|
230
231
|
LANG: "C.UTF-8",
|
|
231
232
|
DISPLAY: ":99",
|
|
233
|
+
XDG_DATA_HOME: panelConfigDir,
|
|
232
234
|
DBUS_SESSION_BUS_ADDRESS: h.manager.accessibilityBusAddress,
|
|
233
235
|
NO_AT_BRIDGE: "0",
|
|
234
236
|
GTK_A11Y: "atspi",
|
|
@@ -280,7 +282,7 @@ describe("DesktopSessionManager process tree", () => {
|
|
|
280
282
|
"plank",
|
|
281
283
|
"tigervncconfig",
|
|
282
284
|
"vncconfig",
|
|
283
|
-
"
|
|
285
|
+
"wezterm",
|
|
284
286
|
],
|
|
285
287
|
});
|
|
286
288
|
await expect(h.manager.ensureDesktopRunning()).rejects.toThrow(
|
|
@@ -306,7 +308,7 @@ describe("DesktopSessionManager process tree", () => {
|
|
|
306
308
|
join(panelConfigDir, "applications", "xterm.desktop"),
|
|
307
309
|
"utf8",
|
|
308
310
|
);
|
|
309
|
-
expect(terminal).toContain(`Exec="/usr/bin/
|
|
311
|
+
expect(terminal).toContain(`Exec="/usr/bin/wezterm"`);
|
|
310
312
|
expect(terminal).toContain(`Icon=${join(panelConfigDir, "terminal.png")}`);
|
|
311
313
|
|
|
312
314
|
const bytes = readFileSync(join(panelConfigDir, "terminal.png"));
|
|
@@ -11,8 +11,6 @@ import { mkdirSync, writeFileSync } from "node:fs";
|
|
|
11
11
|
import { createConnection } from "node:net";
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
|
|
14
|
-
import { readAvatarState } from "../avatar/avatar-manifest.js";
|
|
15
|
-
import { resolveNotificationAccentHex } from "../avatar/notification-avatar.js";
|
|
16
14
|
import { getIsContainerized } from "../config/env-registry.js";
|
|
17
15
|
import { connectCdpWsTransport } from "../tools/browser/cdp-client/cdp-inspect/ws-transport.js";
|
|
18
16
|
import { terminateProcessTree } from "../util/host-process.js";
|
|
@@ -358,11 +356,7 @@ export class DesktopSessionManager {
|
|
|
358
356
|
((configDir) => {
|
|
359
357
|
let sourcePath: string | undefined;
|
|
360
358
|
try {
|
|
361
|
-
sourcePath = writeDesktopWindowTheme(
|
|
362
|
-
configDir,
|
|
363
|
-
this.sourceEnv.HOME,
|
|
364
|
-
resolveNotificationAccentHex(readAvatarState()),
|
|
365
|
-
);
|
|
359
|
+
sourcePath = writeDesktopWindowTheme(configDir, this.sourceEnv.HOME);
|
|
366
360
|
} catch (err) {
|
|
367
361
|
log.warn({ err }, "Desktop window theme could not be applied");
|
|
368
362
|
}
|
|
@@ -882,6 +876,8 @@ export class DesktopSessionManager {
|
|
|
882
876
|
}
|
|
883
877
|
}
|
|
884
878
|
env.DISPLAY = DESKTOP_DISPLAY;
|
|
879
|
+
// D-Bus-activated window matching must see the same launchers as Plank.
|
|
880
|
+
env.XDG_DATA_HOME = this.panelConfigDir;
|
|
885
881
|
env.DBUS_SESSION_BUS_ADDRESS = this.accessibilityBusAddress;
|
|
886
882
|
env.NO_AT_BRIDGE = "0";
|
|
887
883
|
env.GTK_A11Y = "atspi";
|
|
@@ -13,24 +13,7 @@ const BUTTON_MASKS = {
|
|
|
13
13
|
iconify: [0, 0, 0, 0, 0x3ff, 0x3ff, 0, 0, 0, 0],
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
function windowTheme(
|
|
17
|
-
const tint = (base: string, amount: number): string => {
|
|
18
|
-
if (!accentHex || !/^#[\da-f]{6}$/i.test(accentHex)) {
|
|
19
|
-
return base;
|
|
20
|
-
}
|
|
21
|
-
return (
|
|
22
|
-
"#" +
|
|
23
|
-
[1, 3, 5]
|
|
24
|
-
.map((offset) => {
|
|
25
|
-
const from = parseInt(base.slice(offset, offset + 2), 16);
|
|
26
|
-
const to = parseInt(accentHex.slice(offset, offset + 2), 16);
|
|
27
|
-
return Math.round(from + (to - from) * amount)
|
|
28
|
-
.toString(16)
|
|
29
|
-
.padStart(2, "0");
|
|
30
|
-
})
|
|
31
|
-
.join("")
|
|
32
|
-
);
|
|
33
|
-
};
|
|
16
|
+
function windowTheme(): string {
|
|
34
17
|
return `
|
|
35
18
|
border.width: 1
|
|
36
19
|
padding.width: 8
|
|
@@ -47,17 +30,15 @@ window.*.grip.bg: Flat Solid
|
|
|
47
30
|
window.*.button.*.bg: Parentrelative
|
|
48
31
|
window.*.button.*.hover.bg: Flat Solid
|
|
49
32
|
window.*.button.*.pressed.bg: Flat Solid
|
|
50
|
-
window.active.title.bg:
|
|
51
|
-
window.active.title.bg.color: ${tint("#292930", 0.28)}
|
|
52
|
-
window.active.title.bg.colorTo: #292930
|
|
33
|
+
window.active.title.bg.color: #292930
|
|
53
34
|
window.active.border.color: #4a4a54
|
|
54
35
|
window.active.title.separator.color: #202026
|
|
55
36
|
window.active.label.text.color: #f0f0f4
|
|
56
37
|
window.active.handle.bg.color: #292930
|
|
57
38
|
window.active.grip.bg.color: #292930
|
|
58
39
|
window.active.button.*.image.color: #d4d4dc
|
|
59
|
-
window.active.button.*.hover.bg.color:
|
|
60
|
-
window.active.button.*.pressed.bg.color:
|
|
40
|
+
window.active.button.*.hover.bg.color: #45454f
|
|
41
|
+
window.active.button.*.pressed.bg.color: #555561
|
|
61
42
|
window.active.button.*.disabled.image.color: #62626e
|
|
62
43
|
window.active.button.close.hover.bg.color: #b64150
|
|
63
44
|
window.active.button.close.pressed.bg.color: #963442
|
|
@@ -97,7 +78,6 @@ osd.label.text.color: #f0f0f4
|
|
|
97
78
|
export function writeDesktopWindowTheme(
|
|
98
79
|
configDir: string,
|
|
99
80
|
home?: string,
|
|
100
|
-
accentHex: string | null = null,
|
|
101
81
|
): string {
|
|
102
82
|
let source: string | undefined;
|
|
103
83
|
let sourcePath = "";
|
|
@@ -134,7 +114,7 @@ export function writeDesktopWindowTheme(
|
|
|
134
114
|
mkdirSync(join(themeDir, "openbox-3"), { recursive: true });
|
|
135
115
|
writeFileSync(
|
|
136
116
|
join(themeDir, "openbox-3", "themerc"),
|
|
137
|
-
windowTheme(
|
|
117
|
+
windowTheme().trimStart(),
|
|
138
118
|
);
|
|
139
119
|
for (const [name, rows] of Object.entries(BUTTON_MASKS)) {
|
|
140
120
|
const bytes = rows.flatMap((row) => [row & 0xff, row >> 8]);
|