20 lines
1011 B
JavaScript
20 lines
1011 B
JavaScript
#!/usr/bin/gjs -m
|
|
import Adw from 'gi://Adw';
|
|
import Gio from 'gi://Gio';
|
|
import { fillSettingsWindow } from '../gnome-extension/[email protected]/settings-window.js';
|
|
|
|
const directory = Gio.File.new_for_uri(import.meta.url).get_parent().get_parent().get_child('gnome-extension').get_child('[email protected]').get_path();
|
|
const application = new Adw.Application({ application_id: 'io.qvac.Jarvis.Control', flags: Gio.ApplicationFlags.DEFAULT_FLAGS });
|
|
let window;
|
|
application.connect('activate', () => {
|
|
if (!window) {
|
|
const source = Gio.SettingsSchemaSource.new_from_directory(`${directory}/schemas`, Gio.SettingsSchemaSource.get_default(), false);
|
|
const settings = new Gio.Settings({ settings_schema: source.lookup('org.gnome.shell.extensions.jarvis', true) });
|
|
window = new Adw.PreferencesWindow({ application });
|
|
fillSettingsWindow(window, settings, directory);
|
|
window.connect('close-request', () => { window = null; return false; });
|
|
}
|
|
window.present();
|
|
});
|
|
application.run([]);
|