From 35de755a6cc25a67fe8e1f1a9b0c66deb16e8a3e Mon Sep 17 00:00:00 2001 From: Chris Toph Date: Fri, 9 May 2025 22:57:35 -0400 Subject: [PATCH] Reconfigured AGS; types, tsc version, and flake are fixed up and working --- .gitignore | 3 +- .tool-versions | 1 + .vscode/settings.json | 30 +- @girs/appmenuglibtranslator-24.02.d.ts | 83 + @girs/astal-3.0.d.ts | 2248 + @girs/astal-4.0.d.ts | 1564 + @girs/astalapps-0.1.d.ts | 384 + @girs/astalbattery-0.1.d.ts | 696 + @girs/astalbluetooth-0.1.d.ts | 551 + @girs/astalcava-0.1.d.ts | 222 + @girs/astalhyprland-0.1.d.ts | 887 + @girs/astalio-0.1.d.ts | 1113 + @girs/astalmpris-0.1.d.ts | 651 + @girs/astalnetwork-0.1.d.ts | 466 + @girs/astalnotifd-0.1.d.ts | 443 + @girs/astalpowerprofiles-0.1.d.ts | 224 + @girs/astaltray-0.1.d.ts | 419 + @girs/astalwp-0.1.d.ts | 937 + @girs/atk-1.0.d.ts | 10365 + @girs/atspi-2.0.d.ts | 6420 + @girs/cairo-1.0.d.ts | 536 + @girs/cairo.d.ts | 845 + @girs/console.d.ts | 23 + @girs/dbus-1.0.d.ts | 89 + @girs/dbusglib-1.0.d.ts | 82 + @girs/dom.d.ts | 306 + @girs/fontconfig-2.0.d.ts | 65 + @girs/freetype2-2.0.d.ts | 65 + @girs/gdesktopenums-3.0.d.ts | 405 + @girs/gdk-3.0.d.ts | 13172 + @girs/gdk-4.0.d.ts | 17058 + @girs/gdkpixbuf-2.0.d.ts | 2795 + @girs/gdkpixdata-2.0.d.ts | 264 + @girs/gdkwayland-4.0.d.ts | 1352 + @girs/gdkx11-3.0.d.ts | 892 + @girs/gdkx11-4.0.d.ts | 746 + @girs/gettext.d.ts | 43 + @girs/gi.d.ts | 67 + @girs/gio-2.0.d.ts | 84175 ++++ @girs/giounix-2.0.d.ts | 5198 + @girs/girepository-2.0.d.ts | 2261 + @girs/girepository-3.0.d.ts | 2566 + @girs/gjs.d.ts | 738 + @girs/gl-1.0.d.ts | 145 + @girs/glib-2.0.d.ts | 27314 ++ @girs/glibunix-2.0.d.ts | 103 + @girs/gmodule-2.0.d.ts | 207 + @girs/gobject-2.0.d.ts | 6876 + @girs/graphene-1.0.d.ts | 3382 + @girs/gsk-4.0.d.ts | 4123 + @girs/gtk-3.0.d.ts | 339522 +++++++++++++++ @girs/gtk-4.0.d.ts | 259435 +++++++++++ @girs/gtk4layershell-1.0.d.ts | 271 + @girs/gtk4sessionlock-1.0.d.ts | 151 + @girs/gtklayershell-0.1.d.ts | 286 + @girs/harfbuzz-0.0.d.ts | 9626 + @girs/index.d.ts | 8 + @girs/json-1.0.d.ts | 3086 + @girs/libxml2-2.0.d.ts | 105 + @girs/nm-1.0.d.ts | 32917 ++ @girs/pango-1.0.d.ts | 9203 + @girs/pangocairo-1.0.d.ts | 450 + @girs/pangofc-1.0.d.ts | 962 + @girs/pangoft2-1.0.d.ts | 777 + @girs/pangoot-1.0.d.ts | 560 + @girs/pangoxft-1.0.d.ts | 879 + @girs/system.d.ts | 178 + @girs/vulkan-1.0.d.ts | 13648 + @girs/win32-1.0.d.ts | 52 + @girs/wp-0.5.d.ts | 7651 + @girs/xfixes-4.0.d.ts | 48 + @girs/xft-2.0.d.ts | 75 + @girs/xlib-2.0.d.ts | 134 + @girs/xrandr-1.3.d.ts | 96 + app.ts | 10 + src/env.d.ts => env.d.ts | 0 flake.lock | 27 +- flake.nix | 116 +- package.json | 8 +- pnpm-lock.yaml | 4 + src/app.ts | 10 - src/app/windows/Bar/components/BarCenter.tsx | 16 - src/app/windows/Bar/components/BarRight.tsx | 8 - src/app/windows/Bar/components/index.tsx | 3 - src/app/windows/Bar/index.tsx | 36 - {src => style}/style.scss | 0 tsconfig.json | 4 +- windows/Bar/components/Launcher.tsx | 10 + windows/Bar/components/Volume.tsx | 20 + .../Bar/components/Workspaces.tsx | 26 +- windows/Bar/components/index.tsx | 3 + windows/Bar/index.tsx | 66 + {src/app/windows => windows}/Run/index.tsx | 0 93 files changed, 883862 insertions(+), 225 deletions(-) create mode 100644 .tool-versions create mode 100644 @girs/appmenuglibtranslator-24.02.d.ts create mode 100644 @girs/astal-3.0.d.ts create mode 100644 @girs/astal-4.0.d.ts create mode 100644 @girs/astalapps-0.1.d.ts create mode 100644 @girs/astalbattery-0.1.d.ts create mode 100644 @girs/astalbluetooth-0.1.d.ts create mode 100644 @girs/astalcava-0.1.d.ts create mode 100644 @girs/astalhyprland-0.1.d.ts create mode 100644 @girs/astalio-0.1.d.ts create mode 100644 @girs/astalmpris-0.1.d.ts create mode 100644 @girs/astalnetwork-0.1.d.ts create mode 100644 @girs/astalnotifd-0.1.d.ts create mode 100644 @girs/astalpowerprofiles-0.1.d.ts create mode 100644 @girs/astaltray-0.1.d.ts create mode 100644 @girs/astalwp-0.1.d.ts create mode 100644 @girs/atk-1.0.d.ts create mode 100644 @girs/atspi-2.0.d.ts create mode 100644 @girs/cairo-1.0.d.ts create mode 100644 @girs/cairo.d.ts create mode 100644 @girs/console.d.ts create mode 100644 @girs/dbus-1.0.d.ts create mode 100644 @girs/dbusglib-1.0.d.ts create mode 100644 @girs/dom.d.ts create mode 100644 @girs/fontconfig-2.0.d.ts create mode 100644 @girs/freetype2-2.0.d.ts create mode 100644 @girs/gdesktopenums-3.0.d.ts create mode 100644 @girs/gdk-3.0.d.ts create mode 100644 @girs/gdk-4.0.d.ts create mode 100644 @girs/gdkpixbuf-2.0.d.ts create mode 100644 @girs/gdkpixdata-2.0.d.ts create mode 100644 @girs/gdkwayland-4.0.d.ts create mode 100644 @girs/gdkx11-3.0.d.ts create mode 100644 @girs/gdkx11-4.0.d.ts create mode 100644 @girs/gettext.d.ts create mode 100644 @girs/gi.d.ts create mode 100644 @girs/gio-2.0.d.ts create mode 100644 @girs/giounix-2.0.d.ts create mode 100644 @girs/girepository-2.0.d.ts create mode 100644 @girs/girepository-3.0.d.ts create mode 100644 @girs/gjs.d.ts create mode 100644 @girs/gl-1.0.d.ts create mode 100644 @girs/glib-2.0.d.ts create mode 100644 @girs/glibunix-2.0.d.ts create mode 100644 @girs/gmodule-2.0.d.ts create mode 100644 @girs/gobject-2.0.d.ts create mode 100644 @girs/graphene-1.0.d.ts create mode 100644 @girs/gsk-4.0.d.ts create mode 100644 @girs/gtk-3.0.d.ts create mode 100644 @girs/gtk-4.0.d.ts create mode 100644 @girs/gtk4layershell-1.0.d.ts create mode 100644 @girs/gtk4sessionlock-1.0.d.ts create mode 100644 @girs/gtklayershell-0.1.d.ts create mode 100644 @girs/harfbuzz-0.0.d.ts create mode 100644 @girs/index.d.ts create mode 100644 @girs/json-1.0.d.ts create mode 100644 @girs/libxml2-2.0.d.ts create mode 100644 @girs/nm-1.0.d.ts create mode 100644 @girs/pango-1.0.d.ts create mode 100644 @girs/pangocairo-1.0.d.ts create mode 100644 @girs/pangofc-1.0.d.ts create mode 100644 @girs/pangoft2-1.0.d.ts create mode 100644 @girs/pangoot-1.0.d.ts create mode 100644 @girs/pangoxft-1.0.d.ts create mode 100644 @girs/system.d.ts create mode 100644 @girs/vulkan-1.0.d.ts create mode 100644 @girs/win32-1.0.d.ts create mode 100644 @girs/wp-0.5.d.ts create mode 100644 @girs/xfixes-4.0.d.ts create mode 100644 @girs/xft-2.0.d.ts create mode 100644 @girs/xlib-2.0.d.ts create mode 100644 @girs/xrandr-1.3.d.ts create mode 100644 app.ts rename src/env.d.ts => env.d.ts (100%) delete mode 100644 src/app.ts delete mode 100644 src/app/windows/Bar/components/BarCenter.tsx delete mode 100644 src/app/windows/Bar/components/BarRight.tsx delete mode 100644 src/app/windows/Bar/components/index.tsx delete mode 100644 src/app/windows/Bar/index.tsx rename {src => style}/style.scss (100%) create mode 100644 windows/Bar/components/Launcher.tsx create mode 100644 windows/Bar/components/Volume.tsx rename src/app/windows/Bar/components/BarLeft.tsx => windows/Bar/components/Workspaces.tsx (62%) create mode 100644 windows/Bar/components/index.tsx create mode 100644 windows/Bar/index.tsx rename {src/app/windows => windows}/Run/index.tsx (100%) diff --git a/.gitignore b/.gitignore index 298eb4d..40b878d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -node_modules/ -@girs/ +node_modules/ \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..10edede --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs system diff --git a/.vscode/settings.json b/.vscode/settings.json index 8c8cc3a..91bc4f5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,28 @@ { - "typescript.tsdk": "node_modules/typescript/lib", + "biome.enabled": true, + "editor.formatOnSave": true, "explorer.fileNesting.patterns": { - "flake.nix": "*.nix, flake.lock, .envrc", + "flake.nix": "*.nix, flake.lock, .envrc, .tool-versions", "package.json": " pnpm-lock.yaml, tsconfig.json, .gitignore" }, "files.exclude": { - ".direnv": true, - "node_modules": true, - "@girs": true - } -} + ".direnv": true + // "@girs": true, + // "node_modules": true + }, + "terminal.integrated.defaultProfile.linux": "fish-fhs", + "terminal.integrated.profiles.linux": { + "fish-fhs": { + "args": [ + "--user", + "--pty", + "--quiet", + "--same-dir", + "--service-type=exec", + "fish" + ], + "path": "systemd-run" + } + }, + "typescript.tsdk": "./node_modules/typescript/lib" +} \ No newline at end of file diff --git a/@girs/appmenuglibtranslator-24.02.d.ts b/@girs/appmenuglibtranslator-24.02.d.ts new file mode 100644 index 0000000..714c66c --- /dev/null +++ b/@girs/appmenuglibtranslator-24.02.d.ts @@ -0,0 +1,83 @@ +/// +/// +/// +/// + +/** + * Type Definitions for Gjs (https://gjs.guide/) + * + * These type definitions are automatically generated, do not edit them by hand. + * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir + * + * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... + */ + +declare module 'gi://AppmenuGLibTranslator?version=24.02' { + // Module dependencies + import type Gio from 'gi://Gio?version=2.0'; + import type GObject from 'gi://GObject?version=2.0'; + import type GLib from 'gi://GLib?version=2.0'; + import type GModule from 'gi://GModule?version=2.0'; + + export namespace AppmenuGLibTranslator { + /** + * AppmenuGLibTranslator-24.02 + */ + + namespace Importer { + // Constructor properties interface + + interface ConstructorProps extends GObject.Object.ConstructorProps { + action_group: Gio.ActionGroup; + actionGroup: Gio.ActionGroup; + bus_name: string; + busName: string; + model: Gio.MenuModel; + object_path: string; + objectPath: string; + } + } + + class Importer extends GObject.Object { + static $gtype: GObject.GType; + + // Properties + + get action_group(): Gio.ActionGroup; + get actionGroup(): Gio.ActionGroup; + set bus_name(val: string); + set busName(val: string); + get model(): Gio.MenuModel; + set object_path(val: string); + set objectPath(val: string); + + // Constructors + + constructor(properties?: Partial, ...args: any[]); + + _init(...args: any[]): void; + + static ['new'](bus_name: string, object_path: string): Importer; + } + + type ImporterClass = typeof Importer; + /** + * Name of the imported GIR library + * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188 + */ + const __name__: string; + /** + * Version of the imported GIR library + * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189 + */ + const __version__: string; + } + + export default AppmenuGLibTranslator; +} + +declare module 'gi://AppmenuGLibTranslator' { + import AppmenuGLibTranslator2402 from 'gi://AppmenuGLibTranslator?version=24.02'; + export default AppmenuGLibTranslator2402; +} +// END diff --git a/@girs/astal-3.0.d.ts b/@girs/astal-3.0.d.ts new file mode 100644 index 0000000..bb2c4b6 --- /dev/null +++ b/@girs/astal-3.0.d.ts @@ -0,0 +1,2248 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +/** + * Type Definitions for Gjs (https://gjs.guide/) + * + * These type definitions are automatically generated, do not edit them by hand. + * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir + * + * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... + */ + +declare module 'gi://Astal?version=3.0' { + // Module dependencies + import type AstalIO from 'gi://AstalIO?version=0.1'; + import type GLib from 'gi://GLib?version=2.0'; + import type GObject from 'gi://GObject?version=2.0'; + import type Gio from 'gi://Gio?version=2.0'; + import type GModule from 'gi://GModule?version=2.0'; + import type Gdk from 'gi://Gdk?version=3.0'; + import type cairo from 'cairo'; + import type Pango from 'gi://Pango?version=1.0'; + import type HarfBuzz from 'gi://HarfBuzz?version=0.0'; + import type freetype2 from 'gi://freetype2?version=2.0'; + import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0'; + import type Gtk from 'gi://Gtk?version=3.0'; + import type xlib from 'gi://xlib?version=2.0'; + import type Atk from 'gi://Atk?version=1.0'; + + export namespace Astal { + /** + * Astal-3.0 + */ + + export namespace MouseButton { + export const $gtype: GObject.GType; + } + + enum MouseButton { + PRIMARY, + MIDDLE, + SECONDARY, + BACK, + FORWARD, + } + + export namespace Exclusivity { + export const $gtype: GObject.GType; + } + + enum Exclusivity { + NORMAL, + /** + * Request the compositor to allocate space for this window. + */ + EXCLUSIVE, + /** + * Request the compositor to stack layers on top of each other. + */ + IGNORE, + } + + export namespace Layer { + export const $gtype: GObject.GType; + } + + enum Layer { + BACKGROUND, + BOTTOM, + TOP, + OVERLAY, + } + + export namespace Keymode { + export const $gtype: GObject.GType; + } + + enum Keymode { + /** + * Window should not receive keyboard events. + */ + NONE, + /** + * Window should have exclusive focus if it is on the top or overlay layer. + */ + EXCLUSIVE, + /** + * Focus and Unfocues the window as needed. + */ + ON_DEMAND, + } + const MAJOR_VERSION: number; + const MINOR_VERSION: number; + const MICRO_VERSION: number; + const VERSION: string; + function widget_set_css(widget: Gtk.Widget, css: string): void; + function widget_get_css(widget: Gtk.Widget): string; + function widget_set_class_names(widget: Gtk.Widget, class_names: string[]): void; + function widget_get_class_names(widget: Gtk.Widget): string[]; + function widget_toggle_class_name(widget: Gtk.Widget, class_name: string, condition: boolean): void; + function widget_set_cursor(widget: Gtk.Widget, cursor: string): void; + function widget_get_cursor(widget: Gtk.Widget): string; + function widget_set_click_through(widget: Gtk.Widget, click_through: boolean): void; + function widget_get_click_through(widget: Gtk.Widget): boolean; + + export namespace WindowAnchor { + export const $gtype: GObject.GType; + } + + enum WindowAnchor { + NONE, + TOP, + RIGHT, + LEFT, + BOTTOM, + } + namespace Box { + // Constructor properties interface + + interface ConstructorProps extends Gtk.Box.ConstructorProps { + vertical: boolean; + children: Gtk.Widget[]; + child: Gtk.Widget; + } + } + + class Box extends Gtk.Box { + static $gtype: GObject.GType; + + // Properties + + /** + * Corresponds to [property`Gtk`.Orientable :orientation]. + */ + get vertical(): boolean; + set vertical(val: boolean); + get children(): Gtk.Widget[]; + set children(val: Gtk.Widget[]); + get child(): Gtk.Widget; + set child(val: Gtk.Widget); + + // Constructors + + constructor(properties?: Partial, ...args: any[]); + + _init(...args: any[]): void; + + static ['new'](vertical: boolean, children: Gtk.Widget[]): Box; + // Conflicted with Gtk.Box.new + + static ['new'](...args: never[]): any; + + // Methods + + get_vertical(): boolean; + set_vertical(value: boolean): void; + get_children(): Gtk.Widget[]; + set_children(value: Gtk.Widget[]): void; + get_child(): Gtk.Widget; + set_child(value: Gtk.Widget): void; + } + + namespace Button { + // Signal callback interfaces + + interface Hover { + (event: HoverEvent): void; + } + + interface HoverLost { + (event: HoverEvent): void; + } + + interface Click { + (event: ClickEvent): void; + } + + interface ClickRelease { + (event: ClickEvent): void; + } + + interface Scroll { + (event: ScrollEvent): void; + } + + // Constructor properties interface + + interface ConstructorProps extends Gtk.Button.ConstructorProps {} + } + + /** + * This button has no extra functionality on top if its base [class`Gtk`.Button] class. + * The purpose of this Button subclass is to have a destructable struct as the argument in GJS event handlers. + */ + class Button extends Gtk.Button { + static $gtype: GObject.GType