From b7d2d2bd4f79eb46c92b86e1b927e87f1835efa3 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 24 Jan 2024 20:18:38 +0700 Subject: [PATCH] ags: sync --- .config/ags/lib/animatedcircularprogress.js | 2 +- .config/ags/lib/notification.js | 15 ++++++----- .../ags/widgets/overview/overview_hyprland.js | 25 +++++++++---------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.config/ags/lib/animatedcircularprogress.js b/.config/ags/lib/animatedcircularprogress.js index 3101ab48..4a86eb42 100644 --- a/.config/ags/lib/animatedcircularprogress.js +++ b/.config/ags/lib/animatedcircularprogress.js @@ -86,7 +86,7 @@ export const AnimatedCircProg = ({ // area.css = `font-size: ${initFrom}px; transition: ${initAnimTime}ms linear;`; Utils.timeout(20, () => { area.css = `font-size: ${initTo}px;`; - }) + }, area) // const transitionDistance = initTo - initFrom; // const oneStep = initAnimTime / initAnimPoints; // area.css = ` diff --git a/.config/ags/lib/notification.js b/.config/ags/lib/notification.js index 10eee4a8..1189b62f 100644 --- a/.config/ags/lib/notification.js +++ b/.config/ags/lib/notification.js @@ -3,7 +3,6 @@ const { GLib, Gdk, Gtk } = imports.gi; import Widget from 'resource:///com/github/Aylur/ags/widget.js' import * as Utils from 'resource:///com/github/Aylur/ags/utils.js' -const { lookUpIcon, timeout } = Utils; const { Box, EventBox, Icon, Overlay, Label, Button, Revealer } = Widget; import { MaterialIcon } from "./materialicon.js"; import { setupCursorHover } from "./cursorhover.js"; @@ -38,9 +37,9 @@ const NotificationIcon = (notifObject) => { } let icon = 'NO_ICON'; - if (lookUpIcon(notifObject.appIcon)) + if (Utils.lookUpIcon(notifObject.appIcon)) icon = notifObject.appIcon; - if (lookUpIcon(notifObject.appEntry)) + if (Utils.lookUpIcon(notifObject.appEntry)) icon = notifObject.appEntry; return Box({ @@ -58,7 +57,7 @@ const NotificationIcon = (notifObject) => { const width = styleContext.get_property('min-width', Gtk.StateFlags.NORMAL); const height = styleContext.get_property('min-height', Gtk.StateFlags.NORMAL); self.size = Math.max(width * 0.7, height * 0.7, 1); // im too lazy to add another box lol - }), + }, self), }) : MaterialIcon(`${notifObject.urgency == 'critical' ? 'release_alert' : guessMessageType(notifObject.summary.toLowerCase())}`, 'hugerass', { @@ -84,11 +83,11 @@ export default ({ notificationBox.setCss(middleClickClose); Utils.timeout(200, () => { wholeThing.revealChild = false; - }); + }, wholeThing); Utils.timeout(400, () => { command(); wholeThing.destroy(); - }); + }, wholeThing); } const widget = EventBox({ onHover: (self) => { @@ -382,11 +381,11 @@ export default ({ } Utils.timeout(200, () => { wholeThing.revealChild = false - }); + }, wholeThing); Utils.timeout(400, () => { command(); wholeThing.destroy(); - }); + }, wholeThing); } else { self.setCss(`transition: margin 200ms cubic-bezier(0.05, 0.7, 0.1, 1), opacity 200ms cubic-bezier(0.05, 0.7, 0.1, 1); diff --git a/.config/ags/widgets/overview/overview_hyprland.js b/.config/ags/widgets/overview/overview_hyprland.js index 8f20c968..d49e871a 100644 --- a/.config/ags/widgets/overview/overview_hyprland.js +++ b/.config/ags/widgets/overview/overview_hyprland.js @@ -275,19 +275,18 @@ const OverviewRow = ({ startWorkspace, workspaces, windowName = 'overview' }) => }).catch(print); } }, - setup: (box) => { - box - // .hook(Hyprland, (box, name, data) => { // idk, does this make it lag occasionally? - // console.log(name) - // if (["changefloatingmode", "movewindow"].includes(name)) - // box.attribute.update(box); - // }, 'event') - .hook(Hyprland, (box) => box.attribute.update(box), 'client-added') - .hook(Hyprland, (box) => box.attribute.update(box), 'client-removed') - .hook(App, (box, name, visible) => { // Update on open - if (name == 'overview' && visible) box.attribute.update(box); - }) - }, + setup: (box) => box + // .hook(Hyprland, (box, name, data) => { // idk, does this make it lag occasionally? + // console.log(name) + // if (["changefloatingmode", "movewindow"].includes(name)) + // box.attribute.update(box); + // }, 'event') + .hook(Hyprland, (box) => box.attribute.update(box), 'client-added') + .hook(Hyprland, (box) => box.attribute.update(box), 'client-removed') + .hook(App, (box, name, visible) => { // Update on open + if (name == 'overview' && visible) box.attribute.update(box); + }) + , });