const { Gio } = imports.gi; const Debug = imports.src.debug; const { debug } = Debug; const ShellProxyWrapper = Gio.DBusProxy.makeProxyWrapper(` ` ); let shellProxy = new ShellProxyWrapper( Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell' ); function shellWindowEval(fn, isEnabled) { const un = (isEnabled) ? '' : 'un'; debug(`changing ${fn}`); shellProxy.EvalRemote( `global.display.focus_window.${un}${fn}()`, (out) => { const debugMsg = (out[0]) ? `window ${fn}: ${isEnabled}` : new Error(out[1]); debug(debugMsg); } ); }