diff --git a/metadata.json b/metadata.json index dc11aa2..a048d36 100644 --- a/metadata.json +++ b/metadata.json @@ -3,8 +3,9 @@ "description": "This extension allows one to create various shortcuts for applications, enabling the ability to have one shortcut that triggers both the launch and focus of an application window.", "uuid": "focus-window@chris.al", "shell-version": [ - "42" + "42", + "43" ], "url": "https://github.com/pcbowers/focus-window", "version": 1 -} +} \ No newline at end of file diff --git a/prefs.js b/prefs.js index bf0eba5..42f3aa9 100644 --- a/prefs.js +++ b/prefs.js @@ -155,11 +155,11 @@ const FocusWidget = GObject.registerClass( this.applicationToFocus.set_selected( this.getAppPositionFromId(this.settings.applicationToFocus) ); - this.titleToMatch.set_text(this.settings.titleToMatch); - this.exactTitleMatch.set_active(this.settings.exactTitleMatch); - this.launchApplication.set_active(this.settings.launchApplication); - this.commandLineArguments.set_text(this.settings.commandLineArguments); - this.keyboardShortcut.set_accelerator(this.settings.keyboardShortcut); + this.titleToMatch.set_text(this.settings.titleToMatch || ""); + this.exactTitleMatch.set_active(this.settings.exactTitleMatch || false); + this.launchApplication.set_active(this.settings.launchApplication || true); + this.commandLineArguments.set_text(this.settings.commandLineArguments || ""); + this.keyboardShortcut.set_accelerator(this.settings.keyboardShortcut || ""); } populateApplications() { @@ -171,7 +171,8 @@ const FocusWidget = GObject.registerClass( name: a.get_name(), id: a.get_id(), position: index + 1, - })); + })) + .sort((a, b) => a.name.toLowerCase() > b.name.toLowerCase()); // make them choosable this.allApplications.forEach((a) => this.applicationList.append(a.name)); @@ -403,8 +404,7 @@ function fillPreferencesWindow(window) { // sets the title and description of group const setTitleAndDescription = () => { group.set_title( - `${focusWidgets.length} Shortcut${ - focusWidgets.length === 1 ? "" : "s Created" + `${focusWidgets.length} Shortcut${focusWidgets.length === 1 ? "" : "s Created" }` ); @@ -416,8 +416,7 @@ function fillPreferencesWindow(window) { ).length; group.set_description( - `${ - configured === focusWidgets.length ? "All" : configured + `${configured === focusWidgets.length ? "All" : configured } of which are fully configured` ); };