import { bind } from "astal" import { Astal, Gtk, Widget } from "astal/gtk3" import { Box, Button, Overlay } from "astal/gtk3/widget" import { popup } from "./popup" import Mpris from "gi://AstalMpris" const mpris = Mpris.get_default() const { TOP, RIGHT } = Astal.WindowAnchor let playerWindow function NewCover(coverPath: string) { let b = return b } function cover(player: Mpris.Player) { let coverContainer = let coverOverlay: Overlay coverOverlay = { let newCover = NewCover(coverPath) coverContainer.widthRequest = newCover.get_preferred_width()[0] if (coverOverlay) { coverOverlay.overlay = NewCover(player.coverArt) } return "" })} > return coverOverlay } function wrap(str: string) { if (str.length > 40) { str = str.substring(0, 40) } if (str.length > 20) { return str.substring(0, 20) + "\n" + str.substring(20) } return str } function playerBox(player: Mpris.Player) { return wrap(str)) }), new Widget.Label({ className: "playerArtist", justify: Gtk.Justification.CENTER, label: bind(player, "artist").as(str => wrap(str)) }) ] }) }> { return `background-image: url("${c}");` })}> } function PlayerWindow() { return {mpris.players.map(p => playerBox(p))} } export default function player() { let fillerBox = let playerContainer =