Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ After **any** code change, always run these two commands and fix any errors befo
1. `just validate` — type-checks the TypeScript source without emitting output
2. `just toolbox test-all` — builds and runs all integration tests inside the Fedora toolbox, printing a pass/fail summary

To read only the relevant output from the test run (pass/fail summary):
```sh
just toolbox test-all 2>&1 | grep -E "PASS:|FAIL:|Results:"
```

Do not leave a task incomplete if either command reports errors or failures.

## Commands
Expand Down
18 changes: 16 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ build: deps
yarn build
cp metadata.json dist/
cp -r data/schemas dist/ 2>/dev/null || true
glib-compile-schemas dist/schemas/
cp -r data/icons dist/ 2>/dev/null || true
just compile-mo

package:
package: build
#!/usr/bin/env bash
set -e
mkdir -p dist/target
Expand Down Expand Up @@ -165,6 +166,19 @@ toolbox action *args:
toolbox rm --force {{ toolbox_name }}
echo "Toolbox '{{ toolbox_name }}' removed."
;;
"test")
just package
EXT="dist/target/{{ uuid }}.shell-extension.zip"
SCRIPT="{{ args }}"
if [ -z "$SCRIPT" ]; then
echo "Usage: just toolbox test <script>"
echo "Example: just toolbox test tests/shell/auroraBasic.js"
exit 1
fi
toolbox --container {{ toolbox_name }} run env GSETTINGS_SCHEMA_DIR=/usr/share/glib-2.0/schemas \
dbus-run-session gnome-shell-test-tool \
--headless --extension "$EXT" "$SCRIPT"
;;
"test-all")
just package
EXT="dist/target/{{ uuid }}.shell-extension.zip"
Expand All @@ -187,7 +201,7 @@ toolbox action *args:
;;
*)
echo "Unknown toolbox action: {{ action }}"
echo "Available: create, run, remove, test-all"
echo "Available: create, run, remove, test <script>, test-all"
exit 1
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Aurora Shell",
"description": "A customizable GNOME Shell extension that enhances the user experience with various modules and features.",
"version": "50.1",
"version": 50.1,
"uuid": "aurora-shell@luminusos.github.io",
"url": "https://github.com/luminusOS/aurora-shell",
"settings-schema": "org.gnome.shell.extensions.aurora-shell",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"typescript-eslint": "^8.46.4"
},
"dependencies": {
"@girs/adw-1": "1.9.0-4.0.0-beta.38",
"@girs/gjs": "^4.0.0-beta.38",
"@girs/gnome-shell": "^49.1.0",
"@girs/gobject-2.0": "^2.86.0-4.0.0-beta.38",
"@girs/shell-17": "^17.0.0-4.0.0-beta.38",
"@girs/st-17": "^17.0.0-4.0.0-beta.38"
"@girs/adw-1": "1.10.0-4.0.0-rc.15",
"@girs/gjs": "^4.0.0-rc.15",
"@girs/gnome-shell": "^50.0.0",
"@girs/gobject-2.0": "^2.88.0-4.0.0-rc.15",
"@girs/shell-18": "^18.0.0-4.0.0-rc.15",
"@girs/st-18": "^18.0.0-4.0.0-rc.15"
},
"packageManager": "yarn@4.14.1"
}
2 changes: 0 additions & 2 deletions src/core/adapters/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export interface ShellEnvironment {

export class GnomeShellAdapter implements ShellEnvironment {
get isStartingUp(): boolean {
// @ts-ignore
return Main.layoutManager._startingUp;
}

Expand All @@ -31,7 +30,6 @@ export class GnomeShellAdapter implements ShellEnvironment {
}

onStartupComplete(callback: () => void): number {
// @ts-ignore
return Main.layoutManager.connect('startup-complete', callback);
}

Expand Down
1 change: 0 additions & 1 deletion src/core/context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-nocheck
import GObject from '@girs/gobject-2.0';
import type { Logger } from './logger.ts';
import type { SettingsManager } from './settings.ts';
Expand Down
5 changes: 3 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Extension } from '@girs/gnome-shell/extensions/extension';
import type { Module } from './module.ts';
import { getModuleRegistry, type ModuleDefinition } from './registry.ts';
import type { ExtensionContext } from '~/core/context.ts';
import { initIcons, cleanupIcons } from '~/shared/icons.ts';
import { DefaultExtensionContext } from '~/core/context.ts';
import { ConsoleLogger } from '~/core/logger.ts';
import { GSettingsManager } from '~/core/settings.ts';
Expand Down Expand Up @@ -35,6 +36,7 @@ export default class AuroraShellExtension extends Extension {
new GnomeShellAdapter(),
);

initIcons(this.path);
this._initializeModules();
this._enableAllModules();
this._connectSettings();
Expand Down Expand Up @@ -69,7 +71,6 @@ export default class AuroraShellExtension extends Extension {
}
args.push(this);

// @ts-ignore
this._settings.connectObject(...args);
}

