💥 fix(ags/media): copy media link to clipboard freezing the whole shell

This commit is contained in:
retrozinndev
2025-03-01 14:29:16 -03:00
parent adb615c56b
commit e56b945469
2 changed files with 4 additions and 9 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { bind, GLib, Process } from "astal";
import { bind, execAsync, GLib } from "astal";
import { Gtk, Widget } from "astal/gtk3";
import AstalMpris from "gi://AstalMpris";
import { Separator, SeparatorProps } from "../Separator";
@@ -35,7 +35,7 @@ export function Media(): Gtk.Widget {
tooltipText: "Copy link to Clipboard",
visible: bind(players[0], "metadata").as((_metadata: GLib.HashTable) =>
players[0].get_meta("xesam:url") === null),
onClick: () => Process.exec(`wl-copy ${players[0].get_meta("xesam:url")?.get_string()[0]}`)
onClick: () => execAsync(`sh -c "wl-copy \\"$(playerctl metadata 'xesam:url')\\""`)
} as Widget.ButtonProps),
new Widget.Button({
className: "previous nf",