Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cde5a4d58f | ||
|
|
6729cb118e | ||
|
|
c3d98b7b48 | ||
|
|
02c66359d9 | ||
|
|
00263f6b81 | ||
|
|
55e06d4f60 | ||
|
|
4c994943cd | ||
|
|
c9ef3f404a | ||
|
|
2fa02eac85 | ||
|
|
6dfb107ad9 | ||
|
|
e2fc4e7127 | ||
|
|
bf7fe98b05 | ||
|
|
4a2067811c | ||
|
|
e49b923667 | ||
|
|
75f2f107de | ||
|
|
42d680d00c | ||
|
|
7f9d040b82 | ||
|
|
525630009b | ||
|
|
0720ab6326 | ||
|
|
6129c98624 | ||
|
|
9a192afb9b | ||
|
|
42c1e6731e | ||
|
|
400ce3a77c | ||
|
|
2ab3822cb6 | ||
|
|
c1e597579f | ||
|
|
d7ee5ff5e6 | ||
|
|
52a9bc8c82 | ||
|
|
46ab8e24b0 | ||
|
|
e0be26c310 | ||
|
|
c824645c3f | ||
|
|
4c3160e9ca | ||
|
|
3ded68a8d5 | ||
|
|
7a160fb102 | ||
|
|
855a8e4a2e | ||
|
|
dda18f715f | ||
|
|
0c10fbce4b | ||
|
|
d8bcf472b6 | ||
|
|
5b8556912f | ||
|
|
9455c4b4d1 | ||
|
|
4da03ed2dc | ||
|
|
18beea21e7 | ||
|
|
e93ffe5da7 | ||
|
|
979eaa552a | ||
|
|
6bca124d94 | ||
|
|
b641561bca | ||
|
|
ce8807a7d9 | ||
|
|
39fdbe62b1 | ||
|
|
1e3c67273d | ||
|
|
cba529f79e | ||
|
|
d33495a9ea | ||
|
|
4e5f24c3d6 | ||
|
|
9e08221a2d | ||
|
|
57e28ff77a | ||
|
|
ed29d0a0a9 | ||
|
|
0da844ce97 | ||
|
|
06b2c5c4a3 | ||
|
|
7eb26a9f9e | ||
|
|
012f575ad5 | ||
|
|
195ada30fb | ||
|
|
7e21bf695c | ||
|
|
2607c58a70 | ||
|
|
305ef0d3e7 | ||
|
|
e5a7a0d96b | ||
|
|
cbaafc6e08 | ||
|
|
9bf199b1a6 | ||
|
|
92133701de | ||
|
|
045649c746 | ||
|
|
775b79c733 | ||
|
|
8b1ade3890 | ||
|
|
901b56cccf |
No files matched your search
@@ -31,7 +31,7 @@ jobs:
|
|||||||
apt-get install -y libglib2.0-dev glib-networking zip
|
apt-get install -y libglib2.0-dev glib-networking zip
|
||||||
|
|
||||||
- name: Install project dependencies
|
- name: Install project dependencies
|
||||||
run: pnpm install
|
run: pnpm install --ignore-scripts
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: just test
|
run: just test
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[tools]
|
||||||
|
node = "26"
|
||||||
|
pnpm = "12.3.4"
|
||||||
@@ -28,3 +28,65 @@ MacOS tiling WMs, mainly [Aerospace](https://github.com/nikitabobko/AeroSpace) (
|
|||||||
- complicated window dragging features and uis
|
- complicated window dragging features and uis
|
||||||
- Aerospace supports control + drag to combine windows while moving with the mouse, and normal window dragging.
|
- Aerospace supports control + drag to combine windows while moving with the mouse, and normal window dragging.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Aerospike isn't on the GNOME extension store yet, so install it from source.
|
||||||
|
This builds the extension locally and drops it into your user's extension dir.
|
||||||
|
Requires [just](https://github.com/casey/just) as the command runner, plus the
|
||||||
|
same build toolchain used for development (see [Development](#development)):
|
||||||
|
[mise](https://mise.jdx.dev/) for managing tool versions (`node` and `pnpm`),
|
||||||
|
and `glib2` for `glib-compile-schemas`.
|
||||||
|
|
||||||
|
Arch Linux:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S git just mise glib2 # mise needs its shell hook: https://mise.jdx.dev/getting-started.html#shells
|
||||||
|
```
|
||||||
|
|
||||||
|
Clone and install:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/lucasoskorep/aerospike-gnome
|
||||||
|
cd aerospike-gnome
|
||||||
|
mise install
|
||||||
|
just install
|
||||||
|
```
|
||||||
|
|
||||||
|
After installing from source, enable it (toggle in the Extensions app, or):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gnome-extensions enable aerospike@lucaso.io
|
||||||
|
```
|
||||||
|
|
||||||
|
Re-login or restart the shell (`Alt+F2` → `r` on X11) to pick it up.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
Building and debugging locally needs a few extra tools:
|
||||||
|
|
||||||
|
- `just` — the command runner
|
||||||
|
- `mise` — runtime & tool manager (pins `node` and `pnpm` in `.mise.toml`)
|
||||||
|
- `glib2` — provides `glib-compile-schemas` for compiling the settings schema
|
||||||
|
|
||||||
|
Arch Linux:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S just mise glib2
|
||||||
|
```
|
||||||
|
|
||||||
|
Install the pinned tools with mise (defined in `.mise.toml`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mise install
|
||||||
|
```
|
||||||
|
|
||||||
|
Then:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
just install # install deps + build + drop into the extension dir
|
||||||
|
just lint # lint
|
||||||
|
just test # run the test suite
|
||||||
|
just test-watch # run tests in watch mode
|
||||||
|
just live-debug # tail gnome-shell logs while you poke at it
|
||||||
|
```
|
||||||
|
|
||||||
Vendored
+12
-10
@@ -1,11 +1,13 @@
|
|||||||
import "@girs/gjs";
|
import "@girs/gjs/ambient";
|
||||||
import "@girs/gjs/dom";
|
import "@girs/gjs/dom";
|
||||||
import "@girs/gnome-shell/ambient";
|
import "@girs/glib-2.0/ambient";
|
||||||
import "@girs/gnome-shell/extensions/global";
|
import "@girs/gio-2.0/ambient";
|
||||||
|
import "@girs/gobject-2.0/ambient";
|
||||||
// Extend Meta.Window with our custom property
|
import "@girs/gtk-4.0/ambient";
|
||||||
declare namespace Meta {
|
import "@girs/gdk-4.0/ambient";
|
||||||
interface Window {
|
import "@girs/adw-1/ambient";
|
||||||
_aerospikeData?: any;
|
import "@girs/pango-1.0/ambient";
|
||||||
}
|
import "@girs/clutter-51/ambient";
|
||||||
}
|
import "@girs/st-51/ambient";
|
||||||
|
import "@girs/meta-51/ambient";
|
||||||
|
import "@girs/shell-51/ambient";
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import eslint from "@eslint/js";
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
|
import jsdoc from "eslint-plugin-jsdoc";
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
eslint.configs.recommended,
|
||||||
|
...tseslint.configs.recommended,
|
||||||
|
jsdoc.configs["flat/recommended-typescript"],
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
projectService: true,
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
"jsdoc/require-jsdoc": "off",
|
||||||
|
"jsdoc/require-param-description": "off",
|
||||||
|
"jsdoc/require-returns-description": "off",
|
||||||
|
"jsdoc/require-returns": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
"warn",
|
||||||
|
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ignores: ["dist/", "node_modules/", "*.js"],
|
||||||
|
},
|
||||||
|
);
|
||||||
@@ -8,7 +8,7 @@ packages:
|
|||||||
|
|
||||||
build: packages && build-schemas
|
build: packages && build-schemas
|
||||||
rm -rf dist/*
|
rm -rf dist/*
|
||||||
pnpm exec tsc
|
pnpm run build
|
||||||
cp metadata.json dist/
|
cp metadata.json dist/
|
||||||
cp stylesheet.css dist/
|
cp stylesheet.css dist/
|
||||||
mkdir -p dist/schemas
|
mkdir -p dist/schemas
|
||||||
@@ -47,6 +47,12 @@ test-coverage:
|
|||||||
ci-local:
|
ci-local:
|
||||||
act -W .gitea/workflows/build.yaml
|
act -W .gitea/workflows/build.yaml
|
||||||
|
|
||||||
|
lint:
|
||||||
|
pnpm run lint
|
||||||
|
|
||||||
|
clean:
|
||||||
|
pnpm run clean
|
||||||
|
|
||||||
#pack: build
|
#pack: build
|
||||||
# gnome-extensions pack dist \
|
# gnome-extensions pack dist \
|
||||||
# --force \
|
# --force \
|
||||||
|
|||||||
+5
-3
@@ -1,12 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "aerospike",
|
"name": "Aerospike WM",
|
||||||
"description": "I3 Like Tiling Window Manager for Gnome",
|
"description": "I3 Like Tiling Window Manager for Gnome",
|
||||||
"uuid": "aerospike@lucaso.io",
|
"uuid": "aerospike@lucaso.io",
|
||||||
"settings-schema": "org.gnome.shell.extensions.aerospike",
|
"settings-schema": "org.gnome.shell.extensions.aerospike",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"48",
|
"48",
|
||||||
"49"
|
"49",
|
||||||
|
"50",
|
||||||
|
"51"
|
||||||
],
|
],
|
||||||
"gettext-domain": "aerospike@lucaso.io",
|
"gettext-domain": "aerospike@lucaso.io",
|
||||||
"url": "https://gitea.chaosdev.gay/lucasoskorep/aerospike@lucaso.io"
|
"url": "https://github.com/lucasoskorep/aerospike-gnome"
|
||||||
}
|
}
|
||||||
+28
-35
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "aerospike",
|
"name": "aerospike",
|
||||||
"version": "0.2.1",
|
"version": "0.2.5",
|
||||||
"description": "A TypeScript GNOME Extension for Pretty Borders",
|
"description": "Simple, Opinionated Tiling Window Manager for Gnome written in Typescript",
|
||||||
|
"packageManager": "pnpm@12.3.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -11,47 +12,39 @@
|
|||||||
"author": "Lucas Oskorep <lucas.oskorep@gmail.com>",
|
"author": "Lucas Oskorep <lucas.oskorep@gmail.com>",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/example/my-extension/issues"
|
"url": "https://github.com/lucasoskorep/aerospike-gnome/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/example/my-extension#readme",
|
"homepage": "https://github.com/lucasoskorep/aerospike-gnome/#readme",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build": "tsc",
|
||||||
|
"clean": "rm -rf dist/*",
|
||||||
|
"lint": "eslint .",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:coverage": "jest --coverage"
|
"test:coverage": "jest --coverage"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@girs/gjs": "4.0.0-beta.38",
|
"@eslint/js": "^10.0.1",
|
||||||
"@girs/gnome-shell": "49.1.0",
|
"@girs/adw-1": "^5.5.0",
|
||||||
"@jest/globals": "^30.0.0",
|
"@girs/clutter-51": "^5.5.0",
|
||||||
|
"@girs/gio-2.0": "^5.5.0",
|
||||||
|
"@girs/gjs": "^5.5.0",
|
||||||
|
"@girs/glib-2.0": "^5.5.0",
|
||||||
|
"@girs/gobject-2.0": "^5.5.0",
|
||||||
|
"@girs/gdk-4.0": "^5.5.0",
|
||||||
|
"@girs/gtk-4.0": "^5.5.0",
|
||||||
|
"@girs/meta-51": "^5.5.0",
|
||||||
|
"@girs/pango-1.0": "^5.5.0",
|
||||||
|
"@girs/shell-51": "^5.5.0",
|
||||||
|
"@girs/st-51": "^5.5.0",
|
||||||
|
"@jest/globals": "^30.5.2",
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"eslint": "^10.0.0",
|
"eslint": "^10.12.0",
|
||||||
"eslint-plugin-jsdoc": "^62.0.0",
|
"eslint-plugin-jsdoc": "^65.3.4",
|
||||||
"jest": "^30.0.0",
|
"jest": "^30.5.2",
|
||||||
"ts-jest": "^29.1.2",
|
"ts-jest": "^29.4.14",
|
||||||
"typescript": "^5.9.2"
|
"typescript": "^6.0.3",
|
||||||
},
|
"typescript-eslint": "^8.71.2"
|
||||||
"dependencies": {
|
|
||||||
"@girs/mtk-17": "17.0.0-4.0.0-beta.38"
|
|
||||||
},
|
|
||||||
"pnpm": {
|
|
||||||
"overrides": {
|
|
||||||
"@girs/cairo-1.0": "1.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/freetype2-2.0": "2.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/gdk-4.0": "4.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/gio-2.0": "2.86.0-4.0.0-beta.38",
|
|
||||||
"@girs/gjs": "4.0.0-beta.38",
|
|
||||||
"@girs/glib-2.0": "2.86.0-4.0.0-beta.38",
|
|
||||||
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/gobject-2.0": "2.86.0-4.0.0-beta.38",
|
|
||||||
"@girs/graphene-1.0": "1.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/gsk-4.0": "4.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/gtk-4.0": "4.20.1-4.0.0-beta.38",
|
|
||||||
"@girs/harfbuzz-0.0": "11.5.0-4.0.0-beta.38",
|
|
||||||
"@girs/mtk-17": "17.0.0-4.0.0-beta.38",
|
|
||||||
"@girs/pango-1.0": "1.57.0-4.0.0-beta.38",
|
|
||||||
"@girs/pangocairo-1.0": "1.0.0-4.0.0-beta.38"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+2110
-1669
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,5 @@
|
|||||||
|
allowBuilds:
|
||||||
|
'@parcel/watcher': true
|
||||||
|
unrs-resolver: true
|
||||||
|
minimumReleaseAgeExclude:
|
||||||
|
- eslint-plugin-jsdoc@65.3.4
|
||||||
@@ -173,6 +173,7 @@ export default class AerospikeExtensions extends ExtensionPreferences {
|
|||||||
if (!!value) {
|
if (!!value) {
|
||||||
const mappings = value.split(',').map((x) => {
|
const mappings = value.split(',').map((x) => {
|
||||||
const [, key, mods] = Gtk.accelerator_parse(x);
|
const [, key, mods] = Gtk.accelerator_parse(x);
|
||||||
|
if (mods === null) return false;
|
||||||
return Gtk.accelerator_valid(key, mods) && Gtk.accelerator_name(key, mods);
|
return Gtk.accelerator_valid(key, mods) && Gtk.accelerator_name(key, mods);
|
||||||
});
|
});
|
||||||
// Filter out any false values to ensure we only have strings
|
// Filter out any false values to ensure we only have strings
|
||||||
|
|||||||
+3
-1
@@ -21,7 +21,9 @@ export class TabBar {
|
|||||||
this._onTabClicked = onTabClicked;
|
this._onTabClicked = onTabClicked;
|
||||||
this._bar = new St.BoxLayout({
|
this._bar = new St.BoxLayout({
|
||||||
style_class: 'aerospike-tab-bar',
|
style_class: 'aerospike-tab-bar',
|
||||||
vertical: false,
|
// `vertical` was removed from St widgets in GNOME Shell 51 (deprecated
|
||||||
|
// in 48); `orientation` is its replacement and exists in 48 and later.
|
||||||
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
reactive: true,
|
reactive: true,
|
||||||
can_focus: false,
|
can_focus: false,
|
||||||
track_hover: false,
|
track_hover: false,
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ export class WindowWrapper {
|
|||||||
return this._window.get_frame_rect();
|
return this._window.get_frame_rect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isFullscreen(): boolean {
|
||||||
|
return this._window.is_fullscreen();
|
||||||
|
}
|
||||||
|
|
||||||
getTabLabel(): string {
|
getTabLabel(): string {
|
||||||
const rawAppName = this._window.get_wm_class() ?? '';
|
const rawAppName = this._window.get_wm_class() ?? '';
|
||||||
// Strip reverse-domain prefix (e.g. "org.gnome.Nautilus" -> "Nautilus")
|
// Strip reverse-domain prefix (e.g. "org.gnome.Nautilus" -> "Nautilus")
|
||||||
@@ -140,6 +144,11 @@ export class WindowWrapper {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isFullscreen()) {
|
||||||
|
Logger.info("STOPPED RESIZE BECAUSE WINDOW IS FULLSCREEN");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const actor = this._window.get_compositor_private() as Clutter.Actor | null;
|
const actor = this._window.get_compositor_private() as Clutter.Actor | null;
|
||||||
if (!actor) {
|
if (!actor) {
|
||||||
Logger.log("No actor available, can't resize safely yet");
|
Logger.log("No actor available, can't resize safely yet");
|
||||||
|
|||||||
+3
-2
@@ -10,14 +10,15 @@
|
|||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2022"
|
"ES2022"
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"ambient.d.ts",
|
"ambient.d.ts",
|
||||||
|
"types/**/*.d.ts",
|
||||||
"prefs.ts",
|
"prefs.ts",
|
||||||
"src/**/*"
|
"src/**/*"
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
"extension.ts"
|
"extension.ts"
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
Vendored
+20
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* GNOME Shell runtime globals.
|
||||||
|
*
|
||||||
|
* The `global` object is created by the shell before an extension is loaded and
|
||||||
|
* has no `.gir`, so it is not covered by the generated `@girs/*-51` packages.
|
||||||
|
* Upstream ships these in `@girs/gnome-shell`, but its GNOME 51 build
|
||||||
|
* (51.0.0-alpha.1) is unpublished, and v50 pulls St-18/Meta-18 types that
|
||||||
|
* collide with the -51 packages. Declaring the few symbols we use keeps the
|
||||||
|
* project on GNOME 51 types and installable from the registry.
|
||||||
|
*
|
||||||
|
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/environment.js
|
||||||
|
*/
|
||||||
|
import type Shell from "@girs/shell-51";
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
/** Global shell object created by GNOME Shell on startup. */
|
||||||
|
const global: Shell.Global;
|
||||||
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
Vendored
+131
@@ -0,0 +1,131 @@
|
|||||||
|
/**
|
||||||
|
* Ambient declarations for the GNOME Shell JavaScript modules this extension
|
||||||
|
* imports.
|
||||||
|
*
|
||||||
|
* Shell's JavaScript API has no `.gir`, so generated `@girs/*` types do not
|
||||||
|
* cover it. Upstream maintains those types in `@girs/gnome-shell`, but its
|
||||||
|
* GNOME 51 support (51.0.0-alpha.1) is unpublished on npm, and v50 depends on
|
||||||
|
* St-18/Meta-18 types that conflict with the -51 packages this project uses.
|
||||||
|
* Only the symbols actually imported here are declared; extend as needed.
|
||||||
|
*
|
||||||
|
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/tree/main/js/ui
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare module "resource:///org/gnome/shell/extensions/extension.js" {
|
||||||
|
import type Gio from "@girs/gio-2.0";
|
||||||
|
|
||||||
|
/** Parsed contents of the extension's `metadata.json`. */
|
||||||
|
export interface ExtensionMetadata {
|
||||||
|
uuid: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
"shell-version"?: string[];
|
||||||
|
"settings-schema"?: string;
|
||||||
|
"gettext-domain"?: string;
|
||||||
|
url?: string;
|
||||||
|
[key: string]: unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for an extension's `extension.js` default export.
|
||||||
|
*
|
||||||
|
* GNOME Shell 51 requires `disable()` to stay synchronous; returning a
|
||||||
|
* promise now throws.
|
||||||
|
*/
|
||||||
|
export class Extension {
|
||||||
|
constructor(metadata: ExtensionMetadata);
|
||||||
|
|
||||||
|
readonly metadata: ExtensionMetadata;
|
||||||
|
readonly uuid: string;
|
||||||
|
readonly path: string;
|
||||||
|
|
||||||
|
/** Returns a {@link Gio.Settings} for the extension's schema. */
|
||||||
|
getSettings(schema?: string | null, subdir?: string | null): Gio.Settings;
|
||||||
|
|
||||||
|
/** Marks the extension's settings as translatable. */
|
||||||
|
translateConfig(): void;
|
||||||
|
|
||||||
|
/** Opens the extension's preferences dialog, if it has one. */
|
||||||
|
openPreferences(): void;
|
||||||
|
|
||||||
|
enable(): void;
|
||||||
|
disable(): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js" {
|
||||||
|
import type Gio from "@girs/gio-2.0";
|
||||||
|
import type Adw from "@girs/adw-1";
|
||||||
|
|
||||||
|
/** Marks a string for translation and returns the translation. */
|
||||||
|
export function gettext(str: string): string;
|
||||||
|
|
||||||
|
/** Pluralised form of {@link gettext}. */
|
||||||
|
export function ngettext(fid: string, fidPlural: string, n: number): string;
|
||||||
|
|
||||||
|
/** Context-sensitive form of {@link gettext}. */
|
||||||
|
export function pgettext(context: string, str: string): string;
|
||||||
|
|
||||||
|
/** Base class for an extension's `prefs.js` default export. */
|
||||||
|
export class ExtensionPreferences {
|
||||||
|
readonly metadata: Record<string, unknown>;
|
||||||
|
readonly uuid: string;
|
||||||
|
readonly path: string;
|
||||||
|
|
||||||
|
/** Returns a {@link Gio.Settings} for the extension's schema. */
|
||||||
|
getSettings(schema?: string | null, subdir?: string | null): Gio.Settings;
|
||||||
|
|
||||||
|
/** Marks the extension's settings as translatable. */
|
||||||
|
translateConfig(): void;
|
||||||
|
|
||||||
|
/** Called by the shell to populate the preferences window. */
|
||||||
|
fillPreferencesWindow(window: Adw.PreferencesWindow): Promise<void> | void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "resource:///org/gnome/shell/ui/main.js" {
|
||||||
|
import type Gio from "@girs/gio-2.0";
|
||||||
|
import type Meta from "@girs/meta-51";
|
||||||
|
import type Shell from "@girs/shell-51";
|
||||||
|
import type St from "@girs/st-51";
|
||||||
|
|
||||||
|
/** Window management helpers exposed to extensions. */
|
||||||
|
export interface ShellWM {
|
||||||
|
/**
|
||||||
|
* Registers a keybinding from an extension's schema and returns its id.
|
||||||
|
*/
|
||||||
|
addKeybinding(
|
||||||
|
name: string,
|
||||||
|
settings: Gio.Settings,
|
||||||
|
flags: Meta.KeyBindingFlags,
|
||||||
|
mode: Shell.ActionMode,
|
||||||
|
handler: () => void,
|
||||||
|
): number;
|
||||||
|
|
||||||
|
/** Removes a keybinding previously added by this extension. */
|
||||||
|
removeKeybinding(name: string): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The shell's layout manager. */
|
||||||
|
export interface LayoutManager {
|
||||||
|
/** Actor holding all non-window UI. */
|
||||||
|
readonly uiGroup: St.Widget;
|
||||||
|
/** Actor holding the window group. */
|
||||||
|
readonly windowGroup: St.Widget;
|
||||||
|
readonly panelBox: St.BoxLayout;
|
||||||
|
readonly monitorManager: Meta.MonitorManager;
|
||||||
|
readonly nMonitors: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The overview (window overview + search). */
|
||||||
|
export interface Overview extends St.Widget {
|
||||||
|
connect(signal: "showing" | "hiding" | "show-overview", callback: () => void): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const wm: ShellWM;
|
||||||
|
export const layoutManager: LayoutManager;
|
||||||
|
export const overview: Overview;
|
||||||
|
|
||||||
|
/** Shows a notification in the message tray. */
|
||||||
|
export function notify(message: string): void;
|
||||||
|
}
|
||||||
Whitespace-only changes.
Reference in new issue
Block a user