diff --git a/reference/pear/api.md b/reference/pear/api.md index 57de7b5..a9a8fab 100644 --- a/reference/pear/api.md +++ b/reference/pear/api.md @@ -451,6 +451,29 @@ Returns a `Boolean` promise for whether the call succeeded. Desktop Applications only. +### `Pear.tray(options , listener ) => Promise` + +Configure a tray icon for the application. This method will return a promise which resolves to an `untray()` function for removing the tray. + +The `listener` function is triggered whenever a menu item or the tray icon is clicked. It receives a single argument `key` that represents the menu item `key` that was clicked or the special value of `'click'` for when the menu icon itself was clicked. If no `listener` function is provided, a default listener will show the application window when triggered with `'click'` or `'show'` and quits with `'quit'`. + +A Pear application must be `hideable` to support adding a tray (see [`pear.gui.hideable`](./configuration.md#pear.gui.hideable-less-than-boolean-greater-than-default-false)). + +WARNING: Linux tray support varies which can cause scenarios where the application's tray doesn't work and closing the app will be hidden and inaccessible. Using a tray and `hideable` on Linux is not recommended. + +Desktop Applications only. + +**Options** + +* `icon ` Default: The Pear icon - The path for icon for the tray + relative to the project root. Supported formats: PNG & JPEG +* `menu ` Default: ``{ show: `Show ${Pear.config.name}`, quit: 'Quit' }`` - The + tray menu items. Each property of the object is the `key` passed to the + `listener` and whose value is the text displayed in the menu. +* `os ` Default: `{ win32: true, linux: true, darwin: true }` - which + platforms support using the tray menu. The platform is checked via the + `process.platform` value. + ### `const win = new Pear.Window(entry , options )` Desktop Applications only. diff --git a/reference/pear/cli.md b/reference/pear/cli.md index cca5c34..fefbcbc 100644 --- a/reference/pear/cli.md +++ b/reference/pear/cli.md @@ -91,7 +91,6 @@ Run an application from a link or dir. --links Override configured links with comma-separated key-values --chrome-webrtc-internals Enable chrome://webrtc-internals --unsafe-clear-app-storage Clear app storage - --unsafe-clear-preferences Clear preferences (such as trustlist) --appling=path Set application shell path --checkout=n Run a checkout, n is version length --checkout=release Run checkout from marked released length @@ -157,6 +156,12 @@ Synchronize files from link to dir. > To dump to stdout use `-` in place of `` +`` can contain a path portion to dump a subset of the files for the Pear application. For example, to dump only the `CHANGELOG.md` from Keet into a `dump-dir` directory run: + +``` +pear dump pear://keet/CHANGELOG.md dump-dir/ +``` + ``` --dry-run|-d Execute a dump without writing --checkout=n Dump from specified checkout, n is version length @@ -218,6 +223,19 @@ Move user application storage between applications. --json Newline delimited JSON output ``` +## `pear reset [flags] ` + +Advanced. Reset an application to initial state + +Clears application storage for a given application link. + +WARNING: Confirmation will be requested as the storage will be deleted permanently and cannot be recovered. Use with caution. + +``` +--json Newline delimited JSON output +--help|-h Show help +``` + ## `pear gc [flags] [command]` Perform garbage collection and remove unused resources. @@ -232,5 +250,27 @@ Perform garbage collection and remove unused resources. --help|-h Show help ``` +## `pear data [flags] [command]` + +View database contents. + +The database contains metadata stored on this device used by the Pear runtime. + +| Commands | Description | +| ---------- | -------------------------- | +| apps | Installed apps | +| dht | DHT known-nodes cache | +| gc | Garbage collection records | + +``` +--secrets Show sensitive information, i.e. encryption-keys +--json Newline delimited JSON output +--help|-h Show help +``` + +### `pear data apps [flags] [link]` + +List installed apps, filtered by `[link]` if provided. + diff --git a/reference/pear/configuration.md b/reference/pear/configuration.md index 96a795d..ad2f6f5 100644 --- a/reference/pear/configuration.md +++ b/reference/pear/configuration.md @@ -50,6 +50,10 @@ The following `platform`s are supported: - `linux` - `win32` +### `pear.gui.name ` + +Override the app name which otherwise defaults to [name](#pear.name-less-than-string-greater-than). + #### `pear.gui.width ` Window width (pixels). @@ -142,6 +146,8 @@ Enable transparency. Must be set for opacity to work. Keep app running when all windows are closed. +WARNING: Linux tray support varies which can cause scenarios where the application's tray doesn't work and closing the app will be hidden and inaccessible. Using a tray and `hideable` on Linux is not recommended. + #### `pear.gui.backgroundColor ` (default: "#000" non-transparent, "#00000000" transparent) Background color (Hex, RGB, RGBA, HSL, HSLA, CSS color).