Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
19 changes: 9 additions & 10 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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));
Expand Down Expand Up @@ -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"
}`
);

Expand All @@ -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`
);
};
Expand Down