refactor(ags wim): bundle all files through imports
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-13 23:38:31 -05:00
parent 0d0f513007
commit 7c0e1658da
56 changed files with 220 additions and 244 deletions

View file

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

View file

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

View file

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

View file

@ -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({

View file

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

View file

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

View file

@ -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 = {

View file

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

View file

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

View file

@ -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({

View file

@ -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({

View file

@ -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({

View file

@ -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 ({

View file

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

View file

@ -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({

View file

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

View file

@ -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({

View file

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

View file

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

View file

@ -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({

View file

@ -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({

View file

@ -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 () => {

View file

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

View file

@ -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({

View file

@ -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 }) => {

View file

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

View file

@ -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({

View file

@ -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({

View file

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

View file

@ -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 = (

View file

@ -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 = (

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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({

View file

@ -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 = () => {

View file

@ -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({

View file

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

View file

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

View file

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

View file

@ -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({

View file

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

View file

@ -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({

View file

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

View file

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

View file

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

View file

@ -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({

View file

@ -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({

View file

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

View file

@ -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 = () => {

View file

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

View file

@ -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({

View file

@ -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 () => {

View file

@ -5,6 +5,7 @@
"lib": [
"ES2022"
],
"allowImportingTsExtensions": true,
"allowJs": true,
"checkJs": true,
"strict": true,