RAGS - v1.11.0
    Preparing search index...

    Class App

    The main AGS application singleton.

    Manages windows, CSS styling, icon themes, and the DBus interface. Access the running instance via the global App object or import app from this module.

    App.config({
    style: './style.css',
    windows: [MyWindow()],
    });

    Hierarchy

    • Application
      • App
    Index

    Accessors

    • get activeTheme(): string | null

      The name of the currently active theme, or null if none has been set.

      Returns string | null

    • get closeWindowDelay(): { [key: string]: number }

      Map of window names to close delays in milliseconds.

      Returns { [key: string]: number }

    • set closeWindowDelay(v: { [key: string]: number }): void

      Parameters

      • v: { [key: string]: number }

      Returns void

    • get configDir(): string

      Directory containing the user's config file.

      Returns string

    • get configPath(): string

      Absolute path to the user's config file.

      Returns string

    • get cursorTheme(): string

      Returns string

    • set cursorTheme(name: string): void

      The current cursor theme name.

      Parameters

      • name: string

      Returns void

    • get gtkTheme(): string

      Returns string

    • set gtkTheme(name: string): void

      The current GTK theme name.

      Parameters

      • name: string

      Returns void

    • get iconTheme(): string

      Returns string

    • set iconTheme(name: string): void

      The current GTK icon theme name.

      Parameters

      • name: string

      Returns void

    • get windows(): Window[]

      All registered windows.

      Returns Window[]

    Constructors

    • Parameters

      • Optionalproperties: Partial<ConstructorProps>
      • ...args: any[]

      Returns App

    Methods

    • Prepends a directory to the icon search path.

      Parameters

      • path: string

        Directory containing icon files

      Returns void

    • Registers a window with the application.

      The window must have a name property set. Emits 'window-toggled' when the window's visibility changes.

      Parameters

      • w: Window

        The GTK window to register

      Returns void

    • Applies CSS styling from a file path or inline CSS string.

      Parameters

      • pathOrStyle: string

        A file path to a CSS file or an inline CSS string

      • reset: boolean = false

        If true, removes all previously applied CSS first

      Returns void

    • Hides a window by name, respecting any configured close delay.

      Parameters

      • name: string

        The window name

      Returns void

    • Applies configuration settings to the application.

      Parameters

      • config: Config

        The configuration object

      Returns void

    • Connects a callback to a signal.

      Parameters

      • signal: string = 'window-toggled'

        The signal name (defaults to 'window-toggled')

      • callback: (_: this, ...args: any[]) => void

        The callback to invoke

      Returns number

      The connection ID

    • Retrieves a registered window by name.

      Parameters

      • name: string

        The window name

      Returns Window | undefined

      The window, or undefined if not found

    • Opens the GTK interactive debugger.

      Returns void

    • Shows a window by name.

      Parameters

      • name: string

        The window name

      Returns void

    • Quits the application.

      Returns void

    • DBus method to quit the application.

      Returns void

    • Registers a named theme (CSS file path or inline CSS string).

      Parameters

      • name: string

        A unique theme name

      • pathOrCss: string

        Path to a CSS file or inline CSS string

      Returns void

    • Removes and destroys a registered window.

      Parameters

      • w: string | Window

        The window instance or its name

      Returns void

    • Removes all CSS providers that were applied via applyCss.

      Returns void

    • Reads and evaluates a JavaScript file in the application context.

      Parameters

      • file: string

        Path to the JavaScript file

      • Optionalbus: string

        The client's DBus bus name

      • Optionalpath: string

        The client's DBus object path

      Returns void

    • Evaluates a JavaScript string in the application context. Called via DBus from the client.

      Parameters

      • js: string

        JavaScript code to evaluate

      • OptionalclientBusName: string

        The client's DBus bus name for returning results

      • OptionalclientObjPath: string

        The client's DBus object path

      Returns void

    • Parameters

      • js: string
      • OptionalbusName: string
      • OptionalobjPath: string

      Returns void

      Use RunJs instead, which now supports await syntax.

    • Switches to a registered theme by name.

      Resets all current CSS and applies the theme CSS. Use @define-color in theme CSS files for GTK3-compatible theming.

      Parameters

      • name: string

        The theme name previously registered via registerTheme

      Returns void

    • Toggles a window's visibility by name.

      Parameters

      • name: string

        The window name

      Returns string | undefined

    • DBus method to toggle a window. Returns the window's visibility as a string.

      Parameters

      • name: string

      Returns string

    • Returns a JSON-serializable representation of the application state.

      Returns { bus: string | null; configDir: string; windows: { [k: string]: Window } }

    • Activates the application.

      In essence, this results in the Gio.Application::activate signal being emitted in the primary instance.

      The application must be registered before calling this function.

      Returns void