Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

DesktopLinuxUrlHandler.test.ts

607 lines23.1 KB

1import * as NodeServices from "@effect/platform-node/NodeServices";
2import { assert, describe, it } from "@effect/vitest";
3import * as Deferred from "effect/Deferred";
4import * as Effect from "effect/Effect";
5import * as FileSystem from "effect/FileSystem";
6import * as Layer from "effect/Layer";
7import * as Option from "effect/Option";
8import * as Path from "effect/Path";
9import * as PlatformError from "effect/PlatformError";
10import * as Sink from "effect/Sink";
11import * as Stream from "effect/Stream";
12import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
13​
14import * as DesktopEnvironment from "./DesktopEnvironment.ts";
15import * as DesktopAssets from "./DesktopAssets.ts";
16import * as DesktopLinuxUrlHandler from "./DesktopLinuxUrlHandler.ts";
17​
18interface RecordedRegistration {
19 readonly directories: string[];
20 readonly files: Array<{ readonly path: string; readonly content: string }>;
21 readonly commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }>;
22 readonly copies: Array<{ readonly source: string; readonly destination: string }>;
24​
25const makeEnvironment = (path: Path.Path, overrides: Record<string, unknown> = {}) =>
26 DesktopEnvironment.DesktopEnvironment.of({
27 platform: "linux",
28 isPackaged: true,
29 isDevelopment: false,
30 displayName: "T3 Code (Alpha)",
31 linuxDesktopEntryName: "com.t3tools.T3Code.desktop",
32 linuxWmClass: "t3code",
33 linuxApplicationsDir: "/home/alice/.local/share/applications",
34 appImagePath: Option.some("/home/alice/Applications/T3-Code.AppImage"),
35 path,
36 ...overrides,
37 } as unknown as DesktopEnvironment.DesktopEnvironment["Service"]);
38​
39const mockProcess = (exitCode: number, stalled = false) =>
40 ChildProcessSpawner.makeHandle({
41 pid: ChildProcessSpawner.ProcessId(1),
42 exitCode: stalled ? Effect.never : Effect.succeed(ChildProcessSpawner.ExitCode(exitCode)),
43 isRunning: Effect.succeed(false),
44 kill: () => Effect.void,
45 unref: Effect.succeed(Effect.void),
46 stdin: Sink.drain,
47 stdout: Stream.empty,
48 stderr: Stream.empty,
49 all: Stream.empty,
50 getInputFd: () => Sink.drain,
51 getOutputFd: () => Stream.empty,
52 });
53​
54const layerHandler = (
55 recorded: RecordedRegistration,
56 input: {
57 readonly environment?: Record<string, unknown>;
58 readonly updateDesktopDatabaseExitCode?: number;
59 readonly updateDesktopDatabaseStalled?: boolean;
60 readonly updateDesktopDatabaseStarted?: Deferred.Deferred<void>;
61 readonly xdgMimeExitCode?: number;
62 readonly writeError?: PlatformError.PlatformError;
63 readonly existingEntry?: string;
64 readonly iconSource?: string;
65 readonly iconCopyError?: PlatformError.PlatformError;
66 } = {},
67) =>
68 DesktopLinuxUrlHandler.layer.pipe(
69 Layer.provide(
70 Layer.mergeAll(
71 Layer.effect(
72 DesktopEnvironment.DesktopEnvironment,
73 Path.Path.pipe(
74 Effect.map((path) => makeEnvironment(path, input.environment)),
75 Effect.provide(Path.layer),
76 ),
77 ),
78 Layer.succeed(DesktopAssets.DesktopAssets, {
79 iconPaths: Effect.succeed({
80 png: Option.fromUndefinedOr(input.iconSource),
81 ico: Option.none(),
82 icns: Option.none(),
83 }),
84 resolveResourcePath: () => Effect.succeedNone,
85 }),
86 FileSystem.layerNoop({
87 copyFile: (source, destination) =>
88 input.iconCopyError
89 ? Effect.fail(input.iconCopyError)
90 : Effect.sync(() => {
91 recorded.copies.push({ source, destination });
92 }),
93 readFileString: () => Effect.succeed(input.existingEntry ?? ""),
94 makeDirectory: (path) =>
95 Effect.sync(() => {
96 recorded.directories.push(path);
97 }),
98 writeFileString: (path, content) =>
99 input.writeError
100 ? Effect.fail(input.writeError)
101 : Effect.sync(() => {
102 recorded.files.push({ path, content });
103 }),
104 }),
105 Layer.succeed(
106 ChildProcessSpawner.ChildProcessSpawner,
107 ChildProcessSpawner.make((command) => {
108 const childProcess = command as unknown as {
109 readonly command: string;
110 readonly args: ReadonlyArray<string>;
111 };
112 if (childProcess.command === "update-desktop-database") {
113 assert.isTrue(
114 recorded.files.length > 0 || input.existingEntry !== undefined,
115 "the desktop entry must exist before refreshing the MIME cache",
116 );
117 }
118 recorded.commands.push({
119 command: childProcess.command,
120 args: childProcess.args,
121 });
122 const exitCode =
123 childProcess.command === "update-desktop-database"
124 ? (input.updateDesktopDatabaseExitCode ?? 0)
125 : (input.xdgMimeExitCode ?? 0);
126 const handle = mockProcess(
127 exitCode,
128 childProcess.command === "update-desktop-database" &&
129 input.updateDesktopDatabaseStalled === true,
130 );
131 return childProcess.command === "update-desktop-database" &&
132 input.updateDesktopDatabaseStarted
133 ? Deferred.succeed(input.updateDesktopDatabaseStarted, undefined).pipe(
134 Effect.as(handle),
135 )
136 : Effect.succeed(handle);
137 }),
138 ),
139 ),
140 ),
141 );
142​
143const runRegister = (
144 recorded: RecordedRegistration,
145 input: Parameters<typeof layerHandler>[1] = {},
146) =>
147 Effect.gen(function* () {
148 const handler = yield* DesktopLinuxUrlHandler.DesktopLinuxUrlHandler;
149 yield* handler.register;
150 }).pipe(Effect.provide(layerHandler(recorded, input)));
151​
152const emptyRecording = (): RecordedRegistration => ({
153 directories: [],
154 files: [],
155 commands: [],
156 copies: [],
157});
158​
159describe("DesktopLinuxUrlHandler", () => {
160 it("renders a scheme-handler desktop entry with freedesktop Exec quoting", () => {
161 const entry = DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
162 displayName: "T3 Code (Nightly)",
163 execTarget: '/home/al ice/Apps/T3 "100%" $HOME\\x.AppImage',
164 scheme: "t3code",
165 iconPath: "/home/al ice/icons/T3\\x.png",
166 });
167​
168 assert.include(entry, "[Desktop Entry]");
169 assert.include(entry, "Name=T3 Code (Nightly)");
170 assert.include(
171 entry,
172 'Exec="/home/al ice/Apps/T3 \\\\"100%%\\\\" \\\\$HOME\\\\\\\\x.AppImage" %U',
173 );
174 assert.include(entry, "NoDisplay=true");
175 assert.notInclude(entry, "StartupWMClass=");
176 assert.include(entry, "MimeType=x-scheme-handler/t3code;");
177 assert.include(entry, "Icon=/home/al ice/icons/T3\\\\x.png");
178 });
179​
180 it.effect(
181 "writes the handler entry, refreshes the MIME cache, and claims the scheme default",
182 () => {
183 const recorded = emptyRecording();
184​
185 return Effect.gen(function* () {
186 yield* runRegister(recorded);
187​
188 assert.deepEqual(recorded.directories, ["/home/alice/.local/share/applications"]);
189 assert.equal(recorded.files.length, 1);
190 assert.equal(
191 recorded.files[0]?.path,
192 "/home/alice/.local/share/applications/com.t3tools.T3Code.desktop",
193 );
194 assert.include(
195 recorded.files[0]?.content,
196 "Exec=/home/alice/Applications/T3-Code.AppImage %U",
197 );
198 assert.include(recorded.files[0]?.content, "MimeType=x-scheme-handler/t3code;");
199 assert.deepEqual(recorded.commands, [
200 {
201 command: "update-desktop-database",
202 args: ["/home/alice/.local/share/applications"],
203 },
204 {
205 command: "xdg-mime",
206 args: ["default", "com.t3tools.T3Code.desktop", "x-scheme-handler/t3code"],
207 },
208 ]);
209 });
210 },
211 );
212​
213 it.effect("falls back to the process executable outside an AppImage", () => {
214 const recorded = emptyRecording();
215​
216 return Effect.gen(function* () {
217 yield* runRegister(recorded, { environment: { appImagePath: Option.none() } });
218​
219 assert.include(
220 recorded.files[0]?.content,
221 DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
222 displayName: "T3 Code (Alpha)",
223 execTarget: process.execPath,
224 scheme: "t3code",
225 iconPath: "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png",
226 }),
227 );
228 });
229 });
230​
231 it.effect("does not rewrite the pre-ready entry while the portal can be reading it", () => {
232 const recorded = emptyRecording();
233​
234 return Effect.gen(function* () {
235 yield* runRegister(recorded, {
236 existingEntry: DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
237 displayName: "T3 Code (Alpha)",
238 execTarget: "/home/alice/Applications/T3-Code.AppImage",
239 scheme: "t3code",
240 iconPath: "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png",
241 }),
242 });
243​
244 assert.deepEqual(recorded.files, []);
245 assert.deepEqual(recorded.directories, []);
246 assert.deepEqual(recorded.commands, [
247 {
248 command: "update-desktop-database",
249 args: ["/home/alice/.local/share/applications"],
250 },
251 {
252 command: "xdg-mime",
253 args: ["default", "com.t3tools.T3Code.desktop", "x-scheme-handler/t3code"],
254 },
255 ]);
256 });
257 });
258​
259 it.effect("installs a persistent icon even when the desktop entry is already current", () => {
260 const recorded = emptyRecording();
261 const iconPath = "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png";
262 return Effect.gen(function* () {
263 yield* runRegister(recorded, {
264 iconSource: "/tmp/.mount_T3/resources/icon.png",
265 existingEntry: DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
266 displayName: "T3 Code (Alpha)",
267 execTarget: "/home/alice/Applications/T3-Code.AppImage",
268 scheme: "t3code",
269 iconPath,
270 }),
271 });
272 assert.deepEqual(recorded.files, []);
273 assert.deepEqual(recorded.copies, [
274 { source: "/tmp/.mount_T3/resources/icon.png", destination: iconPath },
275 ]);
276 assert.equal(recorded.commands.at(-1)?.command, "xdg-mime");
277 });
278 });
279​
280 it.effect("still registers the handler when copying its icon fails", () => {
281 const recorded = emptyRecording();
282 return Effect.gen(function* () {
283 yield* runRegister(recorded, {
284 iconSource: "/tmp/.mount_T3/resources/icon.png",
285 iconCopyError: PlatformError.systemError({
286 _tag: "PermissionDenied",
287 module: "FileSystem",
288 method: "copyFile",
289 description: "read-only icon directory",
290 }),
291 });
292 assert.equal(recorded.files.length, 1);
293 assert.deepEqual(
294 recorded.commands.map(({ command }) => command),
295 ["update-desktop-database", "xdg-mime"],
296 );
297 });
298 });
299​
300 it.effect("writes the portal identity without claiming the URL scheme in development", () => {
301 const nonLinux = emptyRecording();
302 const unpackaged = emptyRecording();
303​
304 return Effect.gen(function* () {
305 yield* runRegister(nonLinux, { environment: { platform: "darwin" } });
306 yield* runRegister(unpackaged, {
307 environment: {
308 isPackaged: false,
309 linuxDesktopEntryName: "com.t3tools.T3Code.Development.desktop",
310 },
311 });
312​
313 assert.deepEqual(nonLinux.files, []);
314 assert.equal(
315 unpackaged.files[0]?.path,
316 "/home/alice/.local/share/applications/com.t3tools.T3Code.Development.desktop",
317 );
318 assert.deepEqual(unpackaged.commands, []);
319 });
320 });
321​
322 it.effect("never fails startup when registration cannot complete", () => {
323 const desktopDatabaseFailed = emptyRecording();
324 const xdgMimeFailed = emptyRecording();
325 const writeFailed = emptyRecording();
326​
327 return Effect.gen(function* () {
328 yield* runRegister(desktopDatabaseFailed, { updateDesktopDatabaseExitCode: 1 });
329 yield* runRegister(xdgMimeFailed, { xdgMimeExitCode: 1 });
330 yield* runRegister(writeFailed, {
331 writeError: PlatformError.systemError({
332 _tag: "PermissionDenied",
333 module: "FileSystem",
334 method: "writeFileString",
335 description: "read-only filesystem",
336 pathOrDescriptor: "/home/alice/.local/share/applications/com.t3tools.T3Code.desktop",
337 }),
338 });
339​
340 assert.deepEqual(
341 desktopDatabaseFailed.commands.map(({ command }) => command),
342 ["update-desktop-database", "xdg-mime"],
343 );
344 assert.equal(xdgMimeFailed.files.length, 1);
345 assert.deepEqual(writeFailed.commands, []);
346 });
347 });
348});
349​
350interface ThemeIconRun {
351 readonly root: string;
352 readonly commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }>;
353 readonly iconCacheOptions?: Array<Record<string, unknown>>;
354 readonly sourceMissing?: boolean;
355 readonly iconCacheExitCode?: number;
356 readonly iconCacheSpawnFails?: boolean;
357 readonly iconCacheStalled?: boolean;
358 readonly iconCacheStarted?: Deferred.Deferred<void>;
359 // Stands in for gtk-update-icon-cache rewriting the cache on success.
360 readonly onIconCacheRefresh?: Effect.Effect<void>;
362​
363const registerWithRealFileSystem = (run: ThemeIconRun) =>
364 Effect.gen(function* () {
365 const handler = yield* DesktopLinuxUrlHandler.DesktopLinuxUrlHandler;
366 yield* handler.register;
367 }).pipe(
368 Effect.provide(
369 DesktopLinuxUrlHandler.layer.pipe(
370 Layer.provide(
371 Layer.mergeAll(
372 Layer.effect(
373 DesktopEnvironment.DesktopEnvironment,
374 Path.Path.pipe(
375 Effect.map((path) =>
376 makeEnvironment(path, {
377 linuxApplicationsDir: path.join(run.root, "applications"),
378 }),
379 ),
380 ),
381 ),
382 Layer.effect(
383 DesktopAssets.DesktopAssets,
384 Path.Path.pipe(
385 Effect.map((path) => ({
386 iconPaths: Effect.succeed({
387 png: Option.none(),
388 ico: Option.none(),
389 icns: Option.none(),
390 }),
391 resolveResourcePath: (fileName: string) =>
392 Effect.succeed(
393 fileName === "icons/256x256.png"
394 ? Option.some(
395 path.join(
396 run.root,
397 run.sourceMissing ? "missing" : "resources",
398 fileName,
399 ),
400 )
401 : Option.none(),
402 ),
403 })),
404 ),
405 ),
406 Layer.succeed(
407 ChildProcessSpawner.ChildProcessSpawner,
408 ChildProcessSpawner.make((command) => {
409 const childProcess = command as unknown as {
410 readonly command: string;
411 readonly args: ReadonlyArray<string>;
412 };
413 run.commands.push({ command: childProcess.command, args: childProcess.args });
414 if (childProcess.command !== "gtk-update-icon-cache") {
415 return Effect.succeed(mockProcess(0));
416 }
417 run.iconCacheOptions?.push(
418 (command as unknown as { readonly options: Record<string, unknown> }).options,
419 );
420 if (run.iconCacheSpawnFails) {
421 return Effect.fail(
422 PlatformError.systemError({
423 _tag: "NotFound",
424 module: "ChildProcess",
425 method: "spawn",
426 description: "gtk-update-icon-cache is not installed",
427 }),
428 );
429 }
430 const exitCode = run.iconCacheExitCode ?? 0;
431 const handle = mockProcess(exitCode, run.iconCacheStalled === true);
432 const refreshed =
433 exitCode === 0 && run.onIconCacheRefresh ? run.onIconCacheRefresh : Effect.void;
434 return refreshed.pipe(
435 Effect.andThen(
436 run.iconCacheStarted
437 ? Deferred.succeed(run.iconCacheStarted, undefined)
438 : Effect.void,
439 ),
440 Effect.as(handle),
441 );
442 }),
443 ),
444 ),
445 ),
446 ),
447 ),
448 );
449​
450const themeIconFixture = (source: Uint8Array) =>
451 Effect.gen(function* () {
452 const fileSystem = yield* FileSystem.FileSystem;
453 const path = yield* Path.Path;
454 const root = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-theme-icons-" });
455 yield* fileSystem.makeDirectory(path.join(root, "resources", "icons"), { recursive: true });
456 yield* fileSystem.writeFile(path.join(root, "resources", "icons", "256x256.png"), source);
457 const hicolorDir = path.join(root, "icons", "hicolor");
458 const appsDir = path.join(hicolorDir, "256x256", "apps");
459 const cachePath = path.join(hicolorDir, "icon-theme.cache");
460 // A fixed time in the past, in whole seconds as fs.utimes expects.
461 const pastSeconds = 1_600_000_000;
462 // An existing cache that predates any installed icon.
463 const seedCache = Effect.gen(function* () {
464 yield* fileSystem.makeDirectory(appsDir, { recursive: true });
465 yield* fileSystem.writeFile(cachePath, new Uint8Array([0]));
466 yield* fileSystem.utimes(cachePath, pastSeconds, pastSeconds);
467 });
468 const rewriteCache = fileSystem
469 .writeFile(cachePath, new Uint8Array([1]))
470 .pipe(Effect.orDie, Effect.provideService(FileSystem.FileSystem, fileSystem));
471 return { root, hicolorDir, appsDir, cachePath, pastSeconds, seedCache, rewriteCache };
472 });
473​
474const iconCacheRuns = (run: ThemeIconRun) =>
475 run.commands.filter(({ command }) => command === "gtk-update-icon-cache").length;
476​
477it.layer(NodeServices.layer)("DesktopLinuxUrlHandler theme icons", (it) => {
478 it.effect("installs both app id spellings without creating an icon cache", () =>
479 Effect.gen(function* () {
480 const fileSystem = yield* FileSystem.FileSystem;
481 const path = yield* Path.Path;
482 const icon = new Uint8Array([137, 80, 78, 71, 1, 2, 3]);
483 const fixture = yield* themeIconFixture(icon);
484 const run: ThemeIconRun = { root: fixture.root, commands: [] };
485​
486 yield* registerWithRealFileSystem(run);
487 assert.deepEqual([...(yield* fileSystem.readDirectory(fixture.appsDir))].sort(), [
488 "com.t3tools.T3Code.png",
489 "com.t3tools.t3code.png",
490 ]);
491 for (const name of ["com.t3tools.t3code", "com.t3tools.T3Code"]) {
492 const target = path.join(fixture.appsDir, `${name}.png`);
493 assert.deepEqual([...(yield* fileSystem.readFile(target))], [...icon]);
494 yield* fileSystem.utimes(target, fixture.pastSeconds, fixture.pastSeconds);
495 }
496​
497 yield* registerWithRealFileSystem(run);
498 for (const name of ["com.t3tools.t3code", "com.t3tools.T3Code"]) {
499 const info = yield* fileSystem.stat(path.join(fixture.appsDir, `${name}.png`));
500 assert.equal(Option.getOrThrow(info.mtime).getTime(), fixture.pastSeconds * 1000);
501 }
502 assert.isFalse(yield* fileSystem.exists(fixture.cachePath));
503 assert.equal(iconCacheRuns(run), 0);
504 }).pipe(Effect.scoped),
505 );
506​
507 it.effect("replaces same-length stale icons and refreshes an existing cache once", () =>
508 Effect.gen(function* () {
509 const fileSystem = yield* FileSystem.FileSystem;
510 const path = yield* Path.Path;
511 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
512 yield* fixture.seedCache;
513 const lower = path.join(fixture.appsDir, "com.t3tools.t3code.png");
514 const upper = path.join(fixture.appsDir, "com.t3tools.T3Code.png");
515 yield* fileSystem.writeFile(lower, new Uint8Array([3, 2, 1]));
516 yield* fileSystem.writeFile(upper, new Uint8Array([1, 2, 3]));
517 for (const target of [lower, upper]) {
518 yield* fileSystem.utimes(target, fixture.pastSeconds, fixture.pastSeconds);
519 }
520 const run: ThemeIconRun = {
521 root: fixture.root,
522 commands: [],
523 onIconCacheRefresh: fixture.rewriteCache,
524 };
525​
526 yield* registerWithRealFileSystem(run);
527 yield* registerWithRealFileSystem(run);
528​
529 assert.deepEqual([...(yield* fileSystem.readFile(lower))], [1, 2, 3]);
530 const upperInfo = yield* fileSystem.stat(upper);
531 assert.equal(Option.getOrThrow(upperInfo.mtime).getTime(), fixture.pastSeconds * 1000);
532 assert.deepEqual(
533 run.commands.filter(({ command }) => command === "gtk-update-icon-cache"),
534 [{ command: "gtk-update-icon-cache", args: ["-f", "-t", fixture.hicolorDir] }],
535 );
536 }).pipe(Effect.scoped),
537 );
538​
539 it.effect("refreshes when this launch changed an icon even if the cache looks newer", () =>
540 Effect.gen(function* () {
541 const fileSystem = yield* FileSystem.FileSystem;
542 const path = yield* Path.Path;
543 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
544 yield* fixture.seedCache;
545 const run: ThemeIconRun = {
546 root: fixture.root,
547 commands: [],
548 onIconCacheRefresh: fixture.rewriteCache,
549 };
550 // A cache stamped later than the new icons, as after a clock correction.
551 const future = fixture.pastSeconds + 10 * 365 * 24 * 60 * 60;
552 yield* fileSystem.utimes(fixture.cachePath, future, future);
553​
554 yield* registerWithRealFileSystem(run);
555​
556 assert.isTrue(yield* fileSystem.exists(path.join(fixture.appsDir, "com.t3tools.T3Code.png")));
557 assert.equal(iconCacheRuns(run), 1);
558 }).pipe(Effect.scoped),
559 );
560​
561 it.effect("retries a failed icon cache refresh on the next launch", () =>
562 Effect.gen(function* () {
563 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
564 yield* fixture.seedCache;
565 const failing: ThemeIconRun = { root: fixture.root, commands: [], iconCacheExitCode: 1 };
566 yield* registerWithRealFileSystem(failing);
567 assert.equal(iconCacheRuns(failing), 1);
568 assert.deepEqual(failing.commands.map(({ command }) => command).slice(1), [
569 "update-desktop-database",
570 "xdg-mime",
571 ]);
572​
573 const recovering: ThemeIconRun = {
574 root: fixture.root,
575 commands: [],
576 onIconCacheRefresh: fixture.rewriteCache,
577 };
578 yield* registerWithRealFileSystem(recovering);
579 yield* registerWithRealFileSystem(recovering);
580 assert.equal(iconCacheRuns(recovering), 1);
581 }).pipe(Effect.scoped),
582 );
583​
584 it.effect("still registers the handler when the theme icon install fails", () =>
585 Effect.gen(function* () {
586 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
587 const missingSource: ThemeIconRun = { root: fixture.root, commands: [], sourceMissing: true };
588 yield* registerWithRealFileSystem(missingSource);
589 assert.deepEqual(
590 missingSource.commands.map(({ command }) => command),
591 ["update-desktop-database", "xdg-mime"],
592 );
593​
594 yield* fixture.seedCache;
595 const missingTool: ThemeIconRun = {
596 root: fixture.root,
597 commands: [],
598 iconCacheSpawnFails: true,
599 };
600 yield* registerWithRealFileSystem(missingTool);
601 assert.deepEqual(
602 missingTool.commands.map(({ command }) => command),
603 ["gtk-update-icon-cache", "update-desktop-database", "xdg-mime"],
604 );
605 }).pipe(Effect.scoped),
606 );
607});