From 4cb39c49462c3a8e6e9b1173be459db70f4e8d66 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 14 Oct 2023 13:54:45 -0400 Subject: [PATCH] chore: update ags and flakes --- config/ags/imports.js | 4 +-- config/ags/js/bar/clock.js | 3 +- config/ags/js/bar/gesture.js | 3 +- config/ags/js/bar/notif-button.js | 3 +- config/ags/js/bar/quick-settings.js | 3 +- config/ags/js/misc/closer.js | 7 ++-- config/ags/js/misc/popup.js | 3 +- config/ags/js/notifications/center.js | 3 +- config/ags/js/overview/clients.js | 8 ++--- config/ags/js/overview/dragndrop.js | 3 +- config/ags/js/quick-settings/button-grid.js | 3 +- nixos/flake.lock | 36 ++++++++++----------- 12 files changed, 34 insertions(+), 45 deletions(-) diff --git a/config/ags/imports.js b/config/ags/imports.js index 881b7069..09a4489e 100644 --- a/config/ags/imports.js +++ b/config/ags/imports.js @@ -1,10 +1,8 @@ const resource = file => `resource:///com/github/Aylur/ags/${file}.js`; const require = async file => (await import(resource(file))).default; -const service = async file => (await require(`service/${file}`)).instance; +const service = async file => (await require(`service/${file}`)); export const App = await require('app'); -App.connect = (...args) => App.instance.connect(...args); - export const Widget = await require('widget'); export const Service = await require('service'); export const Variable = await require('variable'); diff --git a/config/ags/js/bar/clock.js b/config/ags/js/bar/clock.js index 7dc038ff..6fdcf236 100644 --- a/config/ags/js/bar/clock.js +++ b/config/ags/js/bar/clock.js @@ -1,6 +1,5 @@ import { App, Widget } from '../../imports.js'; const { Box, Label } = Widget; -const { toggleWindow } = App; import GLib from 'gi://GLib'; const { DateTime } = GLib; @@ -24,7 +23,7 @@ const ClockModule = ({ export const Clock = EventBox({ className: 'toggle-off', - onPrimaryClickRelease: () => toggleWindow('calendar'), + onPrimaryClickRelease: () => App.toggleWindow('calendar'), connections: [ [App, (box, windowName, visible) => { if (windowName == 'calendar') { diff --git a/config/ags/js/bar/gesture.js b/config/ags/js/bar/gesture.js index 8141524b..ea6f060e 100644 --- a/config/ags/js/bar/gesture.js +++ b/config/ags/js/bar/gesture.js @@ -1,6 +1,5 @@ import { Widget, App } from '../../imports.js'; const { CenterBox, EventBox } = Widget; -const { openWindow } = App; import Gtk from 'gi://Gtk'; @@ -24,7 +23,7 @@ export const Gesture = ({ [gesture, _ => { const velocity = gesture.get_velocity()[1]; if (velocity < -100) - openWindow('quick-settings'); + App.openWindow('quick-settings'); }, 'update'], ], diff --git a/config/ags/js/bar/notif-button.js b/config/ags/js/bar/notif-button.js index ad0b9f09..1bd5b912 100644 --- a/config/ags/js/bar/notif-button.js +++ b/config/ags/js/bar/notif-button.js @@ -1,6 +1,5 @@ import { App, Notifications, Widget } from '../../imports.js'; const { Box, Label, Icon } = Widget; -const { toggleWindow } = App; import { Separator } from '../misc/separator.js'; import { EventBox } from '../misc/cursorbox.js'; @@ -8,7 +7,7 @@ import { EventBox } from '../misc/cursorbox.js'; export const NotifButton = EventBox({ className: 'toggle-off', - onPrimaryClickRelease: () => toggleWindow('notification-center'), + onPrimaryClickRelease: () => App.toggleWindow('notification-center'), connections: [ [App, (box, windowName, visible) => { if (windowName == 'notification-center') { diff --git a/config/ags/js/bar/quick-settings.js b/config/ags/js/bar/quick-settings.js index 1f9597cf..e039be06 100644 --- a/config/ags/js/bar/quick-settings.js +++ b/config/ags/js/bar/quick-settings.js @@ -1,13 +1,12 @@ import { Widget, App } from '../../imports.js'; const { Box, Label } = Widget; -const { toggleWindow } = App; import { EventBox } from '../misc/cursorbox.js'; export const QsToggle = EventBox({ className: 'toggle-off', - onPrimaryClickRelease: () => toggleWindow('quick-settings'), + onPrimaryClickRelease: () => App.toggleWindow('quick-settings'), connections: [ [App, (box, windowName, visible) => { if (windowName == 'quick-settings') { diff --git a/config/ags/js/misc/closer.js b/config/ags/js/misc/closer.js index 74782e46..c1bd8871 100644 --- a/config/ags/js/misc/closer.js +++ b/config/ags/js/misc/closer.js @@ -1,6 +1,5 @@ import { App, Widget } from '../../imports.js'; const { Window, EventBox } = Widget; -const { closeWindow } = App; const ALWAYS_OPEN = [ 'closer', @@ -13,9 +12,9 @@ const ALWAYS_OPEN = [ export const closeAll = () => { App.windows.forEach(w => { if (!ALWAYS_OPEN.some(window => window === w.name)) - closeWindow(w.name) + App.closeWindow(w.name) }); - closeWindow('closer'); + App.closeWindow('closer'); }; export const Closer = Window({ @@ -29,7 +28,7 @@ export const Closer = Window({ connections: [[App, (_b, _w, _v) => { if (!Array.from(App.windows).some(w => w[1].visible && !ALWAYS_OPEN.some(window => window === w[0]))) { - closeWindow('closer'); + App.closeWindow('closer'); } }]], }), diff --git a/config/ags/js/misc/popup.js b/config/ags/js/misc/popup.js index 138eb448..2cda285c 100644 --- a/config/ags/js/misc/popup.js +++ b/config/ags/js/misc/popup.js @@ -1,6 +1,5 @@ import { App, Widget } from '../../imports.js'; const { Revealer, Box, Window } = Widget; -const { openWindow } = App; export const PopupWindow = ({ @@ -25,7 +24,7 @@ export const PopupWindow = ({ revealer.reveal_child = visible; if (visible && name !== 'overview') - openWindow('closer'); + App.openWindow('closer'); } }]], child: child, diff --git a/config/ags/js/notifications/center.js b/config/ags/js/notifications/center.js index d784509d..5a5dc8c1 100644 --- a/config/ags/js/notifications/center.js +++ b/config/ags/js/notifications/center.js @@ -1,7 +1,6 @@ import { Notifications, App, Utils, Widget } from '../../imports.js'; const { Button, Label, Box, Icon, Scrollable, Revealer } = Widget; const { timeout } = Utils; -const { getWindow } = App; import Notification from './base.js'; import { EventBox } from '../misc/cursorbox.js'; @@ -26,7 +25,7 @@ const ClearButton = () => EventBox({ button._notifList = NotificationList; if (!button._popups) - button._popups = getWindow('notifications').child.children[0].child; + button._popups = App.getWindow('notifications').child.children[0].child; button.sensitive = Notifications.notifications.length > 0; }]], diff --git a/config/ags/js/overview/clients.js b/config/ags/js/overview/clients.js index b4e9a3d1..9a5efff2 100644 --- a/config/ags/js/overview/clients.js +++ b/config/ags/js/overview/clients.js @@ -1,6 +1,5 @@ import { App, Hyprland, Utils, Widget } from '../../imports.js'; const { Icon, Revealer } = Widget; -const { closeWindow } = App; const { execAsync } = Utils; import { WindowButton } from './dragndrop.js'; @@ -22,6 +21,7 @@ const Client = (client, active, clients) => { let wsId = client.workspace.id; let addr = `address:${client.address}`; + // FIXME: special workspaces not closing when in one and clicking on normal client return Revealer({ transition: 'crossfade', setup: rev => rev.revealChild = true, @@ -37,13 +37,13 @@ const Client = (client, active, clients) => { if (client.workspace.name === 'special') { execAsync(`hyprctl dispatch movetoworkspacesilent special:${wsId},${addr}`).then( execAsync(`hyprctl dispatch togglespecialworkspace ${wsId}`).then( - () => closeWindow('overview') + () => App.closeWindow('overview') ).catch(print) ).catch(print); } else { execAsync(`hyprctl dispatch togglespecialworkspace ${wsName}`).then( - () => closeWindow('overview') + () => App.closeWindow('overview') ).catch(print); } } @@ -56,7 +56,7 @@ const Client = (client, active, clients) => { execAsync(`hyprctl dispatch togglespecialworkspace ${wsName}`).catch(print); } execAsync(`hyprctl dispatch focuswindow ${addr}`).then( - () => closeWindow('overview') + () => App.closeWindow('overview') ).catch(print); } }, diff --git a/config/ags/js/overview/dragndrop.js b/config/ags/js/overview/dragndrop.js index 868e9827..47f37b92 100644 --- a/config/ags/js/overview/dragndrop.js +++ b/config/ags/js/overview/dragndrop.js @@ -1,7 +1,6 @@ import { App, Utils, Widget } from '../../imports.js'; const { EventBox } = Widget; const { execAsync } = Utils; -const { getWindow } = App; import Gtk from 'gi://Gtk'; import Gdk from 'gi://Gdk'; @@ -66,7 +65,7 @@ export const WindowButton = ({address, ...params} = {}) => Button({ button.connect('drag-end', () => { button.get_parent().destroy(); - let mainBox = getWindow('overview').child.children[0].child; + let mainBox = App.getWindow('overview').child.children[0].child; updateClients(mainBox); }); }, diff --git a/config/ags/js/quick-settings/button-grid.js b/config/ags/js/quick-settings/button-grid.js index 36a06425..402e8468 100644 --- a/config/ags/js/quick-settings/button-grid.js +++ b/config/ags/js/quick-settings/button-grid.js @@ -1,7 +1,6 @@ import { Network, Bluetooth, Audio, App, Utils, Widget } from '../../imports.js'; const { Box, CenterBox, Label, Icon } = Widget; const { execAsync } = Utils; -const { openWindow } = App; import { EventBox } from '../misc/cursorbox.js'; @@ -190,7 +189,7 @@ const SecondRow = Box({ GridButton({ command: () => execAsync(['bash', '-c', '$LOCK_PATH/lock.sh']).catch(print), - secondaryCommand: () => openWindow('powermenu'), + secondaryCommand: () => App.openWindow('powermenu'), icon: Label({ className: 'grid-label', label: " 󰌾 ", diff --git a/nixos/flake.lock b/nixos/flake.lock index a9ef8ea4..ce27f158 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1697201685, - "narHash": "sha256-mqXMJw/C/rHaybg/iLCmjZC0poLmeSgEsYfIaLXICAA=", + "lastModified": 1697299775, + "narHash": "sha256-pfeJlbbzlrgewThJ6ZX+8r57sr7Ao/QnmtciYqo91Lk=", "owner": "Aylur", "repo": "ags", - "rev": "24ebbf7fdfa6e6437f6011b987f70d4177bf4b34", + "rev": "c91274eeb7487f97d97233894f2f3cef970802c1", "type": "github" }, "original": { @@ -255,11 +255,11 @@ ] }, "locked": { - "lastModified": 1696726006, - "narHash": "sha256-EBFiAhnFyArOgAYdieXdyXRlNRq/7Jry1qm2ODWKSFc=", + "lastModified": 1697285486, + "narHash": "sha256-sTEYVrk1v2moQTMUHNZHpb3m76ssjLQKMpOX9t17ayo=", "owner": "horriblename", "repo": "hyprgrass", - "rev": "e35f613d074f08bf5fcbe7920e0dbe0dcd10b754", + "rev": "979b97604dd7c12886ae674371a0fea857483927", "type": "github" }, "original": { @@ -411,11 +411,11 @@ ] }, "locked": { - "lastModified": 1697156382, - "narHash": "sha256-Z3cpkVDVTaJ523k5pDE/GlOtWtWjKqHVDAcSO/zZLDw=", + "lastModified": 1697291731, + "narHash": "sha256-gaxlGXhexoiu6aOmNFPBs/eQojHZI7UUW6tM1lu6Kj4=", "owner": "nix-community", "repo": "nix-melt", - "rev": "7b1d3ca9e48500772103efbb6e52a89b8c844f0f", + "rev": "2c31bae5ac4217a5eb67995fa5287f0e65876a7b", "type": "github" }, "original": { @@ -483,11 +483,11 @@ ] }, "locked": { - "lastModified": 1697232062, - "narHash": "sha256-sPhiG+j3nMMbqRRbc2NyIjPEneuUDwsRfOoG7yuLlzw=", + "lastModified": 1697300259, + "narHash": "sha256-gmLtTy9kuLnw5MekDHY1Roc36kkEsLNTnKq8lSQkD3U=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "7dcd2934b3cf761471d5e9bab8d8fb0d50ab2bca", + "rev": "6b428305043afaf77119adb44dfea246c809e07f", "type": "github" }, "original": { @@ -530,11 +530,11 @@ }, "nur": { "locked": { - "lastModified": 1697242535, - "narHash": "sha256-AgpKoWPWtuUxKa4xVQfifqW//EEER86yhhfaI5Rph4E=", + "lastModified": 1697301536, + "narHash": "sha256-nmWsGINh3V7v/mjHEcCkkmw48ZjYlFvZY1a8awjKOmE=", "owner": "nix-community", "repo": "NUR", - "rev": "a2a01fead54d444bca45e26945cc681ef0c0b504", + "rev": "aa9f36732b013468c5b18e254f775194eac378c7", "type": "github" }, "original": { @@ -550,11 +550,11 @@ ] }, "locked": { - "lastModified": 1697210849, - "narHash": "sha256-ad3V4zJwBPGs0QdYa0QgGfoFXqB+oUHJJuNKcB9C0Iw=", + "lastModified": 1697292217, + "narHash": "sha256-bU6zk/tke1hsVuoVkKAALZv1vvOSkWVKvHu5478Kl/A=", "owner": "nix-community", "repo": "nurl", - "rev": "007c6bf6927b2de89bf78ad80634bf05705a2ef4", + "rev": "86c27bc7fa0522a5d26953f1f70662f9d192f3b2", "type": "github" }, "original": {