Skip to content

Configuration

The marble command will by default look for ~/.config/marble/index.ts which if not found will run the default configuration as a fallback.

Writing a custom configuration will require you to setup a TypeScript dev environment.

  1. Create the directory

    sh
    mkdir ~/.config/marble
    cd ~/.config/marble
  2. Install dependencies

    sh
    npm install gnim@latest github:marble-shell/shell
  3. Create tsconfig.json

    json
    { "extends": "marble/tsconfig.json" }
  4. Generate TypeScript annotations for Gtk and other libraries

    sh
    npx @ts-for-gir/cli generate --ignoreVersionConflicts

    TIP

    If you are on Nix, this command will not work without a devshell. As a workaround you can use AGS:

    sh
    nix shell github:aylur/ags -c ags types -d .
  5. Create index.ts

    ts
    import { defineConfig } from "marble"
    
    export default defineConfig((app) => {
      print(app.VERSION)
      app.quit()
    })

Running marble should print the version and quit.

Copying the default configuration

You can either start from scratch or copy the default config Marble comes with.

WARNING

It is not a minimal example, but meant to be usable ootb.

sh
cd ~/.config/marble
cp -r node_modules/marble/config/* .