Back to Oh My Posh

Spotify

website/docs/segments/music/spotify.mdx

29.12.01.8 KB
Original Source

What

Show the currently playing song in the 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.

On macOS & Linux, all states are supported (playing/paused/stopped).

On Windows/WSL, only the playing state is supported (no information when paused/stopped). It supports fetching information from the native Spotify application and Edge PWA. :::

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 " } }} />

Options

NameTypeDefaultDescription
playing_iconstring\ue602 text/icon to show when playing
paused_iconstring\uf04c text/icon to show when paused
stopped_iconstring\uf04d text/icon to show when stopped

Template (info)

:::note default template

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

:::

Properties

NameTypeDescription
.Statusstringplayer status (playing, paused, stopped)
.Artiststringcurrent artist
.Trackstringcurrent track
.Iconstringicon (based on .Status)