MCPcopy
hub / github.com/paperwm/PaperWM / enable

Function enable

keybindings.js:18–41  ·  view source on GitHub ↗
(extension)

Source from the content-addressed store, hash-verified

16
17let keybindSettings;
18export function enable(extension) {
19 // restore previous keybinds (in case failed to restore last time, e.g. gnome crash etc)
20 Settings.updateOverrides();
21
22 keybindSettings = extension.getSettings(KEYBINDINGS_KEY);
23 setupActions(keybindSettings);
24 signals.connect(display, 'accelerator-activated', (display, actionId, deviceId, timestamp) => {
25 handleAccelerator(display, actionId, deviceId, timestamp);
26 });
27 actions.forEach(enableAction);
28 Settings.overrideConflicts();
29
30 let schemas = [...Settings.getConflictSettings(), extension.getSettings(KEYBINDINGS_KEY)];
31 schemas.forEach(schema => {
32 signals.connect(schema, 'changed', (settings, key) => {
33 const numConflicts = Settings.conflictKeyChanged(settings, key);
34 if (numConflicts > 0) {
35 Main.notifyError(
36 `PaperWM: overriding '${key}' keybind`,
37 `this Gnome Keybind will be restored when PaperWM is disabled`);
38 }
39 });
40 });
41}
42
43export function disable() {
44 signals.destroy();

Callers

nothing calls this directly

Calls 3

handleAcceleratorFunction · 0.85
connectMethod · 0.80
setupActionsFunction · 0.70

Tested by

no test coverage detected