refactor(ags): replace imports file with imports from ressource directly

This commit is contained in:
matt1432 2023-10-31 08:32:40 -04:00
parent 297e274c9a
commit 4ff3dbbc1c
43 changed files with 137 additions and 144 deletions

View file

@ -1,28 +1,29 @@
// Has to be a traditional function for 'this' scope // Has to be a traditional function for 'this' scope
Array.prototype.remove = function (el) { this.splice(this.indexOf(el), 1); }; Array.prototype.remove = function (el) { this.splice(this.indexOf(el), 1); };
import { App, Utils } from './imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import closeAll from './js/misc/closer.js'; import closeAll from './js/misc/closer.js';
globalThis.closeAll = closeAll; globalThis.closeAll = closeAll;
import Powermenu from './js/powermenu.js'; import Powermenu from './js/powermenu.js';
import * as Bar from './js/bar/main.js'; import * as Bar from './js/bar/main.js';
import NotifCenter from './js/notifications/center.js'; import NotifCenter from './js/notifications/center.js';
import NotifPopups from './js/notifications/popup.js'; import NotifPopups from './js/notifications/popup.js';
import Calendar from './js/date.js'; import Calendar from './js/date.js';
import QuickSettings from './js/quick-settings/main.js'; import QuickSettings from './js/quick-settings/main.js';
import Overview from './js/overview/main.js'; import Overview from './js/overview/main.js';
import AppLauncher from './js/applauncher/main.js'; import AppLauncher from './js/applauncher/main.js';
import * as Corners from './js/screen-corners.js'; import * as Corners from './js/screen-corners.js';
const scss = App.configDir + '/scss/main.scss'; const scss = App.configDir + '/scss/main.scss';
const css = App.configDir + '/style.css'; const css = App.configDir + '/style.css';
Utils.exec(`sassc ${scss} ${css}`); exec(`sassc ${scss} ${css}`);
Utils.execAsync(['bash', '-c', '$AGS_PATH/startup.sh']).catch(print); execAsync(['bash', '-c', '$AGS_PATH/startup.sh']).catch(print);
export default { export default {

View file

@ -1,19 +0,0 @@
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}`));
export const App = await require('app');
export const Widget = await require('widget');
export const Service = await require('service');
export const Variable = await require('variable');
export const Utils = await import(resource('utils'));
export const Applications = await service('applications');
export const Audio = await service('audio');
export const Battery = await service('battery');
export const Bluetooth = await service('bluetooth');
export const Hyprland = await service('hyprland');
export const Mpris = await service('mpris');
export const Network = await service('network');
export const Notifications = await service('notifications');
export const SystemTray = await service('systemtray');

View file

@ -1,5 +1,8 @@
import { App, Applications, Utils, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Label, Box, Icon, Button, Scrollable, Entry } = Widget; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js';
import { Label, Box, Icon, Button, Scrollable, Entry } from 'resource:///com/github/Aylur/ags/widget.js';
import { exec } from 'resource:///com/github/Aylur/ags/utils.js';
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';
import PopupWindow from '../misc/popup.js'; import PopupWindow from '../misc/popup.js';
@ -20,7 +23,7 @@ const AppItem = (app, window) => {
className: 'app', className: 'app',
connections: [['clicked', () => { connections: [['clicked', () => {
App.closeWindow(window); App.closeWindow(window);
Utils.exec(`hyprctl dispatch exec ${app.executable}`); exec(`hyprctl dispatch exec ${app.executable}`);
// TODO: focus on new client. Is this only needed after launch? // TODO: focus on new client. Is this only needed after launch?
++app.frequency; ++app.frequency;
}]], }]],

View file

@ -1,5 +1,5 @@
import { Audio, Widget } from '../../imports.js'; import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
const { Label, Box, Icon } = Widget; import { Label, Box, Icon } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,5 +1,5 @@
import { Battery, Widget } from '../../imports.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js';
const { Label, Icon, Stack, Box } = Widget; import { Label, Icon, Stack, Box } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';

View file

@ -1,5 +1,5 @@
import { Utils, Widget } from '../../imports.js'; import { ProgressBar, Overlay, Box } from 'resource:///com/github/Aylur/ags/widget.js';
const { ProgressBar, Overlay, Box } = Widget; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';
import Heart from './heart.js'; import Heart from './heart.js';
@ -11,7 +11,7 @@ export default () => Overlay({
className: 'toggle-off brightness', className: 'toggle-off brightness',
connections: [ connections: [
[200, self => { [200, self => {
Utils.execAsync('brightnessctl get').then(out => { execAsync('brightnessctl get').then(out => {
const br = out / 255; const br = out / 255;
if (br > 0.33) if (br > 0.33)
self.value = br; self.value = br;

View file

@ -1,5 +1,5 @@
import { App, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Box, Label } = Widget; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import GLib from 'gi://GLib'; import GLib from 'gi://GLib';
const { DateTime } = GLib; const { DateTime } = GLib;

View file

@ -1,5 +1,5 @@
import { Widget, Hyprland } from '../../imports.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
const { Label } = Widget; import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
export default () => Label({ export default () => Label({

View file

@ -1,5 +1,9 @@
import { App, Widget, Hyprland, Utils, Variable } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Box, EventBox, Overlay } = Widget; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
import { Widget, Box, EventBox, Overlay } from 'resource:///com/github/Aylur/ags/widget.js';
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
import { RoundedCorner } from '../screen-corners.js'; import { RoundedCorner } from '../screen-corners.js';
import Gesture from './gesture.js'; import Gesture from './gesture.js';
@ -40,7 +44,7 @@ export default props => Overlay({
BgGradient.visible = !Revealed.value; BgGradient.visible = !Revealed.value;
if (Revealed.value) { if (Revealed.value) {
Utils.timeout(2000, () => { timeout(2000, () => {
if (Revealed.value) if (Revealed.value)
self.revealChild = false; self.revealChild = false;
}); });
@ -55,7 +59,7 @@ export default props => Overlay({
onHoverLost: self => { onHoverLost: self => {
Hovering.value = false; Hovering.value = false;
if (Revealed.value) { if (Revealed.value) {
Utils.timeout(2000, () => { timeout(2000, () => {
if (!Hovering.value) { if (!Hovering.value) {
self.get_parent().get_parent().children[1].revealChild = true; self.get_parent().get_parent().children[1].revealChild = true;
self.get_parent().revealChild = false; self.get_parent().revealChild = false;
@ -70,7 +74,7 @@ export default props => Overlay({
Widget.Revealer({ Widget.Revealer({
connections: [[Revealed, self => { connections: [[Revealed, self => {
if (Revealed.value) { if (Revealed.value) {
Utils.timeout(2000, () => { timeout(2000, () => {
if (Revealed.value) if (Revealed.value)
self.revealChild = true; self.revealChild = true;
}); });

View file

@ -1,5 +1,5 @@
import { Widget, App } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { CenterBox, EventBox } = Widget; import { CenterBox, EventBox } from 'resource:///com/github/Aylur/ags/widget.js';
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';

View file

@ -1,6 +1,5 @@
import { Utils, Widget } from '../../imports.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box, Label } = Widget; import { subprocess, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
const { subprocess, execAsync } = Utils;
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,5 +1,6 @@
import { Hyprland, Utils, Widget } from '../../imports.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
const { Label, Box, Icon } = Widget; import { exec } from 'resource:///com/github/Aylur/ags/utils.js';
import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js';
const DEFAULT_KB = 'at-translated-set-2-keyboard'; const DEFAULT_KB = 'at-translated-set-2-keyboard';
@ -13,7 +14,7 @@ export default () => Box({
Label({ Label({
connections: [[Hyprland, (self, _n, layout) => { connections: [[Hyprland, (self, _n, layout) => {
if (!layout) { if (!layout) {
const obj = Utils.exec('hyprctl devices -j'); const obj = exec('hyprctl devices -j');
const keyboards = JSON.parse(obj)['keyboards']; const keyboards = JSON.parse(obj)['keyboards'];
const kb = keyboards.find(val => val.name === DEFAULT_KB); const kb = keyboards.find(val => val.name === DEFAULT_KB);

View file

@ -1,5 +1,4 @@
import { Widget } from '../../imports.js'; import { Window, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget.js';
const { Window, CenterBox, Box } = Widget;
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';
import CurrentWindow from './current-window.js'; import CurrentWindow from './current-window.js';

View file

@ -1,5 +1,6 @@
import { App, Notifications, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Box, Label, Icon } = Widget; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js';
import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,6 +1,5 @@
import { Utils, Widget } from '../../imports.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box, Label } = Widget; import { subprocess } from 'resource:///com/github/Aylur/ags/utils.js';
const { subprocess } = Utils;
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,5 +1,5 @@
import { Widget, App } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Box, Label } = Widget; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,5 +1,6 @@
import { SystemTray, Utils, Widget } from '../../imports.js'; import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js';
const { Box, Revealer, Icon, MenuItem } = Widget; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
import { Box, Icon, MenuItem, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';
@ -44,7 +45,7 @@ const SysTray = () => {
return; return;
widget._items.get(id).child.revealChild = false; widget._items.get(id).child.revealChild = false;
Utils.timeout(400, () => { timeout(400, () => {
widget._items.get(id).destroy(); widget._items.get(id).destroy();
widget._items.delete(id); widget._items.delete(id);
}); });

View file

@ -1,6 +1,5 @@
import { Utils, Widget } from '../../imports.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box, Label } = Widget; import { subprocess } from 'resource:///com/github/Aylur/ags/utils.js';
const { subprocess } = Utils;
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,6 +1,6 @@
import { Hyprland, Utils, Widget } from '../../imports.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
const { Box, Overlay, Revealer } = Widget; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
const { execAsync } = Utils; import { Box, Overlay, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,5 +1,4 @@
import { Widget } from '../imports.js'; import { Widget, Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box, Label } = Widget;
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';
import GLib from 'gi://GLib'; import GLib from 'gi://GLib';

View file

@ -1,5 +1,5 @@
import { Utils, Widget } from '../../imports.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
const { Box, Overlay, EventBox } = Widget; import { Box, EventBox, Overlay } from 'resource:///com/github/Aylur/ags/widget.js';
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';
@ -73,7 +73,7 @@ export default ({
opacity: 0; opacity: 0;
${playerBox._bgStyle}`); ${playerBox._bgStyle}`);
} }
Utils.timeout(500, () => { timeout(500, () => {
overlay.reorder_overlay(playerBox, 0); overlay.reorder_overlay(playerBox, 0);
playerBox.setStyle(playerBox._bgStyle); playerBox.setStyle(playerBox._bgStyle);
overlay._selected = overlay.list().at(-1); overlay._selected = overlay.list().at(-1);

View file

@ -1,6 +1,6 @@
import { Mpris, Utils, Widget } from '../../imports.js'; import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
const { Button, Icon, Label, Stack, Slider, CenterBox, Box } = Widget; import { Button, Icon, Label, Stack, Slider, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget.js';
const { execAsync, lookUpIcon } = Utils; import { execAsync, lookUpIcon } from 'resource:///com/github/Aylur/ags/utils.js';
import Gdk from 'gi://Gdk'; import Gdk from 'gi://Gdk';
const display = Gdk.Display.get_default(); const display = Gdk.Display.get_default();

View file

@ -1,5 +1,6 @@
import { Mpris, Variable, Widget } from '../../imports.js'; import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
const { Box, CenterBox } = Widget; import Variable from 'resource:///com/github/Aylur/ags/variable.js';
import { Box, CenterBox } from 'resource:///com/github/Aylur/ags/widget.js';
import * as mpris from './mpris.js'; import * as mpris from './mpris.js';
import PlayerGesture from './gesture.js'; import PlayerGesture from './gesture.js';

View file

@ -1,4 +1,4 @@
import { App } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
// TODO: find a way to not need this? // TODO: find a way to not need this?
import Pointers from '../../services/pointers.js'; import Pointers from '../../services/pointers.js';

View file

@ -1,4 +1,4 @@
import { Widget } from '../../imports.js'; import { Widget } from 'resource:///com/github/Aylur/ags/widget.js';
import Gdk from 'gi://Gdk'; import Gdk from 'gi://Gdk';
const display = Gdk.Display.get_default(); const display = Gdk.Display.get_default();

View file

@ -1,6 +1,5 @@
import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
import App from 'resource:///com/github/Aylur/ags/app.js'; import { Revealer, Box, Window } from 'resource:///com/github/Aylur/ags/widget.js';
const { Revealer, Box, Window } = Widget;
export default ({ export default ({

View file

@ -1,5 +1,4 @@
import { Widget } from '../../imports.js'; import { Box } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box } = Widget;
export default (size, { vertical = false } = {}) => { export default (size, { vertical = false } = {}) => {

View file

@ -1,6 +1,6 @@
import { Applications, Utils, Widget } from '../../imports.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js';
const { lookUpIcon, execAsync } = Utils; import { Box, Icon, Label, Button } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box, Icon, Label, Button } = Widget; import { lookUpIcon, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import GLib from 'gi://GLib'; import GLib from 'gi://GLib';

View file

@ -1,6 +1,7 @@
import { Notifications, App, Utils, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Button, Label, Box, Icon, Scrollable, Revealer } = Widget; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js';
const { timeout } = Utils; import { Button, Label, Box, Icon, Scrollable, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
import Notification from './base.js'; import Notification from './base.js';
import PopupWindow from '../misc/popup.js'; import PopupWindow from '../misc/popup.js';

View file

@ -1,5 +1,5 @@
import { Utils, Widget } from '../../imports.js'; import { Box, EventBox } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box, EventBox } = Widget; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';
import Gdk from 'gi://Gdk'; import Gdk from 'gi://Gdk';
@ -97,14 +97,14 @@ export default ({
margin-right: ${Number(maxOffset + endMargin)}px; margin-right: ${Number(maxOffset + endMargin)}px;
margin-bottom: 0px; margin-top: 0px; opacity: 0;`); margin-bottom: 0px; margin-top: 0px; opacity: 0;`);
Utils.timeout(500, () => { timeout(500, () => {
self.setStyle(`transition: margin 0.5s ease, opacity 0.5s ease; self.setStyle(`transition: margin 0.5s ease, opacity 0.5s ease;
margin-left: ${startMargin}px; margin-left: ${startMargin}px;
margin-right: ${startMargin}px; margin-right: ${startMargin}px;
margin-bottom: unset; margin-top: unset; margin-bottom: unset; margin-top: unset;
opacity: 1;`); opacity: 1;`);
}); });
Utils.timeout(1000, () => self._ready = true); timeout(1000, () => self._ready = true);
return; return;
} }
@ -114,18 +114,18 @@ export default ({
if (offset > 0) { if (offset > 0) {
self.setStyle(rightAnim1); self.setStyle(rightAnim1);
widget.sensitive = false; widget.sensitive = false;
Utils.timeout(500, () => { timeout(500, () => {
self.setStyle(rightAnim2); self.setStyle(rightAnim2);
}); });
} }
else { else {
self.setStyle(leftAnim1); self.setStyle(leftAnim1);
widget.sensitive = false; widget.sensitive = false;
Utils.timeout(500, () => { timeout(500, () => {
self.setStyle(leftAnim2); self.setStyle(leftAnim2);
}); });
} }
Utils.timeout(1000, () => { timeout(1000, () => {
command(); command();
self.destroy(); self.destroy();
}); });

View file

@ -1,5 +1,6 @@
import { Notifications, Utils, Widget } from '../../imports.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js';
const { Box, Revealer, Window } = Widget; import { Box, Revealer, Window } from 'resource:///com/github/Aylur/ags/widget.js';
import { interval, timeout } from 'resource:///com/github/Aylur/ags/utils.js';
import GLib from 'gi://GLib'; import GLib from 'gi://GLib';
@ -18,7 +19,7 @@ const Popups = () => Box({
if (box._map.size - 1 === 0) if (box._map.size - 1 === 0)
box.get_parent().reveal_child = false; box.get_parent().reveal_child = false;
Utils.timeout(200, () => { timeout(200, () => {
const notif = box._map.get(id); const notif = box._map.get(id);
if (notif.interval) { if (notif.interval) {
GLib.source_remove(notif.interval); GLib.source_remove(notif.interval);
@ -44,17 +45,17 @@ const Popups = () => Box({
box.children = Array.from(box._map.values()).reverse(); box.children = Array.from(box._map.values()).reverse();
Utils.timeout(10, () => { timeout(10, () => {
box.get_parent().revealChild = true; box.get_parent().revealChild = true;
}); });
box._map.get(id).interval = Utils.interval(4500, () => { box._map.get(id).interval = interval(4500, () => {
const notif = box._map.get(id); const notif = box._map.get(id);
if (!notif._hovered) { if (!notif._hovered) {
notif.child.setStyle(notif.child._leftAnim1); notif.child.setStyle(notif.child._leftAnim1);
if (notif.interval) { if (notif.interval) {
Utils.timeout(500, () => notif.destroy()); timeout(500, () => notif.destroy());
GLib.source_remove(notif.interval); GLib.source_remove(notif.interval);
notif.interval = undefined; notif.interval = undefined;
} }

View file

@ -1,6 +1,7 @@
import { App, Hyprland, Utils, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Icon, Revealer } = Widget; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
const { execAsync } = Utils; import { Icon, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import { WindowButton } from './dragndrop.js'; import { WindowButton } from './dragndrop.js';
import * as VARS from './variables.js'; import * as VARS from './variables.js';

View file

@ -1,5 +1,5 @@
import { Hyprland, Widget } from '../../imports.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
const { Box } = Widget; import { Box } from 'resource:///com/github/Aylur/ags/widget.js';
import * as VARS from './variables.js'; import * as VARS from './variables.js';
const DEFAULT_STYLE = ` const DEFAULT_STYLE = `

View file

@ -1,6 +1,6 @@
import { App, Utils, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { EventBox } = Widget; import { EventBox } from 'resource:///com/github/Aylur/ags/widget.js';
const { execAsync } = Utils; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';
import Gdk from 'gi://Gdk'; import Gdk from 'gi://Gdk';

View file

@ -1,5 +1,6 @@
import { App, Hyprland, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Box, Overlay } = Widget; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
import { Box, Overlay } from 'resource:///com/github/Aylur/ags/widget.js';
import PopupWindow from '../misc/popup.js'; import PopupWindow from '../misc/popup.js';
import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.js'; import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.js';

View file

@ -1,5 +1,5 @@
import { Hyprland, Widget } from '../../imports.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
const { Revealer, CenterBox, Box, EventBox, Label, Overlay } = Widget; import { Revealer, CenterBox, Box, EventBox, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';

View file

@ -1,5 +1,4 @@
import { Widget } from '../imports.js'; import { CenterBox, Label } from 'resource:///com/github/Aylur/ags/widget.js';
const { CenterBox, Label } = Widget;
import PopupWindow from './misc/popup.js'; import PopupWindow from './misc/popup.js';
import Button from './misc/cursorbox.js'; import Button from './misc/cursorbox.js';

View file

@ -1,6 +1,9 @@
import { Network, Bluetooth, Audio, App, Utils, Widget } from '../../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
const { Box, CenterBox, Label, Icon } = Widget; import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
const { execAsync } = Utils; import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js';
import Network from 'resource:///com/github/Aylur/ags/service/network.js';
import { Box, CenterBox, Label, Icon } from 'resource:///com/github/Aylur/ags/widget.js';
import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';

View file

@ -1,5 +1,4 @@
import { Widget } from '../../imports.js'; import { Box, Label, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
const { Box, Label, Revealer } = Widget;
import ButtonGrid from './button-grid.js'; import ButtonGrid from './button-grid.js';
import SliderBox from './slider-box.js'; import SliderBox from './slider-box.js';

View file

@ -1,6 +1,6 @@
import { Audio, Utils, Widget } from '../../imports.js'; import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
const { Box, Slider, Icon, EventBox } = Widget; import { Box, Slider, Icon, EventBox } from 'resource:///com/github/Aylur/ags/widget.js';
const { execAsync } = Utils; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
const items = { const items = {
101: 'audio-volume-overamplified-symbolic', 101: 'audio-volume-overamplified-symbolic',

View file

@ -1,8 +1,8 @@
import { Mpris, Widget } from '../../imports.js'; import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
const { Icon } = Widget; import { Icon } from 'resource:///com/github/Aylur/ags/widget.js';
import Gtk from 'gi://Gtk'; import Gtk from 'gi://Gtk';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../misc/cursorbox.js';
export default () => { export default () => {
const widget = EventBox({}); const widget = EventBox({});

View file

@ -1,5 +1,5 @@
import { Widget } from '../imports.js'; import { Widget } from 'resource:///com/github/Aylur/ags/widget.js';
const { Gtk } = imports.gi; import Gtk from 'gi://Gtk';
const Lang = imports.lang; const Lang = imports.lang;
export const RoundedCorner = (place, props) => Widget.Box({ export const RoundedCorner = (place, props) => Widget.Box({

View file

@ -1,4 +1,6 @@
import { App, Service, Utils } from '../imports.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
import Service from 'resource:///com/github/Aylur/ags/service.js';
import { execAsync, subprocess } from 'resource:///com/github/Aylur/ags/utils.js';
import GUdev from 'gi://GUdev'; import GUdev from 'gi://GUdev';
const UDEV_POINTERS = [ const UDEV_POINTERS = [
@ -85,7 +87,7 @@ class Pointers extends Service {
args.push(dev); args.push(dev);
}); });
this.proc = Utils.subprocess( this.proc = subprocess(
['libinput', 'debug-events', ...args], ['libinput', 'debug-events', ...args],
output => { output => {
if (output.includes('cancelled')) if (output.includes('cancelled'))
@ -145,10 +147,10 @@ class Pointers extends Service {
if (!toClose) if (!toClose)
return; return;
Utils.execAsync('hyprctl layers -j').then(layers => { execAsync('hyprctl layers -j').then(layers => {
layers = JSON.parse(layers); layers = JSON.parse(layers);
Utils.execAsync('hyprctl cursorpos -j').then(pos => { execAsync('hyprctl cursorpos -j').then(pos => {
pos = JSON.parse(pos); pos = JSON.parse(pos);
Object.values(layers).forEach(key => { Object.values(layers).forEach(key => {