From e9eba2e2914e6c9aa01dd3d6267c969bcba3bb2f Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Wed, 2 Apr 2025 15:06:27 +1100
Subject: cleanup: remove popdown stuff
Popdowns were replaced with the sidebar
---
src/modules/popdowns/sideright.tsx | 146 -------------------------------------
1 file changed, 146 deletions(-)
delete mode 100644 src/modules/popdowns/sideright.tsx
(limited to 'src/modules/popdowns/sideright.tsx')
diff --git a/src/modules/popdowns/sideright.tsx b/src/modules/popdowns/sideright.tsx
deleted file mode 100644
index 5e873b3..0000000
--- a/src/modules/popdowns/sideright.tsx
+++ /dev/null
@@ -1,146 +0,0 @@
-import SWeather, { type WeatherData } from "@/services/weather";
-import { ellipsize } from "@/utils/strings";
-import { bindCurrentTime } from "@/utils/system";
-import { setupCustomTooltip, Calendar as WCal } from "@/utils/widgets";
-import PopupWindow from "@/widgets/popupwindow";
-import { bind, timeout } from "astal";
-import { Astal, Gtk, type Gdk } from "astal/gtk3";
-
-const getHoursFromUpdate = (data: WeatherData, hours: number) => {
- const updateTime = data.location.localtime_epoch;
- const updateHourStart = updateTime - (updateTime % 3600);
-
- let nextHour = new Date((updateHourStart + hours * 3600) * 1000).getHours();
- if (nextHour >= 24) nextHour -= 24;
-
- return nextHour;
-};
-
-const Time = () => (
-
-
-
-
-
-);
-
-const Calendar = () => (
-
- {
- self.connect("button-press-event", (_, event: Gdk.Event) => {
- if (event.get_button()[1] === Astal.MouseButton.MIDDLE) {
- const now = new Date();
- const child = self.get_child() as WCal | null;
- if (!child) return;
- child.select_month(now.getMonth(), now.getFullYear());
- }
- });
- }}
- >
- {
- const update = () =>
- timeout(0.1, () => {
- const now = new Date();
- if (self.month === now.getMonth() && self.year === now.getFullYear())
- self.day = now.getDate();
- else self.day = 0;
- });
- self.connect("month-changed", update);
- self.connect("next-month", update);
- self.connect("prev-month", update);
- self.connect("next-year", update);
- self.connect("prev-year", update);
- update();
- }}
- />
-
-
-);
-
-const Weather = () => {
- const weather = SWeather.get_default();
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
- {Array.from({ length: 4 }).map((_, i) => (
-
- {
- const hour = getHoursFromUpdate(r, i + 1);
- return `${hour % 12 || 12}${hour < 12 ? "AM" : "PM"}`;
- })}
- />
-
- weather.getIcon(weather.forecast[getHoursFromUpdate(r, i + 1)].condition.text)
- )}
- />
-
- weather.getTemp(weather.forecast[getHoursFromUpdate(r, i + 1)])
- )}
- />
-
- ))}
-
-
- );
-};
-
-export default () => (
-
-
-
-
-
-
-
-);
--
cgit v1.2.3-freya