From 7c0e1658daecbbd6cfc4e5397334b37b5194f2e9 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 13 Jan 2024 23:38:31 -0500 Subject: [PATCH] refactor(ags wim): bundle all files through imports --- devices/binto/config/ags/config.js | 12 +---- devices/binto/config/ags/ts/bar/main.ts | 8 ++-- devices/binto/config/ags/ts/main.ts | 10 ++-- .../binto/config/ags/ts/notifications/main.ts | 6 +-- devices/wim/config/ags/config.js | 6 +-- devices/wim/config/ags/js/utils.js | 47 ++++++------------- devices/wim/config/ags/services/tablet.ts | 2 +- .../wim/config/ags/ts/applauncher/app-item.ts | 4 +- devices/wim/config/ags/ts/applauncher/main.ts | 6 +-- devices/wim/config/ags/ts/bar/hovers/audio.ts | 4 +- .../wim/config/ags/ts/bar/hovers/bluetooth.ts | 2 +- .../config/ags/ts/bar/hovers/brightness.ts | 4 +- .../ags/ts/bar/hovers/hover-revealer.ts | 4 +- .../ags/ts/bar/hovers/keyboard-layout.ts | 4 +- .../wim/config/ags/ts/bar/hovers/network.ts | 2 +- .../wim/config/ags/ts/bar/items/battery.ts | 2 +- devices/wim/config/ags/ts/bar/items/clock.ts | 2 +- .../config/ags/ts/bar/items/current-window.ts | 2 +- devices/wim/config/ags/ts/bar/items/heart.ts | 4 +- .../config/ags/ts/bar/items/notif-button.ts | 6 +-- .../wim/config/ags/ts/bar/items/osk-toggle.ts | 4 +- .../config/ags/ts/bar/items/quick-settings.ts | 20 ++++---- .../wim/config/ags/ts/bar/items/systray.ts | 6 +-- .../config/ags/ts/bar/items/tablet-toggle.ts | 4 +- .../wim/config/ags/ts/bar/items/workspaces.ts | 10 ++-- devices/wim/config/ags/ts/bar/main.ts | 24 +++++----- devices/wim/config/ags/ts/corners/main.ts | 2 +- devices/wim/config/ags/ts/date.ts | 2 +- devices/wim/config/ags/ts/main.ts | 24 +++++----- .../wim/config/ags/ts/media-player/mpris.ts | 16 +++---- .../wim/config/ags/ts/media-player/player.ts | 12 ++--- devices/wim/config/ags/ts/misc/popup.ts | 2 +- .../wim/config/ags/ts/notifications/base.ts | 10 ++-- .../wim/config/ags/ts/notifications/center.ts | 6 +-- .../config/ags/ts/notifications/gesture.ts | 4 +- .../wim/config/ags/ts/notifications/main.ts | 6 +-- .../wim/config/ags/ts/notifications/popup.ts | 4 +- .../ags/ts/on-screen-keyboard/gesture.ts | 6 +-- .../ags/ts/on-screen-keyboard/keyboard.ts | 12 ++--- .../config/ags/ts/on-screen-keyboard/keys.ts | 6 +-- .../config/ags/ts/on-screen-keyboard/main.ts | 6 +-- devices/wim/config/ags/ts/osd/main.ts | 8 ++-- devices/wim/config/ags/ts/osd/osds.ts | 10 ++-- devices/wim/config/ags/ts/overview/clients.ts | 14 +++--- .../ags/ts/overview/current-workspace.ts | 10 ++-- .../wim/config/ags/ts/overview/dragndrop.ts | 12 ++--- devices/wim/config/ags/ts/overview/main.ts | 10 ++-- .../wim/config/ags/ts/overview/workspaces.ts | 12 ++--- devices/wim/config/ags/ts/powermenu.ts | 4 +- .../config/ags/ts/quick-settings/bluetooth.ts | 8 ++-- .../ags/ts/quick-settings/button-grid.ts | 20 ++++---- .../wim/config/ags/ts/quick-settings/main.ts | 10 ++-- .../config/ags/ts/quick-settings/network.ts | 6 +-- .../ags/ts/quick-settings/slider-box.ts | 4 +- devices/wim/config/ags/ts/setup.ts | 12 ++--- devices/wim/config/ags/tsconfig.json | 1 + 56 files changed, 220 insertions(+), 244 deletions(-) diff --git a/devices/binto/config/ags/config.js b/devices/binto/config/ags/config.js index dd6a482d..aad874f7 100644 --- a/devices/binto/config/ags/config.js +++ b/devices/binto/config/ags/config.js @@ -1,11 +1,3 @@ -import { watchAndCompileSass, transpileTypeScript } from 'file:///home/matt/.nix/devices/wim/config/ags/js/utils.js'; +import { transpileTypeScript } from 'file:///home/matt/.nix/devices/wim/config/ags/js/utils.js'; -watchAndCompileSass(); - -// Compile wim's config since that is where the big boy code is -// I have it symlinked in the git repo so TS server can see it -await transpileTypeScript( - '/home/matt/.nix/devices/wim/config/ags', - '/tmp/ags/wim', -); -export default (await import(await transpileTypeScript())).default; +export default (await transpileTypeScript()).default; diff --git a/devices/binto/config/ags/ts/bar/main.ts b/devices/binto/config/ags/ts/bar/main.ts index fc245cf1..275976c7 100644 --- a/devices/binto/config/ags/ts/bar/main.ts +++ b/devices/binto/config/ags/ts/bar/main.ts @@ -1,9 +1,9 @@ import { Box, CenterBox, Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import SysTray from '../../wim/ts/bar/items/systray.js'; -import Separator from '../../wim/ts/misc/separator.js'; -import NotifButton from '../../wim/ts/bar/items/notif-button.js'; -import Clock from './buttons/clock.js'; +import SysTray from '../../wim/ts/bar/items/systray.ts'; +import Separator from '../../wim/ts/misc/separator.ts'; +import NotifButton from '../../wim/ts/bar/items/notif-button.ts'; +import Clock from './buttons/clock.ts'; const PADDING = 20; diff --git a/devices/binto/config/ags/ts/main.ts b/devices/binto/config/ags/ts/main.ts index f28df184..15128eb0 100644 --- a/devices/binto/config/ags/ts/main.ts +++ b/devices/binto/config/ags/ts/main.ts @@ -1,9 +1,9 @@ -import Pointers from '../wim/services/pointers.js'; +import Pointers from '../wim/services/pointers.ts'; -import AppLauncher from '../wim/ts/applauncher/main.js'; -import Bar from './bar/main.js'; -import { NotifPopups, NotifCenter } from './notifications/main.js'; -import Powermenu from '../wim/ts/powermenu.js'; +import AppLauncher from '../wim/ts/applauncher/main.ts'; +import Bar from './bar/main.ts'; +import { NotifPopups, NotifCenter } from './notifications/main.ts'; +import Powermenu from '../wim/ts/powermenu.ts'; const closeWinDelay = 800; diff --git a/devices/binto/config/ags/ts/notifications/main.ts b/devices/binto/config/ags/ts/notifications/main.ts index fe209ccb..bc955696 100644 --- a/devices/binto/config/ags/ts/notifications/main.ts +++ b/devices/binto/config/ags/ts/notifications/main.ts @@ -1,9 +1,9 @@ import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import NotifCenterWidget from '../../wim/ts/notifications/center.js'; -import PopUpsWidget from '../../wim/ts/notifications/popup.js'; +import NotifCenterWidget from '../../wim/ts/notifications/center.ts'; +import PopUpsWidget from '../../wim/ts/notifications/popup.ts'; -import PopupWindow from '../../wim/ts/misc/popup.js'; +import PopupWindow from '../../wim/ts/misc/popup.ts'; export const NotifPopups = () => Window({ diff --git a/devices/wim/config/ags/config.js b/devices/wim/config/ags/config.js index 783ca5c6..b5a5616c 100644 --- a/devices/wim/config/ags/config.js +++ b/devices/wim/config/ags/config.js @@ -1,4 +1,4 @@ -import { watchAndCompileSass, transpileTypeScript } from './js/utils.js'; +import { transpileTypeScript } from './js/utils.js'; -watchAndCompileSass(); -export default (await import(await transpileTypeScript())).default; +// See ./ts/main.ts for actual code +export default (await transpileTypeScript()).default; diff --git a/devices/wim/config/ags/js/utils.js b/devices/wim/config/ags/js/utils.js index b71966e2..81741207 100644 --- a/devices/wim/config/ags/js/utils.js +++ b/devices/wim/config/ags/js/utils.js @@ -2,7 +2,7 @@ import App from 'resource:///com/github/Aylur/ags/app.js'; import { execAsync, monitorFile } from 'resource:///com/github/Aylur/ags/utils.js'; -export const watchAndCompileSass = () => { +const watchAndCompileSass = () => { const reloadCss = () => { const scss = `${App.configDir}/scss/main.scss`; const css = '/tmp/ags/style.css'; @@ -10,7 +10,7 @@ export const watchAndCompileSass = () => { execAsync(`sassc ${scss} ${css}`).then(() => { App.resetCss(); App.applyCss(css); - }).catch(reloadCss); + }).catch(print); }; monitorFile( @@ -21,36 +21,19 @@ export const watchAndCompileSass = () => { reloadCss(); }; -export const transpileTypeScript = async( - src = App.configDir, - out = '/tmp/ags', -) => { - const promises = []; - const files = (await execAsync([ - 'find', `${src}/`, - '-wholename', `${src}/services/*.ts`, - '-o', - '-wholename', `${src}/ts/*.ts`, - ])).split('\n'); +export const transpileTypeScript = async() => { + await execAsync([ + 'bun', 'build', `${App.configDir}/ts/main.ts`, + '--outdir', '/tmp/ags', + '--external', 'resource:///*', + '--external', 'gi://*', + '--external', 'cairo', + '--external', '*/fzf.es.js', + ]).catch(print); - /** @param {string} p */ - const getDirectoryPath = (p) => p.substring(0, p.lastIndexOf('/')); + watchAndCompileSass(); - files.forEach((file) => { - const outDir = getDirectoryPath(out + file - .replace(`${src}/ts`, '/ts') - .replace(`${src}/services`, '/services')); - - promises.push( - execAsync([ - 'bun', 'build', file, - '--outdir', outDir, - '--external', '*', - ]).catch(print), - ); - }); - - await Promise.all(promises); - - return `file://${out}/ts/main.js`; + // The file is going to be there after transpilation + // @ts-ignore + return await import('file:///tmp/ags/main.js'); }; diff --git a/devices/wim/config/ags/services/tablet.ts b/devices/wim/config/ags/services/tablet.ts index 095f7dc4..7c4ab985 100644 --- a/devices/wim/config/ags/services/tablet.ts +++ b/devices/wim/config/ags/services/tablet.ts @@ -1,6 +1,6 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; -import TouchGestures from './touch-gestures.js'; +import TouchGestures from './touch-gestures.ts'; import { execAsync, subprocess } from 'resource:///com/github/Aylur/ags/utils.js'; const ROTATION_MAP = { diff --git a/devices/wim/config/ags/ts/applauncher/app-item.ts b/devices/wim/config/ags/ts/applauncher/app-item.ts index 365bdb32..19337e47 100644 --- a/devices/wim/config/ags/ts/applauncher/app-item.ts +++ b/devices/wim/config/ags/ts/applauncher/app-item.ts @@ -3,10 +3,10 @@ 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'; -import CursorBox from '../misc/cursorbox.js'; +import CursorBox from '../misc/cursorbox.ts'; // Types -import { Application } from 'types/service/applications.js'; +import { Application } from 'types/service/applications.ts'; export default (app: Application) => { diff --git a/devices/wim/config/ags/ts/applauncher/main.ts b/devices/wim/config/ags/ts/applauncher/main.ts index b252c7a4..1c9045d8 100644 --- a/devices/wim/config/ags/ts/applauncher/main.ts +++ b/devices/wim/config/ags/ts/applauncher/main.ts @@ -6,11 +6,11 @@ import { Fzf } from 'file:///home/matt/.config/ags/node_modules/fzf/dist/fzf.es. import { Box, Entry, Icon, Label, ListBox, Revealer, Scrollable } from 'resource:///com/github/Aylur/ags/widget.js'; -import PopupWindow from '../misc/popup.js'; -import AppItem from './app-item.js'; +import PopupWindow from '../misc/popup.ts'; +import AppItem from './app-item.ts'; // Types -import { Application } from 'types/service/applications.js'; +import { Application } from 'types/service/applications.ts'; type ListBoxRow = typeof imports.gi.Gtk.ListBoxRow; diff --git a/devices/wim/config/ags/ts/bar/hovers/audio.ts b/devices/wim/config/ags/ts/bar/hovers/audio.ts index 497c393f..21f13bb1 100644 --- a/devices/wim/config/ags/ts/bar/hovers/audio.ts +++ b/devices/wim/config/ags/ts/bar/hovers/audio.ts @@ -2,8 +2,8 @@ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import { Label, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; -import { SpeakerIcon } from '../../misc/audio-icons.js'; -import HoverRevealer from './hover-revealer.js'; +import { SpeakerIcon } from '../../misc/audio-icons.ts'; +import HoverRevealer from './hover-revealer.ts'; export default () => HoverRevealer({ diff --git a/devices/wim/config/ags/ts/bar/hovers/bluetooth.ts b/devices/wim/config/ags/ts/bar/hovers/bluetooth.ts index a37a57bf..fe689d58 100644 --- a/devices/wim/config/ags/ts/bar/hovers/bluetooth.ts +++ b/devices/wim/config/ags/ts/bar/hovers/bluetooth.ts @@ -2,7 +2,7 @@ import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; import { Label, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; -import HoverRevealer from './hover-revealer.js'; +import HoverRevealer from './hover-revealer.ts'; export default () => HoverRevealer({ diff --git a/devices/wim/config/ags/ts/bar/hovers/brightness.ts b/devices/wim/config/ags/ts/bar/hovers/brightness.ts index afb2b316..c1770293 100644 --- a/devices/wim/config/ags/ts/bar/hovers/brightness.ts +++ b/devices/wim/config/ags/ts/bar/hovers/brightness.ts @@ -1,7 +1,7 @@ import { Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import Brightness from '../../../services/brightness.js'; -import HoverRevealer from './hover-revealer.js'; +import Brightness from '../../../services/brightness.ts'; +import HoverRevealer from './hover-revealer.ts'; export default () => HoverRevealer({ diff --git a/devices/wim/config/ags/ts/bar/hovers/hover-revealer.ts b/devices/wim/config/ags/ts/bar/hovers/hover-revealer.ts index ca68599c..7c1597b5 100644 --- a/devices/wim/config/ags/ts/bar/hovers/hover-revealer.ts +++ b/devices/wim/config/ags/ts/bar/hovers/hover-revealer.ts @@ -1,7 +1,7 @@ import { Box, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; -import Separator from '../../misc/separator.js'; -import CursorBox from '../../misc/cursorbox.js'; +import Separator from '../../misc/separator.ts'; +import CursorBox from '../../misc/cursorbox.ts'; export default ({ diff --git a/devices/wim/config/ags/ts/bar/hovers/keyboard-layout.ts b/devices/wim/config/ags/ts/bar/hovers/keyboard-layout.ts index 03335712..aa7d6415 100644 --- a/devices/wim/config/ags/ts/bar/hovers/keyboard-layout.ts +++ b/devices/wim/config/ags/ts/bar/hovers/keyboard-layout.ts @@ -2,11 +2,11 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import HoverRevealer from './hover-revealer.js'; +import HoverRevealer from './hover-revealer.ts'; const DEFAULT_KB = 'at-translated-set-2-keyboard'; -import AgsLabel from 'types/widgets/label.js'; +import AgsLabel from 'types/widgets/label.ts'; type Keyboard = { address: string; name: string; diff --git a/devices/wim/config/ags/ts/bar/hovers/network.ts b/devices/wim/config/ags/ts/bar/hovers/network.ts index 90b73969..778e2435 100644 --- a/devices/wim/config/ags/ts/bar/hovers/network.ts +++ b/devices/wim/config/ags/ts/bar/hovers/network.ts @@ -2,7 +2,7 @@ import Network from 'resource:///com/github/Aylur/ags/service/network.js'; import { Label, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; -import HoverRevealer from './hover-revealer.js'; +import HoverRevealer from './hover-revealer.ts'; export default () => HoverRevealer({ diff --git a/devices/wim/config/ags/ts/bar/items/battery.ts b/devices/wim/config/ags/ts/bar/items/battery.ts index 90d84e36..7a4e1685 100644 --- a/devices/wim/config/ags/ts/bar/items/battery.ts +++ b/devices/wim/config/ags/ts/bar/items/battery.ts @@ -2,7 +2,7 @@ import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import { Label, Icon, Box } from 'resource:///com/github/Aylur/ags/widget.js'; -import Separator from '../../misc/separator.js'; +import Separator from '../../misc/separator.ts'; const LOW_BATT = 20; const SPACING = 5; diff --git a/devices/wim/config/ags/ts/bar/items/clock.ts b/devices/wim/config/ags/ts/bar/items/clock.ts index adaecfa9..92cd3877 100644 --- a/devices/wim/config/ags/ts/bar/items/clock.ts +++ b/devices/wim/config/ags/ts/bar/items/clock.ts @@ -4,7 +4,7 @@ import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; const { DateTime } = imports.gi.GLib; -import CursorBox from '../../misc/cursorbox.js'; +import CursorBox from '../../misc/cursorbox.ts'; export default () => CursorBox({ diff --git a/devices/wim/config/ags/ts/bar/items/current-window.ts b/devices/wim/config/ags/ts/bar/items/current-window.ts index cf466f38..eec09727 100644 --- a/devices/wim/config/ags/ts/bar/items/current-window.ts +++ b/devices/wim/config/ags/ts/bar/items/current-window.ts @@ -2,7 +2,7 @@ import Applications from 'resource:///com/github/Aylur/ags/service/applications. import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import Separator from '../../misc/separator.js'; +import Separator from '../../misc/separator.ts'; const SPACING = 8; diff --git a/devices/wim/config/ags/ts/bar/items/heart.ts b/devices/wim/config/ags/ts/bar/items/heart.ts index de01a858..3a0b7ca0 100644 --- a/devices/wim/config/ags/ts/bar/items/heart.ts +++ b/devices/wim/config/ags/ts/bar/items/heart.ts @@ -2,8 +2,8 @@ import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; -import CursorBox from '../../misc/cursorbox.js'; -import Persist from '../../misc/persist.js'; +import CursorBox from '../../misc/cursorbox.ts'; +import Persist from '../../misc/persist.ts'; const HeartState = Variable(''); diff --git a/devices/wim/config/ags/ts/bar/items/notif-button.ts b/devices/wim/config/ags/ts/bar/items/notif-button.ts index e4e63a6b..57ab658c 100644 --- a/devices/wim/config/ags/ts/bar/items/notif-button.ts +++ b/devices/wim/config/ags/ts/bar/items/notif-button.ts @@ -3,13 +3,13 @@ import Notifications from 'resource:///com/github/Aylur/ags/service/notification import { Box, CenterBox, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import CursorBox from '../../misc/cursorbox.js'; -import Separator from '../../misc/separator.js'; +import CursorBox from '../../misc/cursorbox.ts'; +import Separator from '../../misc/separator.ts'; const SPACING = 4; // Types -import AgsWindow from 'types/widgets/window.js'; +import AgsWindow from 'types/widgets/window.ts'; export default () => CursorBox({ diff --git a/devices/wim/config/ags/ts/bar/items/osk-toggle.ts b/devices/wim/config/ags/ts/bar/items/osk-toggle.ts index dd75ab20..7571fef8 100644 --- a/devices/wim/config/ags/ts/bar/items/osk-toggle.ts +++ b/devices/wim/config/ags/ts/bar/items/osk-toggle.ts @@ -1,7 +1,7 @@ import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import Tablet from '../../../services/tablet.js'; -import CursorBox from '../../misc/cursorbox.js'; +import Tablet from '../../../services/tablet.ts'; +import CursorBox from '../../misc/cursorbox.ts'; export default () => CursorBox({ diff --git a/devices/wim/config/ags/ts/bar/items/quick-settings.ts b/devices/wim/config/ags/ts/bar/items/quick-settings.ts index 3f7bc4e5..d5737a15 100644 --- a/devices/wim/config/ags/ts/bar/items/quick-settings.ts +++ b/devices/wim/config/ags/ts/bar/items/quick-settings.ts @@ -2,21 +2,21 @@ import App from 'resource:///com/github/Aylur/ags/app.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import Audio from '../hovers/audio.js'; -import Bluetooth from '../hovers/bluetooth.js'; -import Brightness from '../hovers/brightness.js'; -import KeyboardLayout from '../hovers/keyboard-layout.js'; -import Network from '../hovers/network.js'; +import Audio from '../hovers/audio.ts'; +import Bluetooth from '../hovers/bluetooth.ts'; +import Brightness from '../hovers/brightness.ts'; +import KeyboardLayout from '../hovers/keyboard-layout.ts'; +import Network from '../hovers/network.ts'; -import CursorBox from '../../misc/cursorbox.js'; -import Separator from '../../misc/separator.js'; +import CursorBox from '../../misc/cursorbox.ts'; +import Separator from '../../misc/separator.ts'; const SPACING = 4; // Types -import AgsRevealer from 'types/widgets/revealer.js'; -import AgsBox from 'types/widgets/box.js'; -import AgsWindow from 'types/widgets/window.js'; +import AgsRevealer from 'types/widgets/revealer.ts'; +import AgsBox from 'types/widgets/box.ts'; +import AgsWindow from 'types/widgets/window.ts'; export default () => { diff --git a/devices/wim/config/ags/ts/bar/items/systray.ts b/devices/wim/config/ags/ts/bar/items/systray.ts index 7dbd5730..bc4d1bb5 100644 --- a/devices/wim/config/ags/ts/bar/items/systray.ts +++ b/devices/wim/config/ags/ts/bar/items/systray.ts @@ -3,14 +3,14 @@ import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; import { Box, Icon, MenuItem, MenuBar, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; -import Separator from '../../misc/separator.js'; +import Separator from '../../misc/separator.ts'; const REVEAL_DURATION = 500; const SPACING = 12; // Types -import { TrayItem } from 'types/service/systemtray.js'; -import AgsRevealer from 'types/widgets/revealer.js'; +import { TrayItem } from 'types/service/systemtray.ts'; +import AgsRevealer from 'types/widgets/revealer.ts'; type Menu = typeof imports.gi.Gtk.Menu; diff --git a/devices/wim/config/ags/ts/bar/items/tablet-toggle.ts b/devices/wim/config/ags/ts/bar/items/tablet-toggle.ts index 8d6bfb1b..c81908d3 100644 --- a/devices/wim/config/ags/ts/bar/items/tablet-toggle.ts +++ b/devices/wim/config/ags/ts/bar/items/tablet-toggle.ts @@ -1,7 +1,7 @@ import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import Tablet from '../../../services/tablet.js'; -import CursorBox from '../../misc/cursorbox.js'; +import Tablet from '../../../services/tablet.ts'; +import CursorBox from '../../misc/cursorbox.ts'; export default () => CursorBox({ diff --git a/devices/wim/config/ags/ts/bar/items/workspaces.ts b/devices/wim/config/ags/ts/bar/items/workspaces.ts index 5997f721..1e140137 100644 --- a/devices/wim/config/ags/ts/bar/items/workspaces.ts +++ b/devices/wim/config/ags/ts/bar/items/workspaces.ts @@ -3,15 +3,15 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; import { Box, Overlay, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; -import CursorBox from '../../misc/cursorbox.js'; +import CursorBox from '../../misc/cursorbox.ts'; const URGENT_DURATION = 1000; // Types -import AgsBox from 'types/widgets/box.js'; -import AgsRevealer from 'types/widgets/revealer.js'; -import AgsOverlay from 'types/widgets/overlay.js'; -import AgsEventBox from 'types/widgets/eventbox.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsRevealer from 'types/widgets/revealer.ts'; +import AgsOverlay from 'types/widgets/overlay.ts'; +import AgsEventBox from 'types/widgets/eventbox.ts'; const Workspace = ({ id }: { id: number }) => { diff --git a/devices/wim/config/ags/ts/bar/main.ts b/devices/wim/config/ags/ts/bar/main.ts index 4c35b4f7..2ea880e3 100644 --- a/devices/wim/config/ags/ts/bar/main.ts +++ b/devices/wim/config/ags/ts/bar/main.ts @@ -1,19 +1,19 @@ import { Window, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget.js'; -import Separator from '../misc/separator.js'; +import Separator from '../misc/separator.ts'; -import Battery from './items/battery.js'; -import Clock from './items/clock.js'; -import CurrentWindow from './items/current-window.js'; -import Heart from './items/heart.js'; -import NotifButton from './items/notif-button.js'; -import OskToggle from './items/osk-toggle.js'; -import QsToggle from './items/quick-settings.js'; -import SysTray from './items/systray.js'; -import TabletToggle from './items/tablet-toggle.js'; -import Workspaces from './items/workspaces.js'; +import Battery from './items/battery.ts'; +import Clock from './items/clock.ts'; +import CurrentWindow from './items/current-window.ts'; +import Heart from './items/heart.ts'; +import NotifButton from './items/notif-button.ts'; +import OskToggle from './items/osk-toggle.ts'; +import QsToggle from './items/quick-settings.ts'; +import SysTray from './items/systray.ts'; +import TabletToggle from './items/tablet-toggle.ts'; +import Workspaces from './items/workspaces.ts'; -import BarReveal from './fullscreen.js'; +import BarReveal from './fullscreen.ts'; const SPACING = 12; diff --git a/devices/wim/config/ags/ts/corners/main.ts b/devices/wim/config/ags/ts/corners/main.ts index 5eb008b3..dbe93681 100644 --- a/devices/wim/config/ags/ts/corners/main.ts +++ b/devices/wim/config/ags/ts/corners/main.ts @@ -1,6 +1,6 @@ import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import RoundedCorner from './screen-corners.js'; +import RoundedCorner from './screen-corners.ts'; const TopLeft = () => Window({ diff --git a/devices/wim/config/ags/ts/date.ts b/devices/wim/config/ags/ts/date.ts index b2577110..17bb2d88 100644 --- a/devices/wim/config/ags/ts/date.ts +++ b/devices/wim/config/ags/ts/date.ts @@ -2,7 +2,7 @@ import { Box, Calendar, Label } from 'resource:///com/github/Aylur/ags/widget.js const { DateTime } = imports.gi.GLib; -import PopupWindow from './misc/popup.js'; +import PopupWindow from './misc/popup.ts'; const Divider = () => Box({ diff --git a/devices/wim/config/ags/ts/main.ts b/devices/wim/config/ags/ts/main.ts index 21d4e386..082dd063 100644 --- a/devices/wim/config/ags/ts/main.ts +++ b/devices/wim/config/ags/ts/main.ts @@ -1,15 +1,15 @@ -import Setup from './setup.js'; -import AppLauncher from './applauncher/main.js'; -import Bar from './bar/main.js'; -import BgFade from './misc/background-fade.js'; -import Calendar from './date.js'; -import Corners from './corners/main.js'; -import { NotifPopups, NotifCenter } from './notifications/main.js'; -import OSD from './osd/main.js'; -import OSK from './on-screen-keyboard/main.js'; -import Overview from './overview/main.js'; -import Powermenu from './powermenu.js'; -import QSettings from './quick-settings/main.js'; +import Setup from './setup.ts'; +import AppLauncher from './applauncher/main.ts'; +import Bar from './bar/main.ts'; +import BgFade from './misc/background-fade.ts'; +import Calendar from './date.ts'; +import Corners from './corners/main.ts'; +import { NotifPopups, NotifCenter } from './notifications/main.ts'; +import OSD from './osd/main.ts'; +import OSK from './on-screen-keyboard/main.ts'; +import Overview from './overview/main.ts'; +import Powermenu from './powermenu.ts'; +import QSettings from './quick-settings/main.ts'; Setup(); diff --git a/devices/wim/config/ags/ts/media-player/mpris.ts b/devices/wim/config/ags/ts/media-player/mpris.ts index b0abbf20..a3648936 100644 --- a/devices/wim/config/ags/ts/media-player/mpris.ts +++ b/devices/wim/config/ags/ts/media-player/mpris.ts @@ -3,8 +3,8 @@ import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; 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'; -import Separator from '../misc/separator.js'; -import CursorBox from '../misc/cursorbox.js'; +import Separator from '../misc/separator.ts'; +import CursorBox from '../misc/cursorbox.ts'; const ICON_SIZE = 32; @@ -29,13 +29,13 @@ const icons = { }; // Types -import { MprisPlayer } from 'types/service/mpris.js'; +import { MprisPlayer } from 'types/service/mpris.ts'; import { Variable as Var } from 'types/variable'; -import AgsOverlay from 'types/widgets/overlay.js'; -import AgsCenterBox, { CenterBoxProps } from 'types/widgets/centerbox.js'; -import AgsLabel from 'types/widgets/label.js'; -import AgsIcon from 'types/widgets/icon.js'; -import AgsStack from 'types/widgets/stack.js'; +import AgsOverlay from 'types/widgets/overlay.ts'; +import AgsCenterBox, { CenterBoxProps } from 'types/widgets/centerbox.ts'; +import AgsLabel from 'types/widgets/label.ts'; +import AgsIcon from 'types/widgets/icon.ts'; +import AgsStack from 'types/widgets/stack.ts'; export const CoverArt = ( diff --git a/devices/wim/config/ags/ts/media-player/player.ts b/devices/wim/config/ags/ts/media-player/player.ts index 6449118d..fbd386e1 100644 --- a/devices/wim/config/ags/ts/media-player/player.ts +++ b/devices/wim/config/ags/ts/media-player/player.ts @@ -3,18 +3,18 @@ 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 PlayerGesture from './gesture.js'; -import Separator from '../misc/separator.js'; +import * as mpris from './mpris.ts'; +import PlayerGesture from './gesture.ts'; +import Separator from '../misc/separator.ts'; const FAVE_PLAYER = 'org.mpris.MediaPlayer2.spotify'; const SPACING = 8; // Types -import { MprisPlayer } from 'types/service/mpris.js'; -import AgsOverlay from 'types/widgets/overlay.js'; +import { MprisPlayer } from 'types/service/mpris.ts'; +import AgsOverlay from 'types/widgets/overlay.ts'; import { Variable as Var } from 'types/variable'; -import AgsBox from 'types/widgets/box.js'; +import AgsBox from 'types/widgets/box.ts'; const Top = ( diff --git a/devices/wim/config/ags/ts/misc/popup.ts b/devices/wim/config/ags/ts/misc/popup.ts index abf9b1eb..95fc8dc0 100644 --- a/devices/wim/config/ags/ts/misc/popup.ts +++ b/devices/wim/config/ags/ts/misc/popup.ts @@ -89,7 +89,7 @@ export default ({ App.getWindow(name)?.child.show_all(); }, - // This is for my custom pointers.js + // This is for my custom pointers.ts close_on_unfocus, }; diff --git a/devices/wim/config/ags/ts/notifications/base.ts b/devices/wim/config/ags/ts/notifications/base.ts index 11992bd8..e8e095ea 100644 --- a/devices/wim/config/ags/ts/notifications/base.ts +++ b/devices/wim/config/ags/ts/notifications/base.ts @@ -8,13 +8,13 @@ import { lookUpIcon } from 'resource:///com/github/Aylur/ags/utils.js'; const { GLib } = imports.gi; -import Gesture from './gesture.js'; -import CursorBox from '../misc/cursorbox.js'; +import Gesture from './gesture.ts'; +import CursorBox from '../misc/cursorbox.ts'; // Types -import { Notification as NotifObj } from 'types/service/notifications.js'; -import AgsEventBox from 'types/widgets/eventbox.js'; -import { Client } from 'types/service/hyprland.js'; +import { Notification as NotifObj } from 'types/service/notifications.ts'; +import AgsEventBox from 'types/widgets/eventbox.ts'; +import { Client } from 'types/service/hyprland.ts'; type NotificationWidget = { notif: NotifObj slideIn?: 'Left' | 'Right' diff --git a/devices/wim/config/ags/ts/notifications/center.ts b/devices/wim/config/ags/ts/notifications/center.ts index ae671049..5723fb23 100644 --- a/devices/wim/config/ags/ts/notifications/center.ts +++ b/devices/wim/config/ags/ts/notifications/center.ts @@ -4,11 +4,11 @@ import Notifications from 'resource:///com/github/Aylur/ags/service/notification import { 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, HasNotifs } from './base.js'; -import CursorBox from '../misc/cursorbox.js'; +import { Notification, HasNotifs } from './base.ts'; +import CursorBox from '../misc/cursorbox.ts'; // Types -import AgsBox from 'types/widgets/box.js'; +import AgsBox from 'types/widgets/box.ts'; import { Notification as NotifObj } from 'resource:///com/github/Aylur/ags/service/notifications.js'; diff --git a/devices/wim/config/ags/ts/notifications/gesture.ts b/devices/wim/config/ags/ts/notifications/gesture.ts index 94fedc28..6c9b2c67 100644 --- a/devices/wim/config/ags/ts/notifications/gesture.ts +++ b/devices/wim/config/ags/ts/notifications/gesture.ts @@ -3,13 +3,13 @@ import Notifications from 'resource:///com/github/Aylur/ags/service/notification import { Box, EventBox } from 'resource:///com/github/Aylur/ags/widget.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; -import { HasNotifs } from './base.js'; +import { HasNotifs } from './base.ts'; const { Gdk, Gtk } = imports.gi; const display = Gdk.Display.get_default(); // Types -import AgsBox from 'types/widgets/box.js'; +import AgsBox from 'types/widgets/box.ts'; const MAX_OFFSET = 200; const OFFSCREEN = 300; diff --git a/devices/wim/config/ags/ts/notifications/main.ts b/devices/wim/config/ags/ts/notifications/main.ts index e77ac7dc..f738b48c 100644 --- a/devices/wim/config/ags/ts/notifications/main.ts +++ b/devices/wim/config/ags/ts/notifications/main.ts @@ -1,8 +1,8 @@ import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import NotifCenterWidget from './center.js'; -import PopUpsWidget from './popup.js'; +import NotifCenterWidget from './center.ts'; +import PopUpsWidget from './popup.ts'; -import PopupWindow from '../misc/popup.js'; +import PopupWindow from '../misc/popup.ts'; export const NotifPopups = () => Window({ name: 'notifications', diff --git a/devices/wim/config/ags/ts/notifications/popup.ts b/devices/wim/config/ags/ts/notifications/popup.ts index 3e98f2c5..db1a459e 100644 --- a/devices/wim/config/ags/ts/notifications/popup.ts +++ b/devices/wim/config/ags/ts/notifications/popup.ts @@ -5,12 +5,12 @@ import { interval } from 'resource:///com/github/Aylur/ags/utils.js'; import GLib from 'gi://GLib'; -import { Notification } from './base.js'; +import { Notification } from './base.ts'; const DELAY = 2000; // Types -import AgsBox from 'types/widgets/box.js'; +import AgsBox from 'types/widgets/box.ts'; export default () => Box({ diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/gesture.ts b/devices/wim/config/ags/ts/on-screen-keyboard/gesture.ts index 858e3da9..30f1dafc 100644 --- a/devices/wim/config/ags/ts/on-screen-keyboard/gesture.ts +++ b/devices/wim/config/ags/ts/on-screen-keyboard/gesture.ts @@ -4,15 +4,15 @@ import { execAsync, timeout } from 'resource:///com/github/Aylur/ags/utils.js'; const { Gtk } = imports.gi; -import Tablet from '../../services/tablet.js'; +import Tablet from '../../services/tablet.ts'; const KEY_N = 249; const HIDDEN_MARGIN = 340; const ANIM_DURATION = 700; // Types -import AgsWindow from 'types/widgets/window.js'; -import AgsBox from 'types/widgets/box.js'; +import AgsWindow from 'types/widgets/window.ts'; +import AgsBox from 'types/widgets/box.ts'; const releaseAllKeys = () => { diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/keyboard.ts b/devices/wim/config/ags/ts/on-screen-keyboard/keyboard.ts index 5df94c76..2c6df192 100644 --- a/devices/wim/config/ags/ts/on-screen-keyboard/keyboard.ts +++ b/devices/wim/config/ags/ts/on-screen-keyboard/keyboard.ts @@ -3,11 +3,11 @@ import { Box, CenterBox, Label, ToggleButton } from 'resource:///com/github/Aylu const { Gdk } = imports.gi; const display = Gdk.Display.get_default(); -import Separator from '../misc/separator.js'; -import RoundedCorner from '../corners/screen-corners.js'; -import Key from './keys.js'; +import Separator from '../misc/separator.ts'; +import RoundedCorner from '../corners/screen-corners.ts'; +import Key from './keys.ts'; -import { defaultOskLayout, oskLayouts } from './keyboard-layouts.js'; +import { defaultOskLayout, oskLayouts } from './keyboard-layouts.ts'; const keyboardLayout = defaultOskLayout; const keyboardJson = oskLayouts[keyboardLayout]; @@ -16,8 +16,8 @@ const COLOR = 'rgba(0, 0, 0, 0.3)'; const SPACING = 4; // Types -import AgsWindow from 'types/widgets/window.js'; -import AgsBox from 'types/widgets/box.js'; +import AgsWindow from 'types/widgets/window.ts'; +import AgsBox from 'types/widgets/box.ts'; export default (window: AgsWindow) => Box({ diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts b/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts index 6bcf67b2..f0fe545e 100644 --- a/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts +++ b/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts @@ -1,5 +1,5 @@ import Variable from 'resource:///com/github/Aylur/ags/variable.js'; -import Brightness from '../../services/brightness.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'; @@ -7,7 +7,7 @@ import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; const { Gdk, Gtk } = imports.gi; const display = Gdk.Display.get_default(); -import Separator from '../misc/separator.js'; +import Separator from '../misc/separator.ts'; // Keep track of when a non modifier key // is clicked to release all modifiers @@ -45,7 +45,7 @@ const LALT_CODE = 56; const LCTRL_CODE = 29; // Types -import { Variable as Var } from 'types/variable.js'; +import { Variable as Var } from 'types/variable.ts'; type Key = { keytype: 'normal', label: string, diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/main.ts b/devices/wim/config/ags/ts/on-screen-keyboard/main.ts index 42d53738..6ddab421 100644 --- a/devices/wim/config/ags/ts/on-screen-keyboard/main.ts +++ b/devices/wim/config/ags/ts/on-screen-keyboard/main.ts @@ -1,9 +1,9 @@ import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; -import Tablet from '../../services/tablet.js'; -import Gesture from './gesture.js'; -import Keyboard from './keyboard.js'; +import Tablet from '../../services/tablet.ts'; +import Gesture from './gesture.ts'; +import Keyboard from './keyboard.ts'; // Start ydotool daemon diff --git a/devices/wim/config/ags/ts/osd/main.ts b/devices/wim/config/ags/ts/osd/main.ts index 7570a71c..b0327b8e 100644 --- a/devices/wim/config/ags/ts/osd/main.ts +++ b/devices/wim/config/ags/ts/osd/main.ts @@ -3,14 +3,14 @@ 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'; -import PopupWindow from '../misc/popup.js'; -import AgsBox from 'types/widgets/box.js'; -import AgsStack from 'types/widgets/stack.js'; +import PopupWindow from '../misc/popup.ts'; +import AgsBox from 'types/widgets/box.ts'; +import AgsStack from 'types/widgets/stack.ts'; // Import all the OSDs as an array const OSDList = [] as Array<(stack: AgsStack) => AgsBox>; -import * as Modules from './osds.js'; +import * as Modules from './osds.ts'; for (const osd in Modules) { OSDList.push(Modules[osd]); } // Array diff --git a/devices/wim/config/ags/ts/osd/osds.ts b/devices/wim/config/ags/ts/osd/osds.ts index d96e3748..3b86856c 100644 --- a/devices/wim/config/ags/ts/osd/osds.ts +++ b/devices/wim/config/ags/ts/osd/osds.ts @@ -2,11 +2,11 @@ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import OSD from './ctor.js'; +import OSD from './ctor.ts'; -import Brightness from '../../services/brightness.js'; -import { SpeakerIcon } from '../misc/audio-icons.js'; -import { MicIcon } from '../misc/audio-icons.js'; +import Brightness from '../../services/brightness.ts'; +import { SpeakerIcon } from '../misc/audio-icons.ts'; +import { MicIcon } from '../misc/audio-icons.ts'; const AUDIO_MAX = 1.5; @@ -17,7 +17,7 @@ globalThis.showSpeaker = () => { }; // Types -import AgsStack from 'types/widgets/stack.js'; +import AgsStack from 'types/widgets/stack.ts'; export const SpeakerOSD = (stack: AgsStack) => OSD({ diff --git a/devices/wim/config/ags/ts/overview/clients.ts b/devices/wim/config/ags/ts/overview/clients.ts index cbf23bbc..7a405db2 100644 --- a/devices/wim/config/ags/ts/overview/clients.ts +++ b/devices/wim/config/ags/ts/overview/clients.ts @@ -4,15 +4,15 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { Icon, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; -import { WindowButton } from './dragndrop.js'; -import * as VARS from './variables.js'; +import { WindowButton } from './dragndrop.ts'; +import * as VARS from './variables.ts'; // Types -import { Client as HyprClient } from 'types/service/hyprland.js'; -import AgsRevealer from 'types/widgets/revealer.js'; -import AgsBox from 'types/widgets/box.js'; -import AgsButton from 'types/widgets/button.js'; -import AgsIcon from 'types/widgets/icon.js'; +import { Client as HyprClient } from 'types/service/hyprland.ts'; +import AgsRevealer from 'types/widgets/revealer.ts'; +import AgsBox from 'types/widgets/box.ts'; +import AgsButton from 'types/widgets/button.ts'; +import AgsIcon from 'types/widgets/icon.ts'; const scale = (size: number) => (size * VARS.SCALE) - VARS.MARGIN; diff --git a/devices/wim/config/ags/ts/overview/current-workspace.ts b/devices/wim/config/ags/ts/overview/current-workspace.ts index f336e435..2d9758d3 100644 --- a/devices/wim/config/ags/ts/overview/current-workspace.ts +++ b/devices/wim/config/ags/ts/overview/current-workspace.ts @@ -1,7 +1,7 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { Box } from 'resource:///com/github/Aylur/ags/widget.js'; -import * as VARS from './variables.js'; +import * as VARS from './variables.ts'; const PADDING = 34; const MARGIN = 9; @@ -12,10 +12,10 @@ const DEFAULT_STYLE = ` `; // Types -import AgsBox from 'types/widgets/box.js'; -import AgsRevealer from 'types/widgets/revealer.js'; -import AgsCenterBox from 'types/widgets/centerbox.js'; -import AgsEventBox from 'types/widgets/eventbox.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsRevealer from 'types/widgets/revealer.ts'; +import AgsCenterBox from 'types/widgets/centerbox.ts'; +import AgsEventBox from 'types/widgets/eventbox.ts'; export const Highlighter = () => Box({ diff --git a/devices/wim/config/ags/ts/overview/dragndrop.ts b/devices/wim/config/ags/ts/overview/dragndrop.ts index 732ae9e6..77aab5a9 100644 --- a/devices/wim/config/ags/ts/overview/dragndrop.ts +++ b/devices/wim/config/ags/ts/overview/dragndrop.ts @@ -5,17 +5,17 @@ import { Button, EventBox } from 'resource:///com/github/Aylur/ags/widget.js'; import Cairo from 'cairo'; const { Gtk, Gdk } = imports.gi; -import { updateClients } from './clients.js'; +import { updateClients } from './clients.ts'; const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)]; const display = Gdk.Display.get_default(); // Types -import AgsBox from 'types/widgets/box.js'; -import AgsButton from 'types/widgets/button.js'; -import AgsRevealer from 'types/widgets/revealer.js'; -import { ButtonProps } from 'types/widgets/button.js'; -import { EventBoxProps } from 'types/widgets/eventbox.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsButton from 'types/widgets/button.ts'; +import AgsRevealer from 'types/widgets/revealer.ts'; +import { ButtonProps } from 'types/widgets/button.ts'; +import { EventBoxProps } from 'types/widgets/eventbox.ts'; type WindowButtonType = ButtonProps & { address: string mainBox: AgsBox diff --git a/devices/wim/config/ags/ts/overview/main.ts b/devices/wim/config/ags/ts/overview/main.ts index 2e8d808a..cd173950 100644 --- a/devices/wim/config/ags/ts/overview/main.ts +++ b/devices/wim/config/ags/ts/overview/main.ts @@ -3,13 +3,13 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { Box, Overlay, Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.js'; -import { Highlighter, updateCurrentWorkspace } from './current-workspace.js'; -import { updateClients } from './clients.js'; +import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.ts'; +import { Highlighter, updateCurrentWorkspace } from './current-workspace.ts'; +import { updateClients } from './clients.ts'; // Types -import AgsBox from 'types/widgets/box.js'; -import AgsOverlay from 'types/widgets/overlay.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsOverlay from 'types/widgets/overlay.ts'; // TODO: have a 'page' for each monitor, arrows on both sides to loop through diff --git a/devices/wim/config/ags/ts/overview/workspaces.ts b/devices/wim/config/ags/ts/overview/workspaces.ts index 52358e2f..fc5790ba 100644 --- a/devices/wim/config/ags/ts/overview/workspaces.ts +++ b/devices/wim/config/ags/ts/overview/workspaces.ts @@ -2,8 +2,8 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { Revealer, CenterBox, Box, EventBox, Fixed, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import { WorkspaceDrop } from './dragndrop.js'; -import * as VARS from './variables.js'; +import { WorkspaceDrop } from './dragndrop.ts'; +import * as VARS from './variables.ts'; const DEFAULT_STYLE = ` min-width: ${VARS.SCREEN.X * VARS.SCALE}px; @@ -11,10 +11,10 @@ const DEFAULT_STYLE = ` `; // Types -import AgsBox from 'types/widgets/box.js'; -import AgsRevealer from 'types/widgets/revealer.js'; -import AgsCenterBox from 'types/widgets/centerbox.js'; -import AgsEventBox from 'types/widgets/eventbox.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsRevealer from 'types/widgets/revealer.ts'; +import AgsCenterBox from 'types/widgets/centerbox.ts'; +import AgsEventBox from 'types/widgets/eventbox.ts'; export const getWorkspaces = (box: AgsBox) => { diff --git a/devices/wim/config/ags/ts/powermenu.ts b/devices/wim/config/ags/ts/powermenu.ts index 1c04a64f..e50a298f 100644 --- a/devices/wim/config/ags/ts/powermenu.ts +++ b/devices/wim/config/ags/ts/powermenu.ts @@ -3,8 +3,8 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import { CenterBox, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; -import PopupWindow from './misc/popup.js'; -import CursorBox from './misc/cursorbox.js'; +import PopupWindow from './misc/popup.ts'; +import CursorBox from './misc/cursorbox.ts'; const PowermenuWidget = () => CenterBox({ diff --git a/devices/wim/config/ags/ts/quick-settings/bluetooth.ts b/devices/wim/config/ags/ts/quick-settings/bluetooth.ts index 6601968a..75371400 100644 --- a/devices/wim/config/ags/ts/quick-settings/bluetooth.ts +++ b/devices/wim/config/ags/ts/quick-settings/bluetooth.ts @@ -3,16 +3,16 @@ import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; import { Box, Icon, Label, ListBox, Overlay, Revealer, Scrollable } from 'resource:///com/github/Aylur/ags/widget.js'; -import CursorBox from '../misc/cursorbox.js'; +import CursorBox from '../misc/cursorbox.ts'; const SCROLL_THRESH_H = 200; const SCROLL_THRESH_N = 7; // Types -import AgsBox from 'types/widgets/box.js'; -import AgsScrollable from 'types/widgets/scrollable.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsScrollable from 'types/widgets/scrollable.ts'; type ListBoxRow = typeof imports.gi.Gtk.ListBoxRow; -import { BluetoothDevice as BTDev } from 'types/service/bluetooth.js'; +import { BluetoothDevice as BTDev } from 'types/service/bluetooth.ts'; const BluetoothDevice = (dev: BTDev) => Box({ diff --git a/devices/wim/config/ags/ts/quick-settings/button-grid.ts b/devices/wim/config/ags/ts/quick-settings/button-grid.ts index c2d4da8e..61726019 100644 --- a/devices/wim/config/ags/ts/quick-settings/button-grid.ts +++ b/devices/wim/config/ags/ts/quick-settings/button-grid.ts @@ -6,20 +6,20 @@ import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import { Box, Icon, Label, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; -import { SpeakerIcon, MicIcon } from '../misc/audio-icons.js'; -import CursorBox from '../misc/cursorbox.js'; -import Separator from '../misc/separator.js'; +import { SpeakerIcon, MicIcon } from '../misc/audio-icons.ts'; +import CursorBox from '../misc/cursorbox.ts'; +import Separator from '../misc/separator.ts'; -import { NetworkMenu } from './network.js'; -import { BluetoothMenu } from './bluetooth.js'; +import { NetworkMenu } from './network.ts'; +import { BluetoothMenu } from './bluetooth.ts'; // Types import { GObject } from 'gi://GObject'; -import AgsBox from 'types/widgets/box.js'; -import AgsIcon from 'types/widgets/icon.js'; -import AgsLabel from 'types/widgets/label.js'; -import AgsRevealer from 'types/widgets/revealer.js'; -import { Variable as Var } from 'types/variable.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsIcon from 'types/widgets/icon.ts'; +import AgsLabel from 'types/widgets/label.ts'; +import AgsRevealer from 'types/widgets/revealer.ts'; +import { Variable as Var } from 'types/variable.ts'; type IconTuple = [ GObject.Object, (self: AgsIcon) => void, diff --git a/devices/wim/config/ags/ts/quick-settings/main.ts b/devices/wim/config/ags/ts/quick-settings/main.ts index 7c79b6ef..a8134851 100644 --- a/devices/wim/config/ags/ts/quick-settings/main.ts +++ b/devices/wim/config/ags/ts/quick-settings/main.ts @@ -1,10 +1,10 @@ import { Box, Label, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; -import ButtonGrid from './button-grid.js'; -import SliderBox from './slider-box.js'; -import Player from '../media-player/player.js'; -import PopupWindow from '../misc/popup.js'; -import ToggleButton from './toggle-button.js'; +import ButtonGrid from './button-grid.ts'; +import SliderBox from './slider-box.ts'; +import Player from '../media-player/player.ts'; +import PopupWindow from '../misc/popup.ts'; +import ToggleButton from './toggle-button.ts'; const QuickSettingsWidget = () => { diff --git a/devices/wim/config/ags/ts/quick-settings/network.ts b/devices/wim/config/ags/ts/quick-settings/network.ts index b6c63bce..e04b0d19 100644 --- a/devices/wim/config/ags/ts/quick-settings/network.ts +++ b/devices/wim/config/ags/ts/quick-settings/network.ts @@ -5,14 +5,14 @@ import Variable from 'resource:///com/github/Aylur/ags/variable.js'; 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'; -import CursorBox from '../misc/cursorbox.js'; +import CursorBox from '../misc/cursorbox.ts'; const SCROLL_THRESH_H = 200; const SCROLL_THRESH_N = 7; // Types -import AgsBox from 'types/widgets/box.js'; -import AgsScrollable from 'types/widgets/scrollable.js'; +import AgsBox from 'types/widgets/box.ts'; +import AgsScrollable from 'types/widgets/scrollable.ts'; type ListBoxRow = typeof imports.gi.Gtk.ListBoxRow; type APType = { bssid: string diff --git a/devices/wim/config/ags/ts/quick-settings/slider-box.ts b/devices/wim/config/ags/ts/quick-settings/slider-box.ts index f6896a07..56c71c32 100644 --- a/devices/wim/config/ags/ts/quick-settings/slider-box.ts +++ b/devices/wim/config/ags/ts/quick-settings/slider-box.ts @@ -5,8 +5,8 @@ import { Box, Slider, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; const { Gdk } = imports.gi; const display = Gdk.Display.get_default(); -import Brightness from '../../services/brightness.js'; -import { SpeakerIcon } from '../misc/audio-icons.js'; +import Brightness from '../../services/brightness.ts'; +import { SpeakerIcon } from '../misc/audio-icons.ts'; export default () => Box({ diff --git a/devices/wim/config/ags/ts/setup.ts b/devices/wim/config/ags/ts/setup.ts index 0ab63848..74ef4d5a 100644 --- a/devices/wim/config/ags/ts/setup.ts +++ b/devices/wim/config/ags/ts/setup.ts @@ -2,13 +2,13 @@ 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'; -import Brightness from '../services/brightness.js'; -import Pointers from '../services/pointers.js'; -import Tablet from '../services/tablet.js'; -import TouchGestures from '../services/touch-gestures.js'; +import Brightness from '../services/brightness.ts'; +import Pointers from '../services/pointers.ts'; +import Tablet from '../services/tablet.ts'; +import TouchGestures from '../services/touch-gestures.ts'; -import closeAll from './misc/closer.js'; -import Persist from './misc/persist.js'; +import closeAll from './misc/closer.ts'; +import Persist from './misc/persist.ts'; export default () => { diff --git a/devices/wim/config/ags/tsconfig.json b/devices/wim/config/ags/tsconfig.json index e1d84ef2..506ae24c 100644 --- a/devices/wim/config/ags/tsconfig.json +++ b/devices/wim/config/ags/tsconfig.json @@ -5,6 +5,7 @@ "lib": [ "ES2022" ], + "allowImportingTsExtensions": true, "allowJs": true, "checkJs": true, "strict": true,