# KLWP/KWGT APIs

## Current status

At the moment there are no known issues between Smart Launcher and Kustom apps.

Our goal is to guaranteeing the best possible experience with Kustom apps, so if you have suggestions or request feel free to contact us.

## Interacting with Smart Launcher from Kustom apps

### Get the current Smart Launcher page

While using KLWP/KWGT you can check the current Smart Launcher page by using the formula `$br(smartlauncher, screen)$` in the formula editor. Refer to the table below for the meaning of each code.

| Screen name                              | Code |
| ---------------------------------------- | ---- |
| Default home page                        | `0`  |
| Home page different from the default one | `4`  |
| App page                                 | `1`  |
| Search page                              | `2`  |
| News page                                | `3`  |

### Get the launcher palette

Smart Launcher provides its color palette as variables, enabling you to create setups that seamlessly integrate with the launcher UI and widgets. For example, you can set the color of a KLWP text element to `$br(smartlauncher, on-wallpaper-color)$` to ensure it fits perfectly with the rest of the interface.

<table><thead><tr><th>Variable name</th><th>Explanation</th><th>Example</th></tr></thead><tbody><tr><td><pre><code>on-wallpaper-color
</code></pre></td><td>Used for items directly placed on the wallpaper.<br>E.g: Icon labels</td><td><img src="/files/1q1qzAnLhOBXhFp1xnvm" alt="" data-size="original"></td></tr><tr><td><pre><code>surface-color
</code></pre></td><td>Used to tint surfaces placed on the wallpaper.<br>E.g. Widgets background</td><td><img src="/files/GndgfxYqqU1xirw6RnZT" alt="" data-size="original"></td></tr><tr><td><pre><code>on-surface-color
</code></pre></td><td>Used for items placed on surfaces.<br>E.g. Text in widgets (100%)</td><td><img src="/files/GndgfxYqqU1xirw6RnZT" alt="" data-size="original"></td></tr><tr><td><pre><code>accent-color
</code></pre></td><td>Used for highlighted items.<br>E.g. The category bar indicator</td><td><img src="/files/lAQaf8CyNmABd5QKxfYA" alt="" data-size="original"></td></tr></tbody></table>

Please note that the variable names do not match the color names used in Smart Launcher. We chose these variable names to align with the naming convention adopted by the [Niagara Team](https://help.niagaralauncher.app/article/59-klwp-integration), aiming to create a unified experience for Kustom creators.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.smartlauncher.net/work-with-smart-launcher/klwp-kwgt-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
