@@ -3,7 +3,8 @@
|
||||
Run `python3 apps/control-center/main.py` (or `gjs -m apps/control-center/main.js`).
|
||||
The Control Center and the GNOME extension's Settings button now open the same
|
||||
Libadwaita settings pages and use the same configuration catalog. Requires GJS,
|
||||
GTK 4, and Libadwaita 1.4 or newer.
|
||||
GTK 4, and Libadwaita 1.4 or newer. The window uses the Jarvis mark, Gold accent,
|
||||
and tagline “Local voice for your desktop.”
|
||||
|
||||
Voice, listening, and desktop settings are saved to
|
||||
`$XDG_CONFIG_HOME/jarvis/config.json` (default `~/.config/jarvis/config.json`).
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
#!/usr/bin/gjs -m
|
||||
import Adw from 'gi://Adw';
|
||||
import Gio from 'gi://Gio';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import Gdk from 'gi://Gdk';
|
||||
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('startup', () => {
|
||||
try {
|
||||
Gtk.IconTheme.get_for_display(Gdk.Display.get_default()).add_search_path(`${directory}/brand/icons`);
|
||||
} catch {}
|
||||
});
|
||||
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 });
|
||||
window = new Adw.PreferencesWindow({ application, icon_name: 'io.qvac.Jarvis.Control' });
|
||||
fillSettingsWindow(window, settings, directory);
|
||||
window.connect('close-request', () => { window = null; return false; });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user