Expand Down Expand Up @@ -100,7 +101,6 @@ export default class AuroraShellExtension extends Extension {
override disable(): void {
this._context!.logger.log('Disabling extension');

// @ts-ignore
this._settings?.disconnectObject(this);

for (const [name, module] of this._modules) {
Expand All @@ -114,5 +114,6 @@ export default class AuroraShellExtension extends Extension {
this._modules.clear();
this._settings = null;
this._context = null;
cleanupIcons();
}
}
26 changes: 23 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
import type { ExtensionContext } from './core/context.ts';

/**
* Abstract base class for Aurora Shell modules
*/
export type ModuleOption = {
key?: string;
hourKey?: string;
minuteKey?: string;
title: string;
subtitle: string;
type: 'switch' | 'entry' | 'spin' | 'time';
min?: number;
max?: number;
};

export type ModuleMetadata = {
key: string;
settingsKey: string;
title: string;
subtitle: string;
options?: ModuleOption[];
};

export type ModuleDefinition = ModuleMetadata & {
factory: (context: ExtensionContext) => Module;
};

export abstract class Module {
constructor(protected context: ExtensionContext) {}
abstract enable(): void;
Expand Down
25 changes: 0 additions & 25 deletions src/moduleDefinition.ts

This file was deleted.

5 changes: 2 additions & 3 deletions src/modules/appSearchTooltip/appSearchTooltip.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @ts-nocheck
import { gettext as _ } from 'gettext';
import St from '@girs/st-17';
import St from '@girs/st-18';
import GLib from '@girs/glib-2.0';
import * as Main from '@girs/gnome-shell/ui/main';
import * as Search from '@girs/gnome-shell/ui/search';
import type { ExtensionContext } from '~/core/context.ts';
import { Module } from '~/module.ts';
import type { ModuleDefinition } from '~/moduleDefinition.ts';
import type { ModuleDefinition } from '~/module.ts';

const SHOW_DELAY_MS = 300;

Expand Down
3 changes: 1 addition & 2 deletions src/modules/autoThemeSwitcher/autoThemeSwitcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-nocheck
import '@girs/gjs';
import { gettext as _ } from 'gettext';
import GLib from '@girs/glib-2.0';
Expand All @@ -7,7 +6,7 @@ import Gio from '@girs/gio-2.0';
import type { ExtensionContext } from '~/core/context.ts';
import { Module } from '~/module.ts';
import type { SettingsManager } from '~/core/settings.ts';
import type { ModuleDefinition } from '~/moduleDefinition.ts';
import type { ModuleDefinition } from '~/module.ts';

/**
* AutoThemeSwitcher Module
Expand Down
23 changes: 13 additions & 10 deletions src/modules/bluetoothMenu/bluetoothMenu.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// @ts-nocheck
import '@girs/gjs';
import { gettext as _ } from 'gettext';

import * as Main from '@girs/gnome-shell/ui/main';

import type { ExtensionContext } from '~/core/context.ts';
import { Module } from '~/module.ts';
import type { ModuleDefinition } from '~/moduleDefinition.ts';
import type { ModuleDefinition } from '~/module.ts';
import { BluetoothDeviceItemPatcher } from '~/modules/bluetoothMenu/deviceItem.ts';
import { IconThemeLoader } from '~/shared/icons.ts';

export class BluetoothMenu extends Module {
private _toggle: any = null;
private _patchers = new Map<any, BluetoothDeviceItemPatcher>();
private _iconLoader: IconThemeLoader | null = null;
private _destroyIds = new Map<any, number>();
private _actorAddedId = 0;
private _gridChildAddedId = 0;

Expand All @@ -22,7 +20,6 @@ export class BluetoothMenu extends Module {
}

override enable(): void {
this._iconLoader = new IconThemeLoader(null);
const toggle = this._findBluetoothToggle();
if (toggle) {
this._attach(toggle);
Expand Down Expand Up @@ -57,17 +54,20 @@ export class BluetoothMenu extends Module {
this._actorAddedId = 0;
}

for (const [item, id] of this._destroyIds) {
item?.disconnect?.(id);
}
this._destroyIds.clear();

for (const patcher of this._patchers.values()) {
patcher.restore();
patcher.disable();
}
this._patchers.clear();

if (this._toggle) {
this._toggle.menu?.actor?.remove_style_class_name('aurora-bt-menu');
this._toggle = null;
}

this._iconLoader = null;
}

private _findBluetoothToggle(): any {
Expand Down Expand Up @@ -101,12 +101,15 @@ export class BluetoothMenu extends Module {
private _patchItem(item: any): void {
if (this._patchers.has(item) || item.__auroraBtPatched) return;
item.__auroraBtPatched = true;
const patcher = new BluetoothDeviceItemPatcher(item, this._iconLoader!);
const patcher = new BluetoothDeviceItemPatcher(item);
patcher.enable();
this._patchers.set(item, patcher);

item.connect('destroy', () => {
const id = item.connect('destroy', () => {
this._patchers.delete(item);
this._destroyIds.delete(item);
});
this._destroyIds.set(item, id);
}
}

Expand Down
18 changes: 7 additions & 11 deletions src/modules/bluetoothMenu/deviceItem.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
// @ts-nocheck
import '@girs/gjs';

import Gio from '@girs/gio-2.0';
import GLib from '@girs/glib-2.0';
import St from '@girs/st-17';
import Clutter from '@girs/clutter-17';
import St from '@girs/st-18';
import Clutter from '@girs/clutter-18';

import type { IconThemeLoader } from '~/shared/icons.ts';
import { loadIcon } from '~/shared/icons.ts';

const COLOR_DISCONNECTED = '#9a9a9a';
const COLOR_CONNECTED = '#1c71d8';
const COLOR_ANIMATING = '#3584e4';

export class BluetoothDeviceItemPatcher {
private _item: any;
private _iconLoader: IconThemeLoader;
private _stateIcon: St.Icon | null = null;
private _batteryLabel: St.Label | null = null;
private _spinnerNotifyId = 0;
Expand All @@ -25,13 +23,11 @@ export class BluetoothDeviceItemPatcher {
private _animationFrame = 1;
private _animatingState: 'connecting' | 'disconnecting' | null = null;

constructor(item: any, iconLoader: IconThemeLoader) {
constructor(item: any) {
this._item = item;
this._iconLoader = iconLoader;
this._patch();
}

private _patch(): void {
enable(): void {
const item = this._item;

// Override activate so clicking a device doesn't close the menu.
Expand Down Expand Up @@ -119,7 +115,7 @@ export class BluetoothDeviceItemPatcher {

private _loadIcon(name: string): Gio.Icon {
try {
return this._iconLoader.lookupIcon(name);
return loadIcon(name);
} catch (_e) {
return Gio.Icon.new_for_string('image-missing-symbolic');
}
Expand Down Expand Up @@ -180,7 +176,7 @@ export class BluetoothDeviceItemPatcher {
}
}

restore(): void {
disable(): void {
if (this._spinnerNotifyId) {
this._item._spinner?.disconnect(this._spinnerNotifyId);
this._spinnerNotifyId = 0;
Expand Down
9 changes: 5 additions & 4 deletions src/modules/dock/dock.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// @ts-nocheck
import '@girs/gjs';
import { gettext as _ } from 'gettext';

import St from '@girs/st-17';
import St from '@girs/st-18';
import GLib from '@girs/glib-2.0';

import * as Main from '@girs/gnome-shell/ui/main';

import type { ExtensionContext } from '~/core/context.ts';
import { Module } from '~/module.ts';
import type { ModuleDefinition } from '~/moduleDefinition.ts';
import type { ModuleDefinition } from '~/module.ts';
import { AuroraDash, type DashBounds } from '~/shared/ui/dash.ts';
import { DockHotArea } from '~/modules/dock/hotArea.ts';
import { DockIntellihide, OverlapStatus } from '~/modules/dock/intellihide.ts';
Expand Down Expand Up @@ -143,7 +142,9 @@ export class Dock extends Module {
affectsStruts: false,
});

const dash = new AuroraDash({ monitorIndex });
const dash = new (AuroraDash as unknown as new (p: { monitorIndex: number }) => AuroraDash)({
monitorIndex,
});
container.set_child(dash);
dash.attachToContainer(container);

Expand Down
Loading
Loading