Added workspaces, window titles, volume, bluetooth, systray and date/time modules to the panel

This commit is contained in:
Jas Singh
2024-06-09 01:25:57 -07:00
commit 6ff50006f2
33 changed files with 2001 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
const mpris = await Service.import("mpris");
const Media = () => {
const label = Utils.watch("", mpris, "player-changed", () => {
if (mpris.players[0]) {
const { track_artists, track_title } = mpris.players[0];
return `${track_artists.join(", ")} - ${track_title}`;
} else {
return "Nothing is playing";
}
});
return {
component: Widget.Button({
class_name: "media",
on_primary_click: () => mpris.getPlayer("")?.playPause(),
on_scroll_up: () => mpris.getPlayer("")?.next(),
on_scroll_down: () => mpris.getPlayer("")?.previous(),
child: Widget.Label({ label }),
}),
isVisible: false,
};
};
export { Media };