---
id: spotify
title: Spotify
sidebar_label: Spotify
---

## What

Show the currently playing song in the [Spotify][spotify] client.

:::caution
Be aware this can make the prompt a tad bit slower as it needs to get a response from the Spotify player.

All playback states are supported on every platform (playing/paused/stopped and `ad`). On _Windows_ the data is read from the [System Media Transport Controls][smtc], which
covers both the native Spotify client and the Microsoft Store version, with a fall-back to scraping the
Edge PWA window title. On _WSL_ the same SMTC session is queried via the Windows interop `powershell.exe`,
so the Linux side sees the same information the Windows host does.
:::

## Sample Configuration

import Config from "@site/src/components/Config.js";

<Config
  data={{
    type: "spotify",
    style: "powerline",
    powerline_symbol: "\uE0B0",
    foreground: "#ffffff",
    background: "#1BD760",
    options: {
      playing_icon: "\ue602 ",
      paused_icon: "\uf04c ",
      stopped_icon: "\uf04d ",
      ad_icon: "\ueebb "
    }
  }}
/>

## Options

| Name           |   Type   |  Default  | Description                                                      |
| -------------- | :------: | :-------: | ---------------------------------------------------------------- |
| `playing_icon` | `string` | `\ue602 ` | text/icon to show when playing                                   |
| `paused_icon`  | `string` | `\uf04c ` | text/icon to show when paused                                    |
| `stopped_icon` | `string` | `\uf04d ` | text/icon to show when stopped                                   |
| `ad_icon`      | `string` | `\ueebb ` | text/icon to show when an advertisement is playing             |

## Template ([info][templates])

:::note default template

```template
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}
```

:::

### Properties

| Name      | Type     | Description                                          |
| --------- | -------- | ---------------------------------------------------- |
| `.Status` | `string` | player status (`playing`, `paused`, `stopped`, `ad`) |
| `.Artist` | `string` | current artist                                       |
| `.Track`  | `string` | current track                                        |
| `.Icon`   | `string` | icon (based on `.Status`)                            |

[templates]: /docs/configuration/templates
[spotify]: https://www.spotify.com
[smtc]: https://learn.microsoft.com/en-us/windows/apps/develop/media-playback/system-media-transport-controls
