Internals

Shell identity

Shared session user for shell UI and per-user VFS paths (useDesktopShellIdentity).

Shell identity is who the desktop treats as the current user for display (name, avatar) and filesystem layout (VFS home path). It is not authentication: there is no login flow in core. A future auth module calls setShellIdentity after sign-in; until then everyone is Guest.

API

Composable: useDesktopShellIdentity in @owdproject/core:

import { useDesktopShellIdentity } from '@owdproject/core/runtime/composables/useDesktopShellIdentity'
MemberTypeRole
userIdstringSession id (default 'guest')
displayNamestringShown in start menu, profile areas, etc.
avatarUrlstring | nullOptional image URL
userHomestringVFS home directory (absolute path)
isGuestbooleantrue when userId === 'guest'
setShellIdentity(partial)functionMerge identity after login
clearShellIdentity()functionReset to Guest defaults

Type: ShellIdentity (userId, displayName, avatarUrl, userHome).

State is a module-level singleton (one identity per browser tab). Auto-import works when core is installed.

Defaults

On first use, identity is initialized as Guest:

  • displayName: 'Guest'
  • userHome: from runtimeConfig.public.desktop.fs.defaultUserHome, or /home/Guest if unset

module-fs sets a theme default in its module:

defaultUserHome: '/home/Guest'

Override in desktop.config.ts under the fs namespace (via module augmentation):

export default defineDesktopConfig({
  modules: ['@owdproject/module-fs'],
  fs: {
    defaultUserHome: '/home/Guest',
  },
})

Auth integration (pattern)

const { setShellIdentity, clearShellIdentity } = useDesktopShellIdentity()

// After successful login
setShellIdentity({
  userId: 'alice',
  displayName: 'Alice',
  avatarUrl: 'https://…',
  userHome: userHomeFromHandle('@alice.bsky.social'), // optional helper
})

// On logout
clearShellIdentity()

Helpers (same module):

  • userHomeFromHandle(handle, base?) — e.g. @alice.bsky.social/home/alice.bsky.social
  • sanitizeUserHomeSegment(input) — safe path segment for VFS

Who consumes identity

ConsumerUse
ThemesStart menu footer, profile chip, settings (read displayName, avatarUrl)
module-fsuseFsRecentFiles stores recents under {userHome}/.local/share/… so each user has separate recent files
Future auth modulesCall setShellIdentity / clearShellIdentity

Explorer overwrite/delete dialogs use useDesktopDialogs, not shell identity.

UI library neutrality

Identity lives in core (runtime/composables/), not in PrimeVue or any theme package. Vuetify/Nuxt UI themes use the same composable.