Apps

Windows and commands

Window models, entries, commands, singletons, and ApplicationController.

ApplicationConfig (in runtime/app.config.ts) describes how the desktop shell launches and manages your app. The canonical example is app-about.

Full example (About app)

export default {
  id: 'org.owdproject.about',
  title: 'About',
  category: 'system-tools',
  singleton: true,
  icon: 'mdi:hexagon-multiple-outline',
  windows: {
    main: {
      component: () => import('./components/Window/WindowAbout.vue'),
      resizable: false,
      size: { width: 448, height: 240 },
      position: { x: 400, y: 240, z: 0 },
    },
  },
  entries: {
    about: { command: 'about' },
  },
  commands: {
    about: (app) => {
      const existing = app.getFirstWindowByModel('main')
      if (existing) {
        existing.actions.setActive(true)
        existing.actions.bringToFront()
        return existing
      }
      return app.openWindow('main')
    },
  },
}

Window models (windows)

Each key under windows is a model (e.g. main, settings). For each model you typically set:

  • component: () => import('./components/Window/WindowMain.vue') (dynamic import).
  • size, position, resizable, minimizable, … — see WindowConfig types in core.

Open a window from commands with app.openWindow('main').

Entries

entries describe how the user starts a flow (app menu, search, launcher):

entries: {
  main: { command: 'open' },
  about: { command: 'about' },
},

Each entry’s command string must match a key under commands.

Commands

Keys under commands are functions (app: IApplicationController, ...args) => void | Promise<unknown>.

Common patterns:

PatternExample
Open window(app) => app.openWindow('main')
Singleton focusCheck getFirstWindowByModel, then bringToFront
Close all then openapp.closeAllWindows() then openWindow (playground reset)
commands: {
  open: (app) => app.openWindow('main'),
  about: (app) => {
    const existing = app.getFirstWindowByModel('main')
    if (existing) {
      existing.actions.setActive(true)
      existing.actions.bringToFront()
      return existing
    }
    return app.openWindow('main')
  },
},

Invoke from code via useApplicationManager().execAppCommand(appId, 'about').

Singleton

With singleton: true, the shell treats the app as a single instance. Combine with command logic that reuses an existing window instead of opening duplicates (see About about command above).

Terminal commands (optional)

If you expose text commands to the OWD shell, the core wires TerminalManager to registered apps. Register command names during app init (see ApplicationController / application store).