manually map
This commit is contained in:
parent
2d6cb05015
commit
191222aa31
1 changed files with 11 additions and 5 deletions
|
|
@ -23,12 +23,18 @@ RowLayout {
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
function parseName(name) {
|
if (!Mpris.active) {
|
||||||
const words = name.split("-");
|
return "inactive";
|
||||||
const capitalized = words.map(val => val.trim().charAt(0).toUpperCase() + val.trim().slice(1));
|
|
||||||
return capitalized.join(" ");
|
|
||||||
}
|
}
|
||||||
return parseName(Mpris.active?.desktopEntry ?? Mpris.active?.dbusName ?? "unknown");
|
const player = Mpris.active;
|
||||||
|
const displayName = player.identity ?? player.desktopEntry ?? player.dbusName ?? "unknown";
|
||||||
|
if (displayName.toLowerCase().includes('tidal')) {
|
||||||
|
return "Tidal";
|
||||||
|
}
|
||||||
|
if (displayName.toLowerCase().includes('zen')) {
|
||||||
|
return "Zen";
|
||||||
|
}
|
||||||
|
return displayName;
|
||||||
}
|
}
|
||||||
font.pixelSize: 20
|
font.pixelSize: 20
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue