From fe978092e8c13b337eb4e58b9b08b9ea5cc93413 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:59:51 +1100 Subject: sidebar: create dashboard --- src/modules/sidebar/dashboard.tsx | 123 ++++++++++++++++++++++++++ src/modules/sidebar/index.tsx | 34 +++++++ src/modules/sidebar/modules/hwresources.tsx | 67 ++++++++++++++ src/modules/sidebar/modules/notifications.tsx | 70 +++++++++++++++ src/services/calendar.ts | 0 src/widgets/notification.tsx | 26 ++++-- src/widgets/slider.tsx | 53 +++++++++++ 7 files changed, 364 insertions(+), 9 deletions(-) create mode 100644 src/modules/sidebar/dashboard.tsx create mode 100644 src/modules/sidebar/index.tsx create mode 100644 src/modules/sidebar/modules/hwresources.tsx create mode 100644 src/modules/sidebar/modules/notifications.tsx create mode 100644 src/services/calendar.ts create mode 100644 src/widgets/slider.tsx (limited to 'src') diff --git a/src/modules/sidebar/dashboard.tsx b/src/modules/sidebar/dashboard.tsx new file mode 100644 index 0000000..b7d03d0 --- /dev/null +++ b/src/modules/sidebar/dashboard.tsx @@ -0,0 +1,123 @@ +import Players from "@/services/players"; +import { osIcon, osId } from "@/utils/system"; +import Slider from "@/widgets/slider"; +import { bind, GLib, monitorFile, Variable } from "astal"; +import { Gtk } from "astal/gtk3"; +import AstalMpris from "gi://AstalMpris"; +import Notifications from "./modules/notifications"; + +const lengthStr = (length: number) => + `${Math.floor(length / 60)}:${Math.floor(length % 60) + .toString() + .padStart(2, "0")}`; + +const FaceFallback = () => ( +