desktopDir
desktopDir returns the user's desktop directory.
Signature
desktopDir(): string?tyrus
import { desktopDir } from "tyrus:os";
const desktop: string? = desktopDir();
if (desktop) {
print(`desktop: ${desktop}`);
}Absence is a valid outcome
A headless system (a server, a container, CI) commonly has no desktop directory at all, that is a normal result, not a failure.
