From 3a8cc994f2662bc18e1f33d997fcb429d9b21755 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 30 Jan 2024 11:29:07 -0500 Subject: [PATCH] refactor(ags): switch back to global imports --- modules/ags/config/.eslintrc.json | 7 +++++- modules/ags/config/js/utils.js | 3 +-- modules/ags/config/services/brightness.ts | 4 +--- modules/ags/config/services/pointers.ts | 7 ++---- modules/ags/config/services/tablet.ts | 6 ++--- modules/ags/config/services/touch-gestures.ts | 3 +-- modules/ags/config/ts/applauncher/app-item.ts | 6 ++--- modules/ags/config/ts/applauncher/main.ts | 7 +++--- modules/ags/config/ts/bar/binto.ts | 2 +- modules/ags/config/ts/bar/fullscreen.ts | 5 ++-- modules/ags/config/ts/bar/hovers/audio.ts | 5 ++-- modules/ags/config/ts/bar/hovers/bluetooth.ts | 5 ++-- .../ags/config/ts/bar/hovers/brightness.ts | 2 +- .../config/ts/bar/hovers/hover-revealer.ts | 2 +- .../config/ts/bar/hovers/keyboard-layout.ts | 5 ++-- modules/ags/config/ts/bar/hovers/network.ts | 5 ++-- modules/ags/config/ts/bar/items/battery.ts | 5 ++-- modules/ags/config/ts/bar/items/cal-opener.ts | 2 -- modules/ags/config/ts/bar/items/clock.ts | 2 +- .../ags/config/ts/bar/items/current-window.ts | 6 ++--- modules/ags/config/ts/bar/items/heart.ts | 4 +--- .../ags/config/ts/bar/items/notif-button.ts | 6 ++--- modules/ags/config/ts/bar/items/osk-toggle.ts | 2 +- .../ags/config/ts/bar/items/quick-settings.ts | 4 +--- modules/ags/config/ts/bar/items/systray.ts | 6 ++--- .../ags/config/ts/bar/items/tablet-toggle.ts | 2 +- modules/ags/config/ts/bar/items/workspaces.ts | 6 ++--- modules/ags/config/ts/bar/wim.ts | 2 +- modules/ags/config/ts/corners/main.ts | 2 +- .../ags/config/ts/corners/screen-corners.ts | 2 +- modules/ags/config/ts/date.ts | 2 +- modules/ags/config/ts/media-player/gesture.ts | 4 ++-- modules/ags/config/ts/media-player/mpris.ts | 6 ++--- modules/ags/config/ts/media-player/player.ts | 5 ++-- modules/ags/config/ts/misc/audio-icons.ts | 3 +-- modules/ags/config/ts/misc/background-fade.ts | 2 +- modules/ags/config/ts/misc/closer.ts | 2 -- modules/ags/config/ts/misc/cursorbox.ts | 7 +++--- modules/ags/config/ts/misc/persist.ts | 2 +- modules/ags/config/ts/misc/popup.ts | 23 +++++++++---------- modules/ags/config/ts/misc/separator.ts | 2 +- modules/ags/config/ts/notifications/base.ts | 11 ++++----- modules/ags/config/ts/notifications/binto.ts | 2 +- modules/ags/config/ts/notifications/center.ts | 7 +++--- .../ags/config/ts/notifications/gesture.ts | 6 ++--- modules/ags/config/ts/notifications/popup.ts | 8 +++---- modules/ags/config/ts/notifications/wim.ts | 4 +++- .../config/ts/on-screen-keyboard/gesture.ts | 4 ++-- .../config/ts/on-screen-keyboard/keyboard.ts | 2 +- .../ags/config/ts/on-screen-keyboard/keys.ts | 5 ++-- .../ags/config/ts/on-screen-keyboard/main.ts | 4 ++-- modules/ags/config/ts/osd/ctor.ts | 2 +- modules/ags/config/ts/osd/main.ts | 6 ++--- modules/ags/config/ts/osd/osds.ts | 6 ++--- modules/ags/config/ts/overview/clients.ts | 9 ++++---- .../config/ts/overview/current-workspace.ts | 5 ++-- modules/ags/config/ts/overview/dragndrop.ts | 4 ++-- modules/ags/config/ts/overview/main.ts | 5 ++-- modules/ags/config/ts/overview/workspaces.ts | 4 ++-- modules/ags/config/ts/powermenu.ts | 6 ++--- .../ags/config/ts/quick-settings/bluetooth.ts | 5 ++-- .../config/ts/quick-settings/button-grid.ts | 10 ++++---- modules/ags/config/ts/quick-settings/main.ts | 2 +- .../ags/config/ts/quick-settings/network.ts | 8 +++---- .../config/ts/quick-settings/slider-box.ts | 4 ++-- .../config/ts/quick-settings/toggle-button.ts | 5 ++-- modules/ags/config/ts/setup.ts | 5 ++-- 67 files changed, 143 insertions(+), 179 deletions(-) diff --git a/modules/ags/config/.eslintrc.json b/modules/ags/config/.eslintrc.json index 2871a3ed..ec0212ba 100644 --- a/modules/ags/config/.eslintrc.json +++ b/modules/ags/config/.eslintrc.json @@ -140,6 +140,11 @@ "console": "readonly", "logError": "readonly", "setTimeout": "readonly", - "setInterval": "readonly" + "setInterval": "readonly", + "Widget": "readonly", + "Service": "readonly", + "Variable": "readonly", + "Utils": "readonly", + "App": "readonly" } } diff --git a/modules/ags/config/js/utils.js b/modules/ags/config/js/utils.js index 90a0e7e4..2a5be44e 100644 --- a/modules/ags/config/js/utils.js +++ b/modules/ags/config/js/utils.js @@ -1,5 +1,4 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import { execAsync, monitorFile } from 'resource:///com/github/Aylur/ags/utils.js'; +const { execAsync, monitorFile } = Utils; /** @param {string} host */ diff --git a/modules/ags/config/services/brightness.ts b/modules/ags/config/services/brightness.ts index 37ba0ae6..a77eb1df 100644 --- a/modules/ags/config/services/brightness.ts +++ b/modules/ags/config/services/brightness.ts @@ -1,6 +1,4 @@ -import Service from 'resource:///com/github/Aylur/ags/service.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; -import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; +const { exec, execAsync } = Utils; const KBD = 'tpacpi::kbd_backlight'; const CAPS = 'input0::capslock'; diff --git a/modules/ags/config/services/pointers.ts b/modules/ags/config/services/pointers.ts index ca00b22f..a89392fc 100644 --- a/modules/ags/config/services/pointers.ts +++ b/modules/ags/config/services/pointers.ts @@ -1,8 +1,5 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; -import Service from 'resource:///com/github/Aylur/ags/service.js'; - -import { subprocess } from 'resource:///com/github/Aylur/ags/utils.js'; +const Hyprland = await Service.import('hyprland'); +const { subprocess } = Utils; const ON_RELEASE_TRIGGERS = [ 'released', diff --git a/modules/ags/config/services/tablet.ts b/modules/ags/config/services/tablet.ts index 4f1f0a50..497e7d19 100644 --- a/modules/ags/config/services/tablet.ts +++ b/modules/ags/config/services/tablet.ts @@ -1,7 +1,7 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; -import Service from 'resource:///com/github/Aylur/ags/service.js'; +const Hyprland = await Service.import('hyprland'); +const { execAsync, subprocess } = Utils; + import TouchGestures from './touch-gestures.ts'; -import { execAsync, subprocess } from 'resource:///com/github/Aylur/ags/utils.js'; const ROTATION_MAP = { 'normal': 0, diff --git a/modules/ags/config/services/touch-gestures.ts b/modules/ags/config/services/touch-gestures.ts index ae0e76dd..5b0b3935 100644 --- a/modules/ags/config/services/touch-gestures.ts +++ b/modules/ags/config/services/touch-gestures.ts @@ -1,5 +1,4 @@ -import Service from 'resource:///com/github/Aylur/ags/service.js'; -import { subprocess } from 'resource:///com/github/Aylur/ags/utils.js'; +const { subprocess } = Utils; const SCREEN = '/dev/input/by-path/platform-AMDI0010\:00-event'; diff --git a/modules/ags/config/ts/applauncher/app-item.ts b/modules/ags/config/ts/applauncher/app-item.ts index 19337e47..875e13b4 100644 --- a/modules/ags/config/ts/applauncher/app-item.ts +++ b/modules/ags/config/ts/applauncher/app-item.ts @@ -1,7 +1,5 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; - -import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import { lookUpIcon } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box, Icon, Label } = Widget; +const { lookUpIcon } = Utils; import CursorBox from '../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/applauncher/main.ts b/modules/ags/config/ts/applauncher/main.ts index 15db7e2a..6f8792da 100644 --- a/modules/ags/config/ts/applauncher/main.ts +++ b/modules/ags/config/ts/applauncher/main.ts @@ -1,10 +1,9 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; +const Applications = await Service.import('applications'); +const { Box, Entry, Icon, Label, ListBox, Revealer, Scrollable } = Widget; + // @ts-expect-error find cleaner way to import this import { Fzf, FzfResultItem } from 'file:///home/matt/.nix/modules/ags/config/node_modules/fzf/dist/fzf.es.js'; -import { Box, Entry, Icon, Label, ListBox, Revealer, Scrollable } from 'resource:///com/github/Aylur/ags/widget.js'; - import PopupWindow from '../misc/popup.ts'; import AppItem from './app-item.ts'; diff --git a/modules/ags/config/ts/bar/binto.ts b/modules/ags/config/ts/bar/binto.ts index 8cd47f57..bff8a6d3 100644 --- a/modules/ags/config/ts/bar/binto.ts +++ b/modules/ags/config/ts/bar/binto.ts @@ -1,4 +1,4 @@ -import { Box, CenterBox, Window } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, CenterBox, Window } = Widget; import SysTray from './items/systray.ts'; import Separator from '../misc/separator.ts'; diff --git a/modules/ags/config/ts/bar/fullscreen.ts b/modules/ags/config/ts/bar/fullscreen.ts index 1d4e8435..c1831d58 100644 --- a/modules/ags/config/ts/bar/fullscreen.ts +++ b/modules/ags/config/ts/bar/fullscreen.ts @@ -1,7 +1,6 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const Hyprland = await Service.import('hyprland'); -import { Box, EventBox, Revealer, Window } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, EventBox, Revealer, Window } = Widget; // Types import { Variable as Var } from 'types/variable'; diff --git a/modules/ags/config/ts/bar/hovers/audio.ts b/modules/ags/config/ts/bar/hovers/audio.ts index 21f13bb1..cffa56a4 100644 --- a/modules/ags/config/ts/bar/hovers/audio.ts +++ b/modules/ags/config/ts/bar/hovers/audio.ts @@ -1,6 +1,5 @@ -import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; - -import { Label, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; +const Audio = await Service.import('audio'); +const { Label, Icon } = Widget; import { SpeakerIcon } from '../../misc/audio-icons.ts'; import HoverRevealer from './hover-revealer.ts'; diff --git a/modules/ags/config/ts/bar/hovers/bluetooth.ts b/modules/ags/config/ts/bar/hovers/bluetooth.ts index fe689d58..fe6a5a1a 100644 --- a/modules/ags/config/ts/bar/hovers/bluetooth.ts +++ b/modules/ags/config/ts/bar/hovers/bluetooth.ts @@ -1,6 +1,5 @@ -import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; - -import { Label, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; +const Bluetooth = await Service.import('bluetooth'); +const { Label, Icon } = Widget; import HoverRevealer from './hover-revealer.ts'; diff --git a/modules/ags/config/ts/bar/hovers/brightness.ts b/modules/ags/config/ts/bar/hovers/brightness.ts index c1770293..74b936db 100644 --- a/modules/ags/config/ts/bar/hovers/brightness.ts +++ b/modules/ags/config/ts/bar/hovers/brightness.ts @@ -1,4 +1,4 @@ -import { Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Icon, Label } = Widget; import Brightness from '../../../services/brightness.ts'; import HoverRevealer from './hover-revealer.ts'; diff --git a/modules/ags/config/ts/bar/hovers/hover-revealer.ts b/modules/ags/config/ts/bar/hovers/hover-revealer.ts index 7c1597b5..b01102e1 100644 --- a/modules/ags/config/ts/bar/hovers/hover-revealer.ts +++ b/modules/ags/config/ts/bar/hovers/hover-revealer.ts @@ -1,4 +1,4 @@ -import { Box, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Revealer } = Widget; import Separator from '../../misc/separator.ts'; import CursorBox from '../../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/bar/hovers/keyboard-layout.ts b/modules/ags/config/ts/bar/hovers/keyboard-layout.ts index c950ed87..201bf990 100644 --- a/modules/ags/config/ts/bar/hovers/keyboard-layout.ts +++ b/modules/ags/config/ts/bar/hovers/keyboard-layout.ts @@ -1,6 +1,5 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; - -import { Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const Hyprland = await Service.import('hyprland'); +const { Icon, Label } = Widget; import HoverRevealer from './hover-revealer.ts'; diff --git a/modules/ags/config/ts/bar/hovers/network.ts b/modules/ags/config/ts/bar/hovers/network.ts index 778e2435..0280a8ff 100644 --- a/modules/ags/config/ts/bar/hovers/network.ts +++ b/modules/ags/config/ts/bar/hovers/network.ts @@ -1,6 +1,5 @@ -import Network from 'resource:///com/github/Aylur/ags/service/network.js'; - -import { Label, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; +const Network = await Service.import('network'); +const { Label, Icon } = Widget; import HoverRevealer from './hover-revealer.ts'; diff --git a/modules/ags/config/ts/bar/items/battery.ts b/modules/ags/config/ts/bar/items/battery.ts index 7a4e1685..d2662313 100644 --- a/modules/ags/config/ts/bar/items/battery.ts +++ b/modules/ags/config/ts/bar/items/battery.ts @@ -1,6 +1,5 @@ -import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; - -import { Label, Icon, Box } from 'resource:///com/github/Aylur/ags/widget.js'; +const Battery = await Service.import('battery'); +const { Label, Icon, Box } = Widget; import Separator from '../../misc/separator.ts'; diff --git a/modules/ags/config/ts/bar/items/cal-opener.ts b/modules/ags/config/ts/bar/items/cal-opener.ts index fefcef08..ab18300d 100644 --- a/modules/ags/config/ts/bar/items/cal-opener.ts +++ b/modules/ags/config/ts/bar/items/cal-opener.ts @@ -1,5 +1,3 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; - import CursorBox from '../../misc/cursorbox.ts'; import Clock from './clock'; diff --git a/modules/ags/config/ts/bar/items/clock.ts b/modules/ags/config/ts/bar/items/clock.ts index 84bf8d5a..296f4807 100644 --- a/modules/ags/config/ts/bar/items/clock.ts +++ b/modules/ags/config/ts/bar/items/clock.ts @@ -1,4 +1,4 @@ -import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Label } = Widget; const { new_now_local } = imports.gi.GLib.DateTime; diff --git a/modules/ags/config/ts/bar/items/current-window.ts b/modules/ags/config/ts/bar/items/current-window.ts index eec09727..1e22d66b 100644 --- a/modules/ags/config/ts/bar/items/current-window.ts +++ b/modules/ags/config/ts/bar/items/current-window.ts @@ -1,7 +1,7 @@ -import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Applications = await Service.import('applications'); +const Hyprland = await Service.import('hyprland'); +const { Box, Icon, Label } = Widget; -import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import Separator from '../../misc/separator.ts'; const SPACING = 8; diff --git a/modules/ags/config/ts/bar/items/heart.ts b/modules/ags/config/ts/bar/items/heart.ts index 3a0b7ca0..3bca3d36 100644 --- a/modules/ags/config/ts/bar/items/heart.ts +++ b/modules/ags/config/ts/bar/items/heart.ts @@ -1,6 +1,4 @@ -import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; - -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const { Label } = Widget; import CursorBox from '../../misc/cursorbox.ts'; import Persist from '../../misc/persist.ts'; diff --git a/modules/ags/config/ts/bar/items/notif-button.ts b/modules/ags/config/ts/bar/items/notif-button.ts index 5a438dc9..69418846 100644 --- a/modules/ags/config/ts/bar/items/notif-button.ts +++ b/modules/ags/config/ts/bar/items/notif-button.ts @@ -1,7 +1,5 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; - -import { Box, CenterBox, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const Notifications = await Service.import('notifications'); +const { Box, CenterBox, Icon, Label } = Widget; import CursorBox from '../../misc/cursorbox.ts'; import Separator from '../../misc/separator.ts'; diff --git a/modules/ags/config/ts/bar/items/osk-toggle.ts b/modules/ags/config/ts/bar/items/osk-toggle.ts index 7571fef8..76f8383b 100644 --- a/modules/ags/config/ts/bar/items/osk-toggle.ts +++ b/modules/ags/config/ts/bar/items/osk-toggle.ts @@ -1,4 +1,4 @@ -import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Label } = Widget; import Tablet from '../../../services/tablet.ts'; import CursorBox from '../../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/bar/items/quick-settings.ts b/modules/ags/config/ts/bar/items/quick-settings.ts index 74fb9e1d..681967b2 100644 --- a/modules/ags/config/ts/bar/items/quick-settings.ts +++ b/modules/ags/config/ts/bar/items/quick-settings.ts @@ -1,6 +1,4 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; - -import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Label } = Widget; import Audio from '../hovers/audio.ts'; import Bluetooth from '../hovers/bluetooth.ts'; diff --git a/modules/ags/config/ts/bar/items/systray.ts b/modules/ags/config/ts/bar/items/systray.ts index 8e740e53..aab0b6d5 100644 --- a/modules/ags/config/ts/bar/items/systray.ts +++ b/modules/ags/config/ts/bar/items/systray.ts @@ -1,7 +1,7 @@ -import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js'; +const SystemTray = await Service.import('systemtray'); -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; -import { Box, Icon, MenuItem, MenuBar, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; +const { timeout } = Utils; +const { Box, Icon, MenuItem, MenuBar, Revealer } = Widget; import Separator from '../../misc/separator.ts'; diff --git a/modules/ags/config/ts/bar/items/tablet-toggle.ts b/modules/ags/config/ts/bar/items/tablet-toggle.ts index c81908d3..80d67957 100644 --- a/modules/ags/config/ts/bar/items/tablet-toggle.ts +++ b/modules/ags/config/ts/bar/items/tablet-toggle.ts @@ -1,4 +1,4 @@ -import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Label } = Widget; import Tablet from '../../../services/tablet.ts'; import CursorBox from '../../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/bar/items/workspaces.ts b/modules/ags/config/ts/bar/items/workspaces.ts index 86861529..b51508be 100644 --- a/modules/ags/config/ts/bar/items/workspaces.ts +++ b/modules/ags/config/ts/bar/items/workspaces.ts @@ -1,7 +1,7 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; -import { Box, Overlay, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; +const { timeout } = Utils; +const { Box, Overlay, Revealer } = Widget; import CursorBox from '../../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/bar/wim.ts b/modules/ags/config/ts/bar/wim.ts index d22669ba..f1b81f59 100644 --- a/modules/ags/config/ts/bar/wim.ts +++ b/modules/ags/config/ts/bar/wim.ts @@ -1,4 +1,4 @@ -import { Window, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Window, CenterBox, Box } = Widget; import Separator from '../misc/separator.ts'; diff --git a/modules/ags/config/ts/corners/main.ts b/modules/ags/config/ts/corners/main.ts index 53cc0382..921e4c74 100644 --- a/modules/ags/config/ts/corners/main.ts +++ b/modules/ags/config/ts/corners/main.ts @@ -1,4 +1,4 @@ -import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Window } = Widget; import RoundedCorner from './screen-corners.ts'; diff --git a/modules/ags/config/ts/corners/screen-corners.ts b/modules/ags/config/ts/corners/screen-corners.ts index 98b02686..16ed64e5 100644 --- a/modules/ags/config/ts/corners/screen-corners.ts +++ b/modules/ags/config/ts/corners/screen-corners.ts @@ -1,4 +1,4 @@ -import { Box, DrawingArea } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, DrawingArea } = Widget; const { Gtk } = imports.gi; diff --git a/modules/ags/config/ts/date.ts b/modules/ags/config/ts/date.ts index 9008f977..23f4ff15 100644 --- a/modules/ags/config/ts/date.ts +++ b/modules/ags/config/ts/date.ts @@ -1,4 +1,4 @@ -import { Box, Calendar, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Calendar, Label } = Widget; const { new_now_local } = imports.gi.GLib.DateTime; diff --git a/modules/ags/config/ts/media-player/gesture.ts b/modules/ags/config/ts/media-player/gesture.ts index 38b89514..b4ad7271 100644 --- a/modules/ags/config/ts/media-player/gesture.ts +++ b/modules/ags/config/ts/media-player/gesture.ts @@ -1,5 +1,5 @@ -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; -import { Box, EventBox, Overlay } from 'resource:///com/github/Aylur/ags/widget.js'; +const { timeout } = Utils; +const { Box, EventBox, Overlay } = Widget; const { Gtk } = imports.gi; diff --git a/modules/ags/config/ts/media-player/mpris.ts b/modules/ags/config/ts/media-player/mpris.ts index 512f938a..8be5784b 100644 --- a/modules/ags/config/ts/media-player/mpris.ts +++ b/modules/ags/config/ts/media-player/mpris.ts @@ -1,7 +1,7 @@ -import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; +const Mpris = await Service.import('mpris'); -import { Button, Icon, Label, Stack, Slider, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget.js'; -import { execAsync, lookUpIcon, readFileAsync } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Button, Icon, Label, Stack, Slider, CenterBox, Box } = Widget; +const { execAsync, lookUpIcon, readFileAsync } = Utils; import Separator from '../misc/separator.ts'; import CursorBox from '../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/media-player/player.ts b/modules/ags/config/ts/media-player/player.ts index 77424fb4..500f44e7 100644 --- a/modules/ags/config/ts/media-player/player.ts +++ b/modules/ags/config/ts/media-player/player.ts @@ -1,7 +1,6 @@ -import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const Mpris = await Service.import('mpris'); -import { Box, CenterBox } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, CenterBox } = Widget; import * as mpris from './mpris.ts'; import PlayerGesture from './gesture.ts'; diff --git a/modules/ags/config/ts/misc/audio-icons.ts b/modules/ags/config/ts/misc/audio-icons.ts index 52cd774a..af07c368 100644 --- a/modules/ags/config/ts/misc/audio-icons.ts +++ b/modules/ags/config/ts/misc/audio-icons.ts @@ -1,5 +1,4 @@ -import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const Audio = await Service.import('audio'); const speakerIcons = { 101: 'audio-volume-overamplified-symbolic', diff --git a/modules/ags/config/ts/misc/background-fade.ts b/modules/ags/config/ts/misc/background-fade.ts index 052ff4a5..a990cdec 100644 --- a/modules/ags/config/ts/misc/background-fade.ts +++ b/modules/ags/config/ts/misc/background-fade.ts @@ -1,4 +1,4 @@ -import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Window } = Widget; export default () => Window({ diff --git a/modules/ags/config/ts/misc/closer.ts b/modules/ags/config/ts/misc/closer.ts index 6eb3172e..e0520468 100644 --- a/modules/ags/config/ts/misc/closer.ts +++ b/modules/ags/config/ts/misc/closer.ts @@ -1,5 +1,3 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; - // Types import { PopupWindow } from 'global-types'; diff --git a/modules/ags/config/ts/misc/cursorbox.ts b/modules/ags/config/ts/misc/cursorbox.ts index a55c4918..536b4fc6 100644 --- a/modules/ags/config/ts/misc/cursorbox.ts +++ b/modules/ags/config/ts/misc/cursorbox.ts @@ -1,9 +1,8 @@ -import { register } from 'resource:///com/github/Aylur/ags/widget.js'; import Gtk from 'gi://Gtk?version=3.0'; import Gdk from 'gi://Gdk?version=3.0'; // Types -import { BaseProps, Widget } from 'types/widgets/widget'; +import { BaseProps, Widget as AgsWidget } from 'types/widgets/widget'; type EventHandler = (self: Self, event: Gdk.Event) => boolean | unknown; export type CursorBoxProps< @@ -28,12 +27,12 @@ export type CursorBoxProps< }, Attr>; // eslint-disable-next-line @typescript-eslint/no-unused-vars -export interface CursorBox extends Widget { } +export interface CursorBox extends AgsWidget { } export class CursorBox extends Gtk.EventBox { static { - register(this, { + Widget.register(this, { properties: { 'on-clicked': ['jsobject', 'rw'], diff --git a/modules/ags/config/ts/misc/persist.ts b/modules/ags/config/ts/misc/persist.ts index 2d2969a2..b6d7267a 100644 --- a/modules/ags/config/ts/misc/persist.ts +++ b/modules/ags/config/ts/misc/persist.ts @@ -1,4 +1,4 @@ -import { execAsync, readFileAsync, timeout } from 'resource:///com/github/Aylur/ags/utils.js'; +const { execAsync, readFileAsync, timeout } = Utils; const { get_home_dir } = imports.gi.GLib; import GObject from 'types/@girs/gobject-2.0/gobject-2.0'; diff --git a/modules/ags/config/ts/misc/popup.ts b/modules/ags/config/ts/misc/popup.ts index a075bc4c..6de9311b 100644 --- a/modules/ags/config/ts/misc/popup.ts +++ b/modules/ags/config/ts/misc/popup.ts @@ -1,13 +1,12 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +import Gtk from 'gi://Gtk?version=3.0'; +const Hyprland = await Service.import('hyprland'); -import { Box, Overlay, register } from 'resource:///com/github/Aylur/ags/widget.js'; -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box, Overlay, register } = Widget; + +const { timeout } = Utils; // Types import { Window } from 'resource:///com/github/Aylur/ags/widgets/window.js'; -import { Allocation, Widget } from 'types/@girs/gtk-3.0/gtk-3.0.cjs'; import { Variable as Var } from 'types/variable'; import { @@ -23,7 +22,7 @@ import { export class PopupWindow< - Child extends Widget, + Child extends Gtk.Widget, Attr, > extends Window { static { @@ -34,7 +33,7 @@ export class PopupWindow< }); } - #content: Var; + #content: Var; #antiClip: Var; #needsAnticlipping: boolean; #close_on_unfocus: CloseType; @@ -43,7 +42,7 @@ export class PopupWindow< return this.#content.value; } - set content(value: Widget) { + set content(value: Gtk.Widget) { this.#content.value = value; this.child.show_all(); } @@ -76,7 +75,7 @@ export class PopupWindow< }: PopupWindowProps) { const needsAnticlipping = bezier.match(/-[0-9]/) !== null && transition !== 'crossfade'; - const contentVar = Variable(Box() as Widget); + const contentVar = Variable(Box() as Gtk.Widget); const antiClip = Variable(false); if (content) { @@ -364,7 +363,7 @@ export class PopupWindow< } set_x_pos( - alloc: Allocation, + alloc: Gtk.Allocation, side = 'right' as 'left' | 'right', ) { const width = this.get_display() @@ -387,6 +386,6 @@ export class PopupWindow< } } -export default ( +export default ( props: PopupWindowProps, ) => new PopupWindow(props); diff --git a/modules/ags/config/ts/misc/separator.ts b/modules/ags/config/ts/misc/separator.ts index 60dfdbd3..cbdba272 100644 --- a/modules/ags/config/ts/misc/separator.ts +++ b/modules/ags/config/ts/misc/separator.ts @@ -1,4 +1,4 @@ -import { Box } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box } = Widget; export default (size: number, { diff --git a/modules/ags/config/ts/notifications/base.ts b/modules/ags/config/ts/notifications/base.ts index 886fcccb..c0ad992b 100644 --- a/modules/ags/config/ts/notifications/base.ts +++ b/modules/ags/config/ts/notifications/base.ts @@ -1,10 +1,9 @@ -import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const Applications = await Service.import('applications'); +const Hyprland = await Service.import('hyprland'); +const Notifications = await Service.import('notifications'); -import { Box, Icon, Label, Button } from 'resource:///com/github/Aylur/ags/widget.js'; -import { lookUpIcon } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box, Icon, Label, Button } = Widget; +const { lookUpIcon } = Utils; const { GLib } = imports.gi; diff --git a/modules/ags/config/ts/notifications/binto.ts b/modules/ags/config/ts/notifications/binto.ts index d877830b..4eabe753 100644 --- a/modules/ags/config/ts/notifications/binto.ts +++ b/modules/ags/config/ts/notifications/binto.ts @@ -1,4 +1,4 @@ -import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Window } = Widget; import NotifCenterWidget from './center.ts'; import PopUpsWidget from './popup.ts'; diff --git a/modules/ags/config/ts/notifications/center.ts b/modules/ags/config/ts/notifications/center.ts index fde7809c..a641e188 100644 --- a/modules/ags/config/ts/notifications/center.ts +++ b/modules/ags/config/ts/notifications/center.ts @@ -1,8 +1,7 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; +const Notifications = await Service.import('notifications'); -import { Label, Box, Icon, Scrollable, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Label, Box, Icon, Scrollable, Revealer } = Widget; +const { timeout } = Utils; import { Notification, HasNotifs } from './base.ts'; import CursorBox from '../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/notifications/gesture.ts b/modules/ags/config/ts/notifications/gesture.ts index ab5f315d..6d11909d 100644 --- a/modules/ags/config/ts/notifications/gesture.ts +++ b/modules/ags/config/ts/notifications/gesture.ts @@ -1,7 +1,7 @@ -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; +const Notifications = await Service.import('notifications'); -import { Box, EventBox } from 'resource:///com/github/Aylur/ags/widget.js'; -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box, EventBox } = Widget; +const { timeout } = Utils; import { HasNotifs } from './base.ts'; diff --git a/modules/ags/config/ts/notifications/popup.ts b/modules/ags/config/ts/notifications/popup.ts index ddf48f5a..9df84562 100644 --- a/modules/ags/config/ts/notifications/popup.ts +++ b/modules/ags/config/ts/notifications/popup.ts @@ -1,9 +1,9 @@ -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; +const Notifications = await Service.import('notifications'); -import { Box } from 'resource:///com/github/Aylur/ags/widget.js'; -import { interval } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box } = Widget; +const { interval } = Utils; -import GLib from 'gi://GLib'; +const { GLib } = imports.gi; import { Notification } from './base.ts'; diff --git a/modules/ags/config/ts/notifications/wim.ts b/modules/ags/config/ts/notifications/wim.ts index b4f7820e..68a3cc20 100644 --- a/modules/ags/config/ts/notifications/wim.ts +++ b/modules/ags/config/ts/notifications/wim.ts @@ -1,9 +1,11 @@ -import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Window } = Widget; + import NotifCenterWidget from './center.ts'; import PopUpsWidget from './popup.ts'; import PopupWindow from '../misc/popup.ts'; + export const NotifPopups = () => Window({ name: 'notifications', anchor: ['top', 'left'], diff --git a/modules/ags/config/ts/on-screen-keyboard/gesture.ts b/modules/ags/config/ts/on-screen-keyboard/gesture.ts index 7f9a3097..875cfc9a 100644 --- a/modules/ags/config/ts/on-screen-keyboard/gesture.ts +++ b/modules/ags/config/ts/on-screen-keyboard/gesture.ts @@ -1,6 +1,6 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); -import { execAsync, timeout } from 'resource:///com/github/Aylur/ags/utils.js'; +const { execAsync, timeout } = Utils; const { Gtk } = imports.gi; diff --git a/modules/ags/config/ts/on-screen-keyboard/keyboard.ts b/modules/ags/config/ts/on-screen-keyboard/keyboard.ts index 3fe86813..4fbb8ed8 100644 --- a/modules/ags/config/ts/on-screen-keyboard/keyboard.ts +++ b/modules/ags/config/ts/on-screen-keyboard/keyboard.ts @@ -1,4 +1,4 @@ -import { Box, CenterBox, Label, ToggleButton } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, CenterBox, Label, ToggleButton } = Widget; const { Gdk } = imports.gi; const display = Gdk.Display.get_default(); diff --git a/modules/ags/config/ts/on-screen-keyboard/keys.ts b/modules/ags/config/ts/on-screen-keyboard/keys.ts index 19ff3eff..c9a26581 100644 --- a/modules/ags/config/ts/on-screen-keyboard/keys.ts +++ b/modules/ags/config/ts/on-screen-keyboard/keys.ts @@ -1,8 +1,7 @@ -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import Brightness from '../../services/brightness.ts'; -import { Box, EventBox, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box, EventBox, Label } = Widget; +const { execAsync } = Utils; const { Gdk, Gtk } = imports.gi; const display = Gdk.Display.get_default(); diff --git a/modules/ags/config/ts/on-screen-keyboard/main.ts b/modules/ags/config/ts/on-screen-keyboard/main.ts index e5d162ef..b5f86835 100644 --- a/modules/ags/config/ts/on-screen-keyboard/main.ts +++ b/modules/ags/config/ts/on-screen-keyboard/main.ts @@ -1,5 +1,5 @@ -import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Window } = Widget; +const { execAsync } = Utils; import Tablet from '../../services/tablet.ts'; import Gesture from './gesture.ts'; diff --git a/modules/ags/config/ts/osd/ctor.ts b/modules/ags/config/ts/osd/ctor.ts index cf4b3a7a..0210c222 100644 --- a/modules/ags/config/ts/osd/ctor.ts +++ b/modules/ags/config/ts/osd/ctor.ts @@ -1,4 +1,4 @@ -import { Box, Icon, ProgressBar } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Icon, ProgressBar } = Widget; const Y_POS = 80; diff --git a/modules/ags/config/ts/osd/main.ts b/modules/ags/config/ts/osd/main.ts index fcc53e9f..765accb6 100644 --- a/modules/ags/config/ts/osd/main.ts +++ b/modules/ags/config/ts/osd/main.ts @@ -1,7 +1,5 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; - -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; -import { Stack } from 'resource:///com/github/Aylur/ags/widget.js'; +const { timeout } = Utils; +const { Stack } = Widget; import PopupWindow from '../misc/popup.ts'; diff --git a/modules/ags/config/ts/osd/osds.ts b/modules/ags/config/ts/osd/osds.ts index 8de52004..272d3b3f 100644 --- a/modules/ags/config/ts/osd/osds.ts +++ b/modules/ags/config/ts/osd/osds.ts @@ -1,7 +1,7 @@ -import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const Audio = await Service.import('audio'); + +const { Label } = Widget; -import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; import OSD from './ctor.ts'; import Brightness from '../../services/brightness.ts'; diff --git a/modules/ags/config/ts/overview/clients.ts b/modules/ags/config/ts/overview/clients.ts index 7a405db2..38401086 100644 --- a/modules/ags/config/ts/overview/clients.ts +++ b/modules/ags/config/ts/overview/clients.ts @@ -1,8 +1,7 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); -import { Icon, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; -import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Icon, Revealer } = Widget; +const { timeout } = Utils; import { WindowButton } from './dragndrop.ts'; import * as VARS from './variables.ts'; @@ -34,7 +33,7 @@ const IconStyle = (client: HyprClient) => ` const Client = ( client: HyprClient, - active: Boolean, + active: boolean, clients: Array, box: AgsBox, ) => { diff --git a/modules/ags/config/ts/overview/current-workspace.ts b/modules/ags/config/ts/overview/current-workspace.ts index ec7a08f8..c83575e6 100644 --- a/modules/ags/config/ts/overview/current-workspace.ts +++ b/modules/ags/config/ts/overview/current-workspace.ts @@ -1,6 +1,7 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); + +const { Box } = Widget; -import { Box } from 'resource:///com/github/Aylur/ags/widget.js'; import * as VARS from './variables.ts'; const PADDING = 34; diff --git a/modules/ags/config/ts/overview/dragndrop.ts b/modules/ags/config/ts/overview/dragndrop.ts index 372795fa..2c5cfede 100644 --- a/modules/ags/config/ts/overview/dragndrop.ts +++ b/modules/ags/config/ts/overview/dragndrop.ts @@ -1,6 +1,6 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); -import { Button, EventBox } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Button, EventBox } = Widget; import Cairo from 'cairo'; const { Gtk, Gdk } = imports.gi; diff --git a/modules/ags/config/ts/overview/main.ts b/modules/ags/config/ts/overview/main.ts index 7fbd61c9..2acbcbcc 100644 --- a/modules/ags/config/ts/overview/main.ts +++ b/modules/ags/config/ts/overview/main.ts @@ -1,7 +1,6 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); -import { Box, Overlay, Window } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Overlay, Window } = Widget; import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.ts'; import { Highlighter, updateCurrentWorkspace } from './current-workspace.ts'; diff --git a/modules/ags/config/ts/overview/workspaces.ts b/modules/ags/config/ts/overview/workspaces.ts index cd1c359f..dc28ff6a 100644 --- a/modules/ags/config/ts/overview/workspaces.ts +++ b/modules/ags/config/ts/overview/workspaces.ts @@ -1,6 +1,6 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); -import { Revealer, CenterBox, Box, EventBox, Fixed, Label } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Revealer, CenterBox, Box, EventBox, Fixed, Label } = Widget; import { WorkspaceDrop } from './dragndrop.ts'; import * as VARS from './variables.ts'; diff --git a/modules/ags/config/ts/powermenu.ts b/modules/ags/config/ts/powermenu.ts index 4285a335..89a3d9d7 100644 --- a/modules/ags/config/ts/powermenu.ts +++ b/modules/ags/config/ts/powermenu.ts @@ -1,7 +1,7 @@ -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; +const Hyprland = await Service.import('hyprland'); -import { CenterBox, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; +const { CenterBox, Label } = Widget; +const { execAsync } = Utils; import PopupWindow from './misc/popup.ts'; import CursorBox from './misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/quick-settings/bluetooth.ts b/modules/ags/config/ts/quick-settings/bluetooth.ts index bc7150ef..d18b2c44 100644 --- a/modules/ags/config/ts/quick-settings/bluetooth.ts +++ b/modules/ags/config/ts/quick-settings/bluetooth.ts @@ -1,7 +1,6 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; +const Bluetooth = await Service.import('bluetooth'); -import { Box, Icon, Label, ListBox, Overlay, Revealer, Scrollable } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Icon, Label, ListBox, Overlay, Revealer, Scrollable } = Widget; import CursorBox from '../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/quick-settings/button-grid.ts b/modules/ags/config/ts/quick-settings/button-grid.ts index c7e3459e..4c941e85 100644 --- a/modules/ags/config/ts/quick-settings/button-grid.ts +++ b/modules/ags/config/ts/quick-settings/button-grid.ts @@ -1,10 +1,8 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; -import Network from 'resource:///com/github/Aylur/ags/service/network.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const Bluetooth = await Service.import('bluetooth'); +const Network = await Service.import('network'); -import { Box, Icon, Label, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; -import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box, Icon, Label, Revealer } = Widget; +const { execAsync } = Utils; import { SpeakerIcon, MicIcon } from '../misc/audio-icons.ts'; import CursorBox from '../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/quick-settings/main.ts b/modules/ags/config/ts/quick-settings/main.ts index 72a71b69..6f5e1136 100644 --- a/modules/ags/config/ts/quick-settings/main.ts +++ b/modules/ags/config/ts/quick-settings/main.ts @@ -1,4 +1,4 @@ -import { Box, Label, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Label, Revealer } = Widget; import ButtonGrid from './button-grid.ts'; import SliderBox from './slider-box.ts'; diff --git a/modules/ags/config/ts/quick-settings/network.ts b/modules/ags/config/ts/quick-settings/network.ts index 38ed8519..0e3b05ab 100644 --- a/modules/ags/config/ts/quick-settings/network.ts +++ b/modules/ags/config/ts/quick-settings/network.ts @@ -1,9 +1,7 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Network from 'resource:///com/github/Aylur/ags/service/network.js'; -import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +const Network = await Service.import('network'); -import { Box, Icon, Label, ListBox, Overlay, Revealer, Scrollable } from 'resource:///com/github/Aylur/ags/widget.js'; -import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; +const { Box, Icon, Label, ListBox, Overlay, Revealer, Scrollable } = Widget; +const { execAsync } = Utils; import CursorBox from '../misc/cursorbox.ts'; diff --git a/modules/ags/config/ts/quick-settings/slider-box.ts b/modules/ags/config/ts/quick-settings/slider-box.ts index 6f8e7e64..1bf90585 100644 --- a/modules/ags/config/ts/quick-settings/slider-box.ts +++ b/modules/ags/config/ts/quick-settings/slider-box.ts @@ -1,6 +1,6 @@ -import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; +const Audio = await Service.import('audio'); -import { Box, Slider, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; +const { Box, Slider, Icon } = Widget; const { Gdk } = imports.gi; const display = Gdk.Display.get_default(); diff --git a/modules/ags/config/ts/quick-settings/toggle-button.ts b/modules/ags/config/ts/quick-settings/toggle-button.ts index dc56220f..f4be7729 100644 --- a/modules/ags/config/ts/quick-settings/toggle-button.ts +++ b/modules/ags/config/ts/quick-settings/toggle-button.ts @@ -1,7 +1,6 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; +const Mpris = await Service.import('mpris'); -import { CenterBox, Icon, ToggleButton } from 'resource:///com/github/Aylur/ags/widget.js'; +const { CenterBox, Icon, ToggleButton } = Widget; // Types import AgsRevealer from 'types/widgets/revealer'; diff --git a/modules/ags/config/ts/setup.ts b/modules/ags/config/ts/setup.ts index 74ef4d5a..35db6e68 100644 --- a/modules/ags/config/ts/setup.ts +++ b/modules/ags/config/ts/setup.ts @@ -1,6 +1,5 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; -import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; -import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; +const Hyprland = await Service.import('hyprland'); +const Bluetooth = await Service.import('bluetooth'); import Brightness from '../services/brightness.ts'; import Pointers from '../services/pointers.ts';