Skip to content

Commit

Permalink
Add support for Gnome 45, drop support for Gnome < 44
Browse files Browse the repository at this point in the history
Because of their switch to standard JavaScript modules (ESM) that break
support for older versions. See:
https://blogs.gnome.org/shell-dev/2023/09/02/extensions-in-gnome-45/
https://gjs.guide/extensions/upgrading/gnome-shell-45.html
  • Loading branch information
adrienverge committed Nov 15, 2023
1 parent b640974 commit 224672f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ In case it doesn't work, you may need to add your gnome version in
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/GnomeMagicWindow --method org.gnome.Shell.Extensions.GnomeMagicWindow.magic_key_pressed Terminator terminator
```

## For Gnome versions < 45

Use this repo on commit b640974 or before, and read the README file from that
version.

## For Gnome versions < 41

Use this repo on commit 26230da or before, and read the README file from that
Expand Down
22 changes: 10 additions & 12 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ const BINDINGS = [
// },
];

const { Gio } = imports.gi;
const Main = imports.ui.main;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const Util = imports.misc.util;

class Extension {
import Gio from 'gi://Gio';
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
const Mainloop = imports.mainloop
import Meta from 'gi://Meta'; // const Meta = imports.gi.Meta; //TODO
import Shell from 'gi://Shell';
import * as Util from 'resource:///org/gnome/shell/misc/util.js';


export default class GnomeMagicWindowExtension extends Extension {
enable() {
this._dbus = Gio.DBusExportedObject.wrapJSObject(`
<node>
Expand Down Expand Up @@ -129,7 +131,3 @@ class Extension {
}
}
}

function init() {
return new Extension();
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"description": "Bind a key to a specific program in Gnome Shell",
"uuid": "gnome-magic-window@adrienverge",
"url": "https://github.com/adrienverge/gnome-magic-window",
"shell-version": ["40", "41", "42", "43", "44"]
"shell-version": ["45"]
}

0 comments on commit 224672f

Please sign in to comment.