> ## Documentation Index
> Fetch the complete documentation index at: https://docs.otter-shell.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Applications

> Icon lookup, desktop entries, AppList, and launcher in otter-desktop.

Icon lookup, `.desktop` parsing, installed app list, and launch helpers.

## Icon lookup

```zig theme={null}
if (otter_desktop.findIcon(allocator, "firefox")) |path| {
    defer allocator.free(path);
}

var cache = otter_desktop.IconCache.init(allocator);
const path = cache.lookup("firefox");
```

Search order:

1. Preferred themes (Papirus, Breeze, Adwaita, hicolor, etc.) with SVG preferred over PNG
2. Remaining themes on disk
3. Pixmaps directories
4. `.desktop` `Icon=` fallback (exact filename, then directory scan for AppImages)

Base paths include XDG data home, `/usr/share/icons`, and Flatpak export trees.

## Desktop entries

```zig theme={null}
var entry = try otter_desktop.applications.desktop_entry.parse(allocator, path, .{});
defer entry.deinit();
// entry.name, entry.exec, entry.icon, Terminal flag, etc.
```

Locale-aware `Name` and `Comment` resolution follows XDG rules.

## Application list

```zig theme={null}
var apps = try otter_desktop.applications.AppList.initWithWatcher(allocator);
try apps.scan();
apps.subscribe(onAppsChanged, &ctx);
```

`AppDirWatcher` uses `otter-utils` inotify on XDG applications directories.

## Launcher

```zig theme={null}
try otter_desktop.applications.launcher.launch(allocator, &entry);
```

Expands `%f`, `%u`, `%i` exec fields. `Terminal=true` entries spawn through detected terminal (`$TERMINAL`, then foot, otter-term, kitty, etc.).
