Direct naar hoofdinhoud

YouTube Muziek

Onofficiรซle Beta-vertaling

Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden โ†’

Watโ€‹

Toont het nummer dat momenteel wordt afgespeeld in de YouTube Music Desktop App.

Instellenโ€‹

Je moet de Companion API inschakelen in de instellingen van de YouTube Music Desktop App. Open hiervoor de app, ga naar Settings > Integration en schakel het volgende in:

  • Companion server

  • Enable companion authentication

Voer vanuit de CLI de volgende opdracht uit om het authenticatietoken in te stellen:

oh-my-posh auth ytmda

Als dit correct is uitgevoerd, kun je nu het ytm-segment aan je prompt toevoegen.

snelheidsbeperking

De YouTube Music Desktop App heeft vrij strikte snelheidsbeperkingen. Daarom is het aanbevolen om de cache-eigenschap in je configuratie in te stellen. Zonder deze instelling kan het segment de informatie niet correct weergeven.

Voorbeeldconfiguratieโ€‹

{
"type": "ytm",
"style": "powerline",
"powerline_symbol": "๎‚ฐ",
"foreground": "#ffffff",
"background": "#FF0000",
"options": {
"playing_icon": "๏‹ ",
"paused_icon": "๏Œ ",
"stopped_icon": "๏ ",
"ad_icon": "๎บป ",
"http_timeout": 1000
},
"cache": {
"duration": "5s",
"strategy": "session"
}
}

Optiesโ€‹

NameTypeDefaultDescription
playing_iconstring\uf04b text/icon to show when playing
paused_iconstring\uf04c text/icon to show when paused
stopped_iconstring\uf04d text/icon to show when stopped
ad_iconstring\ueebb text/icon to show when an advertisement is playing
http_timeoutint5000in milliseconds - the timeout for http request

Template (informatie)โ€‹

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

Eigenschappenโ€‹

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