chore: update ags and flakes

This commit is contained in:
matt1432 2023-10-14 13:54:45 -04:00
parent cd7aaebbee
commit 4cb39c4946
12 changed files with 34 additions and 45 deletions

View file

@ -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');

View file

@ -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') {

View file

@ -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'],
],

View file

@ -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') {

View file

@ -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') {

View file

@ -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');
}
}]],
}),

View file

@ -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,

View file

@ -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;
}]],

View file

@ -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);
}
},

View file

@ -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);
});
},

View file

@ -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: " 󰌾 ",

View file

@ -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": {