> For the complete documentation index, see [llms.txt](https://docs.smartlauncher.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smartlauncher.net/work-with-smart-launcher/work-with-smart-launcher/klwp-kwgt-apis.md).

# KLWP/KWGT APIs

KLWP and KWGT are two apps by the Kustom team that let you create live wallpapers and custom widgets, perfectly complementing Smart Launcher.

## 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="https://2951925047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbhTQpvrCNT3tTFB_3o%2Fuploads%2F7iLtMkL5RmsAUzN2Tq97%2Fimage.png?alt=media&amp;token=b628f146-f092-4430-bb09-fac93cb4cbc0" 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="https://2951925047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbhTQpvrCNT3tTFB_3o%2Fuploads%2FHYnBIFICz8It97EZSsOn%2Fimage.png?alt=media&amp;token=45bec6f9-96d6-4218-afe0-35dca238ef76" 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="https://2951925047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbhTQpvrCNT3tTFB_3o%2Fuploads%2FHYnBIFICz8It97EZSsOn%2Fimage.png?alt=media&amp;token=45bec6f9-96d6-4218-afe0-35dca238ef76" 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="https://2951925047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbhTQpvrCNT3tTFB_3o%2Fuploads%2Fsou5BhALx2wTZFmqoMxm%2Fimage.png?alt=media&amp;token=1ebfd2c0-e8a3-43dd-9d37-78a9d3e5a048" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
