From cf55e2613314e27243c60395e58665b9309280c8 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 22 Feb 2025 19:58:07 +1100 Subject: config: use config file Config file at ~/.config/caelestia/shell.json --- src/widgets/notification.tsx | 5 +++-- src/widgets/popupwindow.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/notification.tsx b/src/widgets/notification.tsx index 6f67b78..10f2076 100644 --- a/src/widgets/notification.tsx +++ b/src/widgets/notification.tsx @@ -20,7 +20,7 @@ const getTime = (time: number) => { const now = GLib.DateTime.new_now_local(); const todayDay = now.get_day_of_year(); - if (config.agoTime) { + if (config.agoTime.get()) { const diff = now.difference(messageTime) / 1e6; if (diff < 60) return "Now"; if (diff < 3600) { @@ -75,6 +75,7 @@ export default class Notification extends Widget.Box { super({ className: "notification" }); const time = Variable(getTime(notification.time)).poll(60000, () => getTime(notification.time)); + this.hook(config.agoTime, () => time.set(getTime(notification.time))); this.#revealer = ( 0 ? notification.expireTimeout diff --git a/src/widgets/popupwindow.ts b/src/widgets/popupwindow.ts index 2ba49fc..624e9a5 100644 --- a/src/widgets/popupwindow.ts +++ b/src/widgets/popupwindow.ts @@ -38,7 +38,7 @@ export default class PopupWindow extends Widget.Window { let marginLeft = 0; let marginTop = 0; - if (bar.vertical) { + if (bar.vertical.get()) { marginLeft = cx + (width - x); marginTop = cy + ((height - pHeight) / 2 - y); if (marginTop < 0) marginTop = 0; -- cgit v1.2.3-freya