[gnome-shell/wip/fmuellner/cleanup-imports] cleanup: Use destructuring for imports from GI



commit fd50b9a45ef8b36f1e0cd59411d68098bb0134b4
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 9 04:21:36 2019 +0100

    cleanup: Use destructuring for imports from GI
    
    This is *much* nicer than repetitive "imports.gi" lines ...
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399

 HACKING.md                               |  4 +---
 js/extensionPrefs/main.js                |  7 +------
 js/gdm/authPrompt.js                     |  5 +----
 js/gdm/loginDialog.js                    | 13 ++-----------
 js/gdm/util.js                           |  4 +---
 js/misc/fileUtils.js                     |  3 +--
 js/misc/ibusManager.js                   |  4 +---
 js/misc/inputMethod.js                   |  5 ++---
 js/misc/introspect.js                    |  5 +----
 js/misc/keyboardManager.js               |  4 +---
 js/misc/loginManager.js                  |  3 +--
 js/misc/modemManager.js                  |  3 +--
 js/misc/objectManager.js                 |  3 +--
 js/misc/systemActions.js                 |  8 +-------
 js/misc/util.js                          |  7 +------
 js/misc/weather.js                       |  5 +----
 js/perf/hwtest.js                        |  5 +----
 js/portalHelper/main.js                  |  8 +-------
 js/ui/accessDialog.js                    |  5 +----
 js/ui/altTab.js                          |  9 +--------
 js/ui/animation.js                       |  4 +---
 js/ui/appDisplay.js                      |  8 +-------
 js/ui/audioDeviceSelection.js            |  7 +------
 js/ui/background.js                      |  7 +------
 js/ui/backgroundMenu.js                  |  3 +--
 js/ui/barLevel.js                        |  4 +---
 js/ui/boxpointer.js                      |  6 +-----
 js/ui/calendar.js                        |  6 +-----
 js/ui/checkBox.js                        |  4 +---
 js/ui/closeDialog.js                     |  7 +------
 js/ui/components/automountManager.js     |  3 +--
 js/ui/components/autorunManager.js       |  3 +--
 js/ui/components/keyring.js              |  8 +-------
 js/ui/components/networkAgent.js         |  8 +-------
 js/ui/components/polkitAgent.js          | 11 ++---------
 js/ui/components/telepathyClient.js      |  9 ++-------
 js/ui/ctrlAltTab.js                      |  5 +----
 js/ui/dash.js                            |  9 ++-------
 js/ui/dateMenu.js                        |  9 ++-------
 js/ui/dialog.js                          |  6 +-----
 js/ui/dnd.js                             | 10 +++-------
 js/ui/edgeDragAction.js                  |  5 +----
 js/ui/endSessionDialog.js                | 10 ++--------
 js/ui/environment.js                     |  5 +----
 js/ui/extensionDownloader.js             |  6 +-----
 js/ui/extensionSystem.js                 |  4 +---
 js/ui/grabHelper.js                      |  3 +--
 js/ui/ibusCandidatePopup.js              |  4 +---
 js/ui/iconGrid.js                        |  5 +----
 js/ui/inhibitShortcutsDialog.js          |  7 +------
 js/ui/kbdA11yDialog.js                   |  5 ++---
 js/ui/keyboard.js                        |  9 ++-------
 js/ui/layout.js                          |  7 +------
 js/ui/lightbox.js                        |  5 +----
 js/ui/lookingGlass.js                    | 23 +++++------------------
 js/ui/magnifier.js                       | 12 ++----------
 js/ui/main.js                            |  7 +------
 js/ui/messageList.js                     |  9 +--------
 js/ui/messageTray.js                     |  8 +-------
 js/ui/modalDialog.js                     |  8 ++------
 js/ui/mpris.js                           |  4 +---
 js/ui/notificationDaemon.js              |  6 +-----
 js/ui/osdMonitorLabeler.js               |  5 +----
 js/ui/osdWindow.js                       |  8 ++------
 js/ui/overview.js                        |  6 +-----
 js/ui/overviewControls.js                |  5 +----
 js/ui/padOsd.js                          | 12 ++----------
 js/ui/pageIndicators.js                  |  4 +---
 js/ui/panel.js                           | 10 +---------
 js/ui/panelMenu.js                       |  5 +----
 js/ui/pointerWatcher.js                  |  3 +--
 js/ui/popupMenu.js                       |  7 +------
 js/ui/remoteSearch.js                    |  6 +-----
 js/ui/runDialog.js                       |  7 +------
 js/ui/screenShield.js                    | 12 ++----------
 js/ui/screencast.js                      |  4 +---
 js/ui/screenshot.js                      |  8 +-------
 js/ui/scripting.js                       |  5 +----
 js/ui/search.js                          |  7 +------
 js/ui/shellDBus.js                       |  5 +----
 js/ui/shellEntry.js                      |  4 +---
 js/ui/shellMountOperation.js             |  7 +------
 js/ui/slider.js                          |  3 +--
 js/ui/status/accessibility.js            |  5 +----
 js/ui/status/bluetooth.js                |  3 +--
 js/ui/status/brightness.js               |  3 +--
 js/ui/status/keyboard.js                 | 11 ++---------
 js/ui/status/location.js                 |  5 +----
 js/ui/status/network.js                  |  7 +------
 js/ui/status/power.js                    |  5 +----
 js/ui/status/system.js                   |  8 +-------
 js/ui/status/thunderbolt.js              |  5 +----
 js/ui/status/volume.js                   |  5 +----
 js/ui/switchMonitor.js                   |  5 +----
 js/ui/switcherPopup.js                   |  6 +-----
 js/ui/tweener.js                         |  5 +----
 js/ui/unlockDialog.js                    | 11 ++---------
 js/ui/userWidget.js                      |  5 +----
 js/ui/viewSelector.js                    |  7 +------
 js/ui/windowManager.js                   |  8 +-------
 js/ui/windowMenu.js                      |  3 +--
 js/ui/workspace.js                       |  9 +--------
 js/ui/workspaceSwitcherPopup.js          |  6 +-----
 js/ui/workspaceThumbnail.js              |  8 +-------
 js/ui/workspacesView.js                  |  6 +-----
 js/ui/xdndHandler.js                     |  6 +++---
 tests/interactive/background-repeat.js   |  3 +--
 tests/interactive/background-size.js     |  4 +---
 tests/interactive/border-radius.js       |  3 +--
 tests/interactive/border-width.js        |  3 +--
 tests/interactive/borders.js             |  3 +--
 tests/interactive/box-layout.js          |  3 +--
 tests/interactive/box-shadow-animated.js |  4 +---
 tests/interactive/box-shadows.js         |  3 +--
 tests/interactive/calendar.js            |  3 +--
 tests/interactive/css-fonts.js           |  3 +--
 tests/interactive/entry.js               |  3 +--
 tests/interactive/gapplication.js        |  9 ++-------
 tests/interactive/icons.js               |  3 +--
 tests/interactive/inline-style.js        |  3 +--
 tests/interactive/scroll-view-sizing.js  |  6 +-----
 tests/interactive/scrolling.js           |  4 +---
 tests/interactive/transitions.js         |  3 +--
 tests/testcommon/ui.js                   |  8 ++------
 124 files changed, 150 insertions(+), 595 deletions(-)
---
diff --git a/HACKING.md b/HACKING.md
index f1b3d3765..a9a92ea8d 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -80,9 +80,7 @@ e.g. `imports.ui.popupMenu`.
 Each import block should be sorted alphabetically. Don't import modules you
 don't use.
 ```javascript
-    const GLib = imports.gi.GLib;
-    const Gio = imports.gi.Gio;
-    const St = imports.gi.St;
+    const { GLib, Gio, St } = imports.gi;
 
     const Main = imports.ui.main;
     const Params = imports.misc.params;
diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js
index bfa820b59..438788f1d 100644
--- a/js/extensionPrefs/main.js
+++ b/js/extensionPrefs/main.js
@@ -1,10 +1,5 @@
 const Gettext = imports.gettext;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Gio = imports.gi.Gio;
-const Gtk = imports.gi.Gtk;
-const Gdk = imports.gi.Gdk;
-const Pango = imports.gi.Pango;
+const { Gdk, GLib, Gio, GObject, Gtk, Pango } = imports.gi;
 const Format = imports.format;
 
 const _ = Gettext.gettext;
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index ecd47bffd..d7f53a92e 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -1,15 +1,12 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Pango = imports.gi.Pango;
+const { Clutter, Pango, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const Animation = imports.ui.animation;
 const Batch = imports.gdm.batch;
 const GdmUtil = imports.gdm.util;
 const Params = imports.misc.params;
-const Shell = imports.gi.Shell;
 const ShellEntry = imports.ui.shellEntry;
 const Tweener = imports.ui.tweener;
 const UserWidget = imports.ui.userWidget;
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index dc125c213..8ea1a86a2 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -16,18 +16,9 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-const AccountsService = imports.gi.AccountsService;
-const Atk = imports.gi.Atk;
-const Clutter = imports.gi.Clutter;
-const Gdm = imports.gi.Gdm;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const Pango = imports.gi.Pango;
-const Shell = imports.gi.Shell;
+const { AccountsService, Atk, Clutter, Gdm, Gio,
+        GLib, GObject, Meta, Pango, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const AuthPrompt = imports.gdm.authPrompt;
 const Batch = imports.gdm.batch;
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 6599b7f7d..2e9935250 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -1,8 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
+const { Clutter, Gio, GLib } = imports.gi;
 const Signals = imports.signals;
 
 const Batch = imports.gdm.batch;
diff --git a/js/misc/fileUtils.js b/js/misc/fileUtils.js
index a2281a9b6..64884162d 100644
--- a/js/misc/fileUtils.js
+++ b/js/misc/fileUtils.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
+const { Gio, GLib } = imports.gi;
 const Config = imports.misc.config;
 
 function collectFromDatadirs(subdir, includeUserDir, processFile) {
diff --git a/js/misc/ibusManager.js b/js/misc/ibusManager.js
index fe86a8326..d20ad2f32 100644
--- a/js/misc/ibusManager.js
+++ b/js/misc/ibusManager.js
@@ -1,11 +1,9 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
+const { Gio, GLib, IBus } = imports.gi;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
 
-const IBus = imports.gi.IBus;
 const IBusCandidatePopup = imports.ui.ibusCandidatePopup;
 
 // Ensure runtime version matches
diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js
index bd239e556..ce2002a09 100644
--- a/js/misc/inputMethod.js
+++ b/js/misc/inputMethod.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
-const IBus = imports.gi.IBus;
+const { Clutter, GObject, IBus } = imports.gi;
+
 const Keyboard = imports.ui.status.keyboard;
 
 var InputMethod = GObject.registerClass(
diff --git a/js/misc/introspect.js b/js/misc/introspect.js
index b9b0a987b..f7a7f2fe6 100644
--- a/js/misc/introspect.js
+++ b/js/misc/introspect.js
@@ -1,7 +1,4 @@
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
+const { Gio, GLib, Meta, Shell } = imports.gi;
 
 const INTROSPECT_SCHEMA = 'org.gnome.shell';
 const INTROSPECT_KEY = 'introspect';
diff --git a/js/misc/keyboardManager.js b/js/misc/keyboardManager.js
index 5d720e88a..99e100231 100644
--- a/js/misc/keyboardManager.js
+++ b/js/misc/keyboardManager.js
@@ -1,8 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GLib = imports.gi.GLib;
-const GnomeDesktop = imports.gi.GnomeDesktop;
-const Meta = imports.gi.Meta;
+const { GLib, GnomeDesktop, Meta } = imports.gi;
 
 const Main = imports.ui.main;
 
diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
index 30b0e7bd7..f615b4f99 100644
--- a/js/misc/loginManager.js
+++ b/js/misc/loginManager.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
+const { GLib, Gio } = imports.gi;
 const Signals = imports.signals;
 
 const { loadInterfaceXML } = imports.misc.fileUtils;
diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js
index 82849ba1e..7c6c39a73 100644
--- a/js/misc/modemManager.js
+++ b/js/misc/modemManager.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const NMA = imports.gi.NMA;
+const { Gio, NMA } = imports.gi;
 const Signals = imports.signals;
 
 const { loadInterfaceXML } = imports.misc.fileUtils;
diff --git a/js/misc/objectManager.js b/js/misc/objectManager.js
index a708ac818..56b4cc9b4 100644
--- a/js/misc/objectManager.js
+++ b/js/misc/objectManager.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
+const { Gio, GLib } = imports.gi;
 const Params = imports.misc.params;
 const Signals = imports.signals;
 
diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js
index 8b2175e04..aa79bfe54 100644
--- a/js/misc/systemActions.js
+++ b/js/misc/systemActions.js
@@ -1,10 +1,4 @@
-const AccountsService = imports.gi.AccountsService;
-const Clutter = imports.gi.Clutter;
-const Gdm = imports.gi.Gdm;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Meta = imports.gi.Meta;
-const GObject = imports.gi.GObject;
+const { AccountsService, Clutter, Gdm, Gio, GLib, GObject, Meta } = imports.gi;
 
 const GnomeSession = imports.misc.gnomeSession;
 const LoginManager = imports.misc.loginManager;
diff --git a/js/misc/util.js b/js/misc/util.js
index c5b22dccf..a8bea649f 100644
--- a/js/misc/util.js
+++ b/js/misc/util.js
@@ -1,14 +1,9 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
+const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
 const Gettext = imports.gettext;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
 
 const Main = imports.ui.main;
 const Tweener = imports.ui.tweener;
diff --git a/js/misc/weather.js b/js/misc/weather.js
index 5e0ce315e..aaec36cf4 100644
--- a/js/misc/weather.js
+++ b/js/misc/weather.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Geoclue = imports.gi.Geoclue;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GWeather = imports.gi.GWeather;
+const { Geoclue, Gio, GLib, GWeather } = imports.gi;
 const Signals = imports.signals;
 
 const PermissionStore = imports.misc.permissionStore;
diff --git a/js/perf/hwtest.js b/js/perf/hwtest.js
index 86e3d6f70..d5b417da3 100644
--- a/js/perf/hwtest.js
+++ b/js/perf/hwtest.js
@@ -1,9 +1,6 @@
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const Gtk = imports.gi.Gtk;
+const { Clutter, Gio, Gtk, Shell } = imports.gi;
 const Main = imports.ui.main;
 const Scripting = imports.ui.scripting;
-const Shell = imports.gi.Shell;
 
 let METRICS = {
     timeToDesktop:
diff --git a/js/portalHelper/main.js b/js/portalHelper/main.js
index cbc29d056..e163d6574 100644
--- a/js/portalHelper/main.js
+++ b/js/portalHelper/main.js
@@ -1,12 +1,6 @@
 const Format = imports.format;
 const Gettext = imports.gettext;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Gio = imports.gi.Gio;
-const Gtk = imports.gi.Gtk;
-const Pango = imports.gi.Pango;
-const Soup = imports.gi.Soup;
-const WebKit = imports.gi.WebKit2;
+const { Gio, GLib, GObject, Gtk, Pango, Soup, WebKit2: WebKit } = imports.gi;
 
 const _ = Gettext.gettext;
 
diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js
index 59a0495aa..69ba42c8d 100644
--- a/js/ui/accessDialog.js
+++ b/js/ui/accessDialog.js
@@ -1,7 +1,4 @@
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Shell = imports.gi.Shell;
+const { Clutter, Gio, GLib, Shell } = imports.gi;
 
 const CheckBox = imports.ui.checkBox;
 const Dialog = imports.ui.dialog;
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index d2162f858..cdd5d8e21 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -1,14 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Atk, Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
-const Atk = imports.gi.Atk;
 
 const Main = imports.ui.main;
 const SwitcherPopup = imports.ui.switcherPopup;
diff --git a/js/ui/animation.js b/js/ui/animation.js
index 96d33c96f..470a6ffbb 100644
--- a/js/ui/animation.js
+++ b/js/ui/animation.js
@@ -1,9 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
+const { GLib, Gio, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const St = imports.gi.St;
 
 const Tweener = imports.ui.tweener;
 
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 4494a6b69..adaefa7dd 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1,13 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Shell = imports.gi.Shell;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
 const Mainloop = imports.mainloop;
 
 const AppFavorites = imports.ui.appFavorites;
diff --git a/js/ui/audioDeviceSelection.js b/js/ui/audioDeviceSelection.js
index b10eb7d3e..25fde891f 100644
--- a/js/ui/audioDeviceSelection.js
+++ b/js/ui/audioDeviceSelection.js
@@ -1,9 +1,4 @@
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
 
 const Main = imports.ui.main;
 const ModalDialog = imports.ui.modalDialog;
diff --git a/js/ui/background.js b/js/ui/background.js
index 874bda390..bcd9ffc13 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -93,12 +93,7 @@
 //     MetaBackgroundImage         MetaBackgroundImage
 //     MetaBackgroundImage         MetaBackgroundImage
 
-const Clutter = imports.gi.Clutter;
-const GDesktopEnums = imports.gi.GDesktopEnums;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GnomeDesktop = imports.gi.GnomeDesktop;
-const Meta = imports.gi.Meta;
+const { Clutter, GDesktopEnums, Gio, GLib, GnomeDesktop, Meta } = imports.gi;
 const Signals = imports.signals;
 
 const LoginManager = imports.misc.loginManager;
diff --git a/js/ui/backgroundMenu.js b/js/ui/backgroundMenu.js
index 69886ed51..7d3941bc7 100644
--- a/js/ui/backgroundMenu.js
+++ b/js/ui/backgroundMenu.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 const BoxPointer = imports.ui.boxpointer;
 const Main = imports.ui.main;
diff --git a/js/ui/barLevel.js b/js/ui/barLevel.js
index 0c32ee5a8..d8d37369d 100644
--- a/js/ui/barLevel.js
+++ b/js/ui/barLevel.js
@@ -1,8 +1,6 @@
 /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
 
-const Atk = imports.gi.Atk;
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Atk, Clutter, St } = imports.gi;
 const Signals = imports.signals;
 
 var BarLevel = class {
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 35d191342..3387b31bb 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -1,10 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Clutter, GObject, Meta, Shell, St } = imports.gi;
 
 const Main = imports.ui.main;
 const Tweener = imports.ui.tweener;
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 32a99344c..28e0d86d2 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1,11 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const St = imports.gi.St;
+const { Clutter, Gio, GLib, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Shell = imports.gi.Shell;
 
 const Main = imports.ui.main;
 const MessageList = imports.ui.messageList;
diff --git a/js/ui/checkBox.js b/js/ui/checkBox.js
index 2d3787b70..deaa34ab7 100644
--- a/js/ui/checkBox.js
+++ b/js/ui/checkBox.js
@@ -1,6 +1,4 @@
-const Clutter = imports.gi.Clutter;
-const Pango = imports.gi.Pango;
-const St = imports.gi.St;
+const { Clutter, Pango, St } = imports.gi;
 
 var CheckBox = class CheckBox {
     constructor(label) {
diff --git a/js/ui/closeDialog.js b/js/ui/closeDialog.js
index f90d25f8e..ee2045ec7 100644
--- a/js/ui/closeDialog.js
+++ b/js/ui/closeDialog.js
@@ -1,11 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
+const { Clutter, Gio, GLib, GObject, Meta, Shell } = imports.gi;
 
 const Dialog = imports.ui.dialog;
 const Main = imports.ui.main;
diff --git a/js/ui/components/automountManager.js b/js/ui/components/automountManager.js
index 1bfadd2ca..01e8f1e71 100644
--- a/js/ui/components/automountManager.js
+++ b/js/ui/components/automountManager.js
@@ -1,8 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const { Gio, GLib } = imports.gi;
 const Mainloop = imports.mainloop;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
 const Params = imports.misc.params;
 
 const GnomeSession = imports.misc.gnomeSession;
diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js
index 20499daee..34c7d6250 100644
--- a/js/ui/components/autorunManager.js
+++ b/js/ui/components/autorunManager.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const St = imports.gi.St;
+const { Gio, St } = imports.gi;
 
 const GnomeSession = imports.misc.gnomeSession;
 const Main = imports.ui.main;
diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js
index 4801e3d90..0d9f1e466 100644
--- a/js/ui/components/keyring.js
+++ b/js/ui/components/keyring.js
@@ -1,12 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Shell = imports.gi.Shell;
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
-const Pango = imports.gi.Pango;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
-const Gcr = imports.gi.Gcr;
+const { Clutter, Gcr, Gio, GObject, Pango, Shell, St } = imports.gi;
 
 const Animation = imports.ui.animation;
 const Dialog = imports.ui.dialog;
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 9bc9037a5..f871c732d 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -1,13 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const NM = imports.gi.NM;
-const Pango = imports.gi.Pango;
-const Shell = imports.gi.Shell;
+const { Clutter, Gio, GLib, NM, Pango, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const Config = imports.misc.config;
 const Dialog = imports.ui.dialog;
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index cf5759112..21feb4090 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -1,15 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const { AccountsService, Clutter, Gio, GLib,
+        Pango, PolkitAgent, Polkit, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Shell = imports.gi.Shell;
-const AccountsService = imports.gi.AccountsService;
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
-const Pango = imports.gi.Pango;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
-const Polkit = imports.gi.Polkit;
-const PolkitAgent = imports.gi.PolkitAgent;
 
 const Animation = imports.ui.animation;
 const Dialog = imports.ui.dialog;
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index d7221b168..1df865f30 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -1,18 +1,13 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Clutter, Gio, GLib, GObject, St } = imports.gi;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
-const St = imports.gi.St;
 
 var Tpl = null;
 var Tp = null;
 try {
-    Tpl = imports.gi.TelepathyLogger;
-    Tp = imports.gi.TelepathyGLib;
+    ({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
 } catch(e) {
     log('Telepathy is not available, chat integration will be disabled.');
 }
diff --git a/js/ui/ctrlAltTab.js b/js/ui/ctrlAltTab.js
index 302aaeda5..4415f6d7a 100644
--- a/js/ui/ctrlAltTab.js
+++ b/js/ui/ctrlAltTab.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Clutter, Meta, Shell, St } = imports.gi;
 
 const Main = imports.ui.main;
 const SwitcherPopup = imports.ui.switcherPopup;
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 921b1d783..e60cdd8ad 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -1,13 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Signals = imports.signals;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
+const Signals = imports.signals;
 
 const AppDisplay = imports.ui.appDisplay;
 const AppFavorites = imports.ui.appFavorites;
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 9e21bd232..c29d33719 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GLib = imports.gi.GLib;
-const GnomeDesktop = imports.gi.GnomeDesktop;
-const GObject = imports.gi.GObject;
-const GWeather = imports.gi.GWeather;
-const Clutter = imports.gi.Clutter;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Clutter, GLib, GnomeDesktop,
+        GObject, GWeather, Shell, St } = imports.gi;
 
 const Util = imports.misc.util;
 const Main = imports.ui.main;
diff --git a/js/ui/dialog.js b/js/ui/dialog.js
index f9d116eee..809acffbb 100644
--- a/js/ui/dialog.js
+++ b/js/ui/dialog.js
@@ -1,10 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
-const Pango = imports.gi.Pango;
-const St = imports.gi.St;
+const { Clutter, Gio, GObject, Pango, St } = imports.gi;
 
 var Dialog = GObject.registerClass(
 class Dialog extends St.Widget {
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index c5a1c0517..554e87773 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -1,15 +1,11 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const St = imports.gi.St;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
+const { Clutter, GLib, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Tweener = imports.ui.tweener;
-const Main = imports.ui.main;
 
+const Main = imports.ui.main;
 const Params = imports.misc.params;
+const Tweener = imports.ui.tweener;
 
 // Time to scale down to maxDragActorSize
 var SCALE_ANIMATION_TIME = 0.25;
diff --git a/js/ui/edgeDragAction.js b/js/ui/edgeDragAction.js
index 007921d89..e811dda21 100644
--- a/js/ui/edgeDragAction.js
+++ b/js/ui/edgeDragAction.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, GObject, Meta, St } = imports.gi;
 
 const Main = imports.ui.main;
 
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index bab712e27..0d4aa9d4d 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -18,14 +18,8 @@
 
 const Mainloop = imports.mainloop;
 
-const AccountsService = imports.gi.AccountsService;
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Pango = imports.gi.Pango;
-const Polkit = imports.gi.Polkit;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
+const { AccountsService, Clutter, Gio,
+        GLib, Pango, Polkit, Shell, St }  = imports.gi;
 
 const CheckBox = imports.ui.checkBox;
 const GnomeSession = imports.misc.gnomeSession;
diff --git a/js/ui/environment.js b/js/ui/environment.js
index 7c239408b..e22ec7402 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -9,11 +9,8 @@ imports.gi.versions.Gtk = '3.0';
 imports.gi.versions.TelepathyGLib = '0.12';
 imports.gi.versions.TelepathyLogger = '0.2';
 
-const Clutter = imports.gi.Clutter;
+const { Clutter, GLib, Shell, St } = imports.gi;
 const Gettext = imports.gettext;
-const GLib = imports.gi.GLib;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
 
 // We can't import shell JS modules yet, because they may have
 // variable initializations, etc, that depend on init() already having
diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js
index 642be51ee..9aed29c69 100644
--- a/js/ui/extensionDownloader.js
+++ b/js/ui/extensionDownloader.js
@@ -1,10 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
-const Soup = imports.gi.Soup;
-const St = imports.gi.St;
+const { Clutter, Gio, GLib, Soup, St } = imports.gi;
 
 const Config = imports.misc.config;
 const ExtensionUtils = imports.misc.extensionUtils;
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 18c046cc5..6244c39b4 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -1,10 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const { Gio, St } = imports.gi;
 const Signals = imports.signals;
 
-const Gio = imports.gi.Gio;
-const St = imports.gi.St;
-
 const ExtensionUtils = imports.misc.extensionUtils;
 const Main = imports.ui.main;
 
diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js
index 55e82a829..4ba0b1b56 100644
--- a/js/ui/grabHelper.js
+++ b/js/ui/grabHelper.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 const Main = imports.ui.main;
 const Params = imports.misc.params;
diff --git a/js/ui/ibusCandidatePopup.js b/js/ui/ibusCandidatePopup.js
index 5bea99824..20d76fd86 100644
--- a/js/ui/ibusCandidatePopup.js
+++ b/js/ui/ibusCandidatePopup.js
@@ -1,9 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const IBus = imports.gi.IBus;
+const { Clutter, IBus, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const BoxPointer = imports.ui.boxpointer;
 const Main = imports.ui.main;
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index cd91e0c62..789a834f9 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
+const { Clutter, GObject, Meta, St } = imports.gi;
 
 const Params = imports.misc.params;
 const Tweener = imports.ui.tweener;
diff --git a/js/ui/inhibitShortcutsDialog.js b/js/ui/inhibitShortcutsDialog.js
index dc1d5a319..46e760a98 100644
--- a/js/ui/inhibitShortcutsDialog.js
+++ b/js/ui/inhibitShortcutsDialog.js
@@ -1,9 +1,4 @@
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
-const Gtk = imports.gi.Gtk;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
+const { Clutter, Gio, GObject, Gtk, Meta, Shell } = imports.gi;
 
 const Dialog = imports.ui.dialog;
 const ModalDialog = imports.ui.modalDialog;
diff --git a/js/ui/kbdA11yDialog.js b/js/ui/kbdA11yDialog.js
index c09466b4f..b9d005fe7 100644
--- a/js/ui/kbdA11yDialog.js
+++ b/js/ui/kbdA11yDialog.js
@@ -1,6 +1,5 @@
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
+const { Clutter, Gio, GObject } = imports.gi;
+
 const Dialog = imports.ui.dialog;
 const ModalDialog = imports.ui.modalDialog;
 
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index cc42e1c8a..c8eb29719 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1,14 +1,9 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
+const { Clutter, Gio, GLib, GObject, Meta, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
-const InputSourceManager = imports.ui.status.keyboard;
 
+const InputSourceManager = imports.ui.status.keyboard;
 const IBusManager = imports.misc.ibusManager;
 const BoxPointer = imports.ui.boxpointer;
 const Layout = imports.ui.layout;
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 5bf3ec573..c25cd474d 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
+const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const Background = imports.ui.background;
 const BackgroundMenu = imports.ui.backgroundMenu;
diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js
index 7a702883a..c7e4d51f2 100644
--- a/js/ui/lightbox.js
+++ b/js/ui/lightbox.js
@@ -1,10 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
+const { Clutter, GObject, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
 
 const Params = imports.misc.params;
 const Tweener = imports.ui.tweener;
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 185ed421a..e839ad75e 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -1,16 +1,9 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Cogl = imports.gi.Cogl;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const Pango = imports.gi.Pango;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
-const Signals = imports.signals;
+const { Clutter, Cogl, Gio, GLib,
+        GObject, Meta, Pango, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
+const Signals = imports.signals;
 const System = imports.system;
 
 const History = imports.misc.history;
@@ -24,15 +17,9 @@ const JsParse = imports.misc.jsParse;
 const CHEVRON = '>>> ';
 
 /* Imports...feel free to add here as needed */
-var commandHeader = 'const Clutter = imports.gi.Clutter; ' +
-                    'const GLib = imports.gi.GLib; ' +
-                    'const GObject = imports.gi.GObject; ' +
-                    'const Gio = imports.gi.Gio; ' +
-                    'const Gtk = imports.gi.Gtk; ' +
-                    'const Mainloop = imports.mainloop; ' +
-                    'const Meta = imports.gi.Meta; ' +
-                    'const Shell = imports.gi.Shell; ' +
+var commandHeader = 'const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell } = imports.gi; ' +
                     'const Main = imports.ui.main; ' +
+                    'const Mainloop = imports.mainloop; ' +
                     'const Tweener = imports.ui.tweener; ' +
                     /* Utility functions...we should probably be able to use these
                      * in the shell core code too. */
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index b33c300c6..753151ac9 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -1,16 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Atspi = imports.gi.Atspi;
-const Clutter = imports.gi.Clutter;
-const Cogl = imports.gi.Cogl;
-const GDesktopEnums = imports.gi.GDesktopEnums;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Atspi, Clutter, Cogl, GDesktopEnums,
+        Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
 const Signals = imports.signals;
 
 const Background = imports.ui.background;
diff --git a/js/ui/main.js b/js/ui/main.js
index 5d5b9dfc6..f9556f14d 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
+const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
 
 const AccessDialog = imports.ui.accessDialog;
 const AudioDeviceSelection = imports.ui.audioDeviceSelection;
diff --git a/js/ui/messageList.js b/js/ui/messageList.js
index 29bf1c4e8..bd97ffcb0 100644
--- a/js/ui/messageList.js
+++ b/js/ui/messageList.js
@@ -1,14 +1,7 @@
-const Atk = imports.gi.Atk;
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Atk, Clutter, Gio, GLib, GObject, Meta, Pango, St } = imports.gi;
 const Main = imports.ui.main;
 const MessageTray = imports.ui.messageTray;
-const Meta = imports.gi.Meta;
-const Pango = imports.gi.Pango;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const Calendar = imports.ui.calendar;
 const Tweener = imports.ui.tweener;
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 43b787790..dcba4788f 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1,14 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const Calendar = imports.ui.calendar;
 const GnomeSession = imports.misc.gnomeSession;
diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index b9cc11a8c..258e3b0a1 100644
--- a/js/ui/modalDialog.js
+++ b/js/ui/modalDialog.js
@@ -1,17 +1,13 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
+const { Atk, Clutter, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Atk = imports.gi.Atk;
-
-const Params = imports.misc.params;
 
 const Dialog = imports.ui.dialog;
 const Layout = imports.ui.layout;
 const Lightbox = imports.ui.lightbox;
 const Main = imports.ui.main;
+const Params = imports.misc.params;
 const Tweener = imports.ui.tweener;
 
 var OPEN_AND_CLOSE_TIME = 0.1;
diff --git a/js/ui/mpris.js b/js/ui/mpris.js
index 4968b4e7a..e900bceb8 100644
--- a/js/ui/mpris.js
+++ b/js/ui/mpris.js
@@ -1,7 +1,5 @@
-const Gio = imports.gi.Gio;
+const { Gio, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
 
 const Calendar = imports.ui.calendar;
 const Main = imports.ui.main;
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index df53962f9..4bdede841 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -1,11 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GdkPixbuf = imports.gi.GdkPixbuf;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Shell = imports.gi.Shell;
+const { GdkPixbuf, Gio, GLib, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const St = imports.gi.St;
 
 const Config = imports.misc.config;
 const Main = imports.ui.main;
diff --git a/js/ui/osdMonitorLabeler.js b/js/ui/osdMonitorLabeler.js
index 3c8d49318..55b4d3c21 100644
--- a/js/ui/osdMonitorLabeler.js
+++ b/js/ui/osdMonitorLabeler.js
@@ -1,11 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const St = imports.gi.St;
+const { Clutter, Gio, Meta, St } = imports.gi;
 
 const Main = imports.ui.main;
-const Meta = imports.gi.Meta;
 
 var FADE_TIME = 0.1;
 
diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js
index 018d4f660..abf8c27cc 100644
--- a/js/ui/osdWindow.js
+++ b/js/ui/osdWindow.js
@@ -1,16 +1,12 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const St = imports.gi.St;
+const { Clutter, GLib, GObject, Meta, St } = imports.gi;
+const Mainloop = imports.mainloop;
 
 const BarLevel = imports.ui.barLevel;
 const Layout = imports.ui.layout;
 const Main = imports.ui.main;
-const Mainloop = imports.mainloop;
 const Tweener = imports.ui.tweener;
-const Meta = imports.gi.Meta;
 
 var HIDE_TIMEOUT = 1500;
 var FADE_TIME = 0.1;
diff --git a/js/ui/overview.js b/js/ui/overview.js
index fc8b3671e..dc6ad1821 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -1,12 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const Meta = imports.gi.Meta;
+const { Clutter, GLib, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
 
 const Background = imports.ui.background;
 const DND = imports.ui.dnd;
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 129eb5166..5b95b749d 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GObject = imports.gi.GObject;
-const Clutter = imports.gi.Clutter;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
+const { Clutter, GObject, Meta, St } = imports.gi;
 
 const Dash = imports.ui.dash;
 const Main = imports.ui.main;
diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js
index 101531295..760f48a37 100644
--- a/js/ui/padOsd.js
+++ b/js/ui/padOsd.js
@@ -1,15 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Meta = imports.gi.Meta;
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
-const Rsvg = imports.gi.Rsvg;
-const GObject = imports.gi.GObject;
-const GLib = imports.gi.GLib;
-const Gtk = imports.gi.Gtk;
-const Gio = imports.gi.Gio;
-const GDesktopEnums = imports.gi.GDesktopEnums;
-const Atk = imports.gi.Atk;
+const { Atk, Clutter, GDesktopEnums, Gio,
+        GLib, GObject, Gtk, Meta, Rsvg, St } = imports.gi;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
diff --git a/js/ui/pageIndicators.js b/js/ui/pageIndicators.js
index 43e6fcf4b..8a1202c80 100644
--- a/js/ui/pageIndicators.js
+++ b/js/ui/pageIndicators.js
@@ -1,8 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
-const St = imports.gi.St;
+const { Clutter, GObject, St } = imports.gi;
 
 const Tweener = imports.ui.tweener;
 const { ANIMATION_TIME_OUT, ANIMATION_MAX_DELAY_OUT_FOR_ITEM, AnimationDirection } = imports.ui.iconGrid;
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 6026c8a9e..d719c841e 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -1,16 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const { Atk, Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St } = imports.gi;
 const Cairo = imports.cairo;
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Gtk = imports.gi.Gtk;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
-const Atk = imports.gi.Atk;
 
 const Animation = imports.ui.animation;
 const Config = imports.misc.config;
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 9cdbb1066..bafafc11e 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -1,10 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
+const { Atk, Clutter, GObject, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
-const Atk = imports.gi.Atk;
 
 const Main = imports.ui.main;
 const Params = imports.misc.params;
diff --git a/js/ui/pointerWatcher.js b/js/ui/pointerWatcher.js
index 8bc5771b7..d1722bdaa 100644
--- a/js/ui/pointerWatcher.js
+++ b/js/ui/pointerWatcher.js
@@ -1,8 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GLib = imports.gi.GLib;
+const { GLib, Meta } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
 
 // We stop polling if the user is idle for more than this amount of time
 var IDLE_TIME = 1000;
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index a824eaecc..843af8223 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
-const Shell = imports.gi.Shell;
+const { Atk, Clutter, Gio, GObject, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
-const Atk = imports.gi.Atk;
 
 const BoxPointer = imports.ui.boxpointer;
 const GrabHelper = imports.ui.grabHelper;
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index b7abb9c77..1b9186bdc 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -1,10 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const GdkPixbuf = imports.gi.GdkPixbuf;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
+const { GdkPixbuf, Gio, GLib, Shell, St } = imports.gi;
 
 const FileUtils = imports.misc.fileUtils;
 
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index 3906e6d21..49f14026f 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -1,11 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
+const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index fe63b864a..3f45b8acf 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -1,18 +1,10 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const AccountsService = imports.gi.AccountsService;
+const { AccountsService, Clutter, Cogl, Gio, GLib,
+        GnomeDesktop, GObject, Meta, Shell, St } = imports.gi;
 const Cairo = imports.cairo;
-const Cogl = imports.gi.Cogl;
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GnomeDesktop = imports.gi.GnomeDesktop;
-const GObject = imports.gi.GObject;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
 const Signals = imports.signals;
-const St = imports.gi.St;
 const TweenerEquations = imports.tweener.equations;
 
 const Background = imports.ui.background;
diff --git a/js/ui/screencast.js b/js/ui/screencast.js
index 2d99c711a..0b0b14a8e 100644
--- a/js/ui/screencast.js
+++ b/js/ui/screencast.js
@@ -1,8 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Shell = imports.gi.Shell;
+const { Gio, GLib, Shell } = imports.gi;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index a314dfcea..926153514 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -1,13 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Gtk = imports.gi.Gtk;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
+const { Clutter, Gio, GLib, Gtk, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const GrabHelper = imports.ui.grabHelper;
 const Lightbox = imports.ui.lightbox;
diff --git a/js/ui/scripting.js b/js/ui/scripting.js
index 495319591..01bc2dd38 100644
--- a/js/ui/scripting.js
+++ b/js/ui/scripting.js
@@ -1,10 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
+const { Gio, GLib, Meta, Shell } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
 
 const Main = imports.ui.main;
 const Params = imports.misc.params;
diff --git a/js/ui/search.js b/js/ui/search.js
index 2a8415e29..fe4f6162b 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
+const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
 
 const AppDisplay = imports.ui.appDisplay;
 const IconGrid = imports.ui.iconGrid;
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index 05ac14fc9..73d74becf 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -1,10 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
+const { Gio, GLib, Meta, Shell } = imports.gi;
 const Lang = imports.lang;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
 
 const Config = imports.misc.config;
 const ExtensionSystem = imports.ui.extensionSystem;
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
index d16de9286..79f1aad3e 100644
--- a/js/ui/shellEntry.js
+++ b/js/ui/shellEntry.js
@@ -1,13 +1,11 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, Shell, St } = imports.gi;
 
 const BoxPointer = imports.ui.boxpointer;
 const Main = imports.ui.main;
 const Params = imports.misc.params;
 const PopupMenu = imports.ui.popupMenu;
-const Shell = imports.gi.Shell;
 
 var EntryMenu = class extends PopupMenu.PopupMenu {
     constructor(entry) {
diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js
index 4445ae12d..f976f400f 100644
--- a/js/ui/shellMountOperation.js
+++ b/js/ui/shellMountOperation.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
+const { Clutter, Gio, GLib, Pango, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Pango = imports.gi.Pango;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
 
 const CheckBox = imports.ui.checkBox;
 const Dialog = imports.ui.dialog;
diff --git a/js/ui/slider.js b/js/ui/slider.js
index 19e634e7b..f9fa7320b 100644
--- a/js/ui/slider.js
+++ b/js/ui/slider.js
@@ -1,7 +1,6 @@
 /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
 
-const Atk = imports.gi.Atk;
-const Clutter = imports.gi.Clutter;
+const { Atk, Clutter } = imports.gi;
 const Signals = imports.signals;
 
 const BarLevel = imports.ui.barLevel;
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
index 5072913d2..10223ec84 100644
--- a/js/ui/status/accessibility.js
+++ b/js/ui/status/accessibility.js
@@ -1,10 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Gio, GLib, GObject, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const St = imports.gi.St;
 
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js
index f41be7250..6282234ca 100644
--- a/js/ui/status/bluetooth.js
+++ b/js/ui/status/bluetooth.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const GnomeBluetooth = imports.gi.GnomeBluetooth;
+const { Gio, GnomeBluetooth } = imports.gi;
 
 const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
diff --git a/js/ui/status/brightness.js b/js/ui/status/brightness.js
index e45cf67c5..025f29908 100644
--- a/js/ui/status/brightness.js
+++ b/js/ui/status/brightness.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const St = imports.gi.St;
+const { Gio, St } = imports.gi;
 
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 7f830b6df..c93906585 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -1,15 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const IBus = imports.gi.IBus;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
-const Signals = imports.signals;
-const St = imports.gi.St;
+const { Clutter, Gio, GLib, GObject, IBus, Meta, Shell, St } = imports.gi;
 const Gettext = imports.gettext;
+const Signals = imports.signals;
 
 const IBusManager = imports.misc.ibusManager;
 const KeyboardManager = imports.misc.keyboardManager;
diff --git a/js/ui/status/location.js b/js/ui/status/location.js
index 07474f536..f030ae81b 100644
--- a/js/ui/status/location.js
+++ b/js/ui/status/location.js
@@ -1,8 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
+const { Clutter, Gio, GLib, Shell } = imports.gi;
 
 const Dialog = imports.ui.dialog;
 const Main = imports.ui.main;
@@ -10,7 +8,6 @@ const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
 const ModalDialog = imports.ui.modalDialog;
 const PermissionStore = imports.misc.permissionStore;
-const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 
 const { loadInterfaceXML } = imports.misc.fileUtils;
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index c2c7a3dc5..21cbeac61 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const Gio = imports.gi.Gio;
+const { Clutter, Gio, GLib, GObject, NM, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const NM = imports.gi.NM;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const Animation = imports.ui.animation;
 const Main = imports.ui.main;
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 6ffd24e04..3279811da 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Gio = imports.gi.Gio;
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
-const UPower = imports.gi.UPowerGlib;
+const { Clutter, Gio, St, UPowerGlib: UPower } = imports.gi;
 
 const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
diff --git a/js/ui/status/system.js b/js/ui/status/system.js
index bbbc44ea1..e06f17920 100644
--- a/js/ui/status/system.js
+++ b/js/ui/status/system.js
@@ -1,12 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const AccountsService = imports.gi.AccountsService;
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
-const GObject = imports.gi.GObject;
+const { AccountsService, Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
 
 const BoxPointer = imports.ui.boxpointer;
 const SystemActions = imports.misc.systemActions;
diff --git a/js/ui/status/thunderbolt.js b/js/ui/status/thunderbolt.js
index b7dadbc66..b36819a53 100644
--- a/js/ui/status/thunderbolt.js
+++ b/js/ui/status/thunderbolt.js
@@ -2,10 +2,7 @@
 
 // the following is a modified version of bolt/contrib/js/client.js
 
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Polkit = imports.gi.Polkit;
-const Shell = imports.gi.Shell;
+const { Gio, GLib, Polkit, Shell } = imports.gi;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index 365ec4123..d555b426e 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const Gvc = imports.gi.Gvc;
-const St = imports.gi.St;
+const { Clutter, Gio, Gvc, St } = imports.gi;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
diff --git a/js/ui/switchMonitor.js b/js/ui/switchMonitor.js
index 8b726ba06..df802fe24 100644
--- a/js/ui/switchMonitor.js
+++ b/js/ui/switchMonitor.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
+const { Clutter, GObject, Meta, St } = imports.gi;
 
 const SwitcherPopup = imports.ui.switcherPopup;
 
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index d4a000334..c28c22910 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -1,11 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Clutter, GLib, GObject, Meta, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
 
 const Main = imports.ui.main;
 const Tweener = imports.ui.tweener;
diff --git a/js/ui/tweener.js b/js/ui/tweener.js
index 499d9dc2f..bb9ea557c 100644
--- a/js/ui/tweener.js
+++ b/js/ui/tweener.js
@@ -1,9 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Clutter, GLib, Shell, St } = imports.gi;
 const Signals = imports.signals;
 const Tweener = imports.tweener.tweener;
 
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 79b34a724..5c9d46021 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -1,15 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const AccountsService = imports.gi.AccountsService;
-const Atk = imports.gi.Atk;
-const Clutter = imports.gi.Clutter;
-const Gdm  = imports.gi.Gdm;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Meta = imports.gi.Meta;
+const { AccountsService, Atk, Clutter,
+        Gdm, Gio, GLib, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
 
 const Layout = imports.ui.layout;
 const Main = imports.ui.main;
diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js
index 88d4f1c9d..05b3b7588 100644
--- a/js/ui/userWidget.js
+++ b/js/ui/userWidget.js
@@ -2,10 +2,7 @@
 //
 // A widget showing the user avatar and name
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
-const St = imports.gi.St;
+const { Clutter, GLib, GObject, St } = imports.gi;
 
 const Params = imports.misc.params;
 
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index d887837a5..77146552d 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -1,12 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const Meta = imports.gi.Meta;
+const { Clutter, Gio, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
-const GObject = imports.gi.GObject;
 
 const AppDisplay = imports.ui.appDisplay;
 const Main = imports.ui.main;
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index bc7817f0e..98bed26f2 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1,13 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
-const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 
 const AltTab = imports.ui.altTab;
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
index 354466b3c..628f145ea 100644
--- a/js/ui/windowMenu.js
+++ b/js/ui/windowMenu.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*
 
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
+const { Meta, St } = imports.gi;
 
 const BoxPointer = imports.ui.boxpointer;
 const Main = imports.ui.main;
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index f100131cf..9c5886144 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -1,15 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Atk = imports.gi.Atk;
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Atk, Clutter, GLib, GObject, Meta, Pango, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Pango = imports.gi.Pango;
-const Shell = imports.gi.Shell;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const DND = imports.ui.dnd;
 const Main = imports.ui.main;
diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js
index 7283f5ece..26404eaab 100644
--- a/js/ui/workspaceSwitcherPopup.js
+++ b/js/ui/workspaceSwitcherPopup.js
@@ -1,11 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Clutter, GLib, GObject, Meta, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta  = imports.gi.Meta;
-const St = imports.gi.St;
 
 const Main = imports.ui.main;
 const Tweener = imports.ui.tweener;
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index ed7e3378b..73cf7b4d1 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -1,14 +1,8 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const GObject = imports.gi.GObject;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
 const Signals = imports.signals;
-const St = imports.gi.St;
 
 const Background = imports.ui.background;
 const DND = imports.ui.dnd;
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index eacb055f8..d2557a4fd 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -1,10 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GObject = imports.gi.GObject;
-const Meta = imports.gi.Meta;
-const St = imports.gi.St;
+const { Clutter, Gio, GObject, Meta, St } = imports.gi;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
diff --git a/js/ui/xdndHandler.js b/js/ui/xdndHandler.js
index cd53e055b..c3b3b5e67 100644
--- a/js/ui/xdndHandler.js
+++ b/js/ui/xdndHandler.js
@@ -1,10 +1,10 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Clutter = imports.gi.Clutter;
-const Main = imports.ui.main;
-const Meta = imports.gi.Meta;
+const { Clutter, Meta } = imports.gi;
 const Signals = imports.signals;
+
 const DND = imports.ui.dnd;
+const Main = imports.ui.main;
 
 var XdndHandler = class {
     constructor() {
diff --git a/tests/interactive/background-repeat.js b/tests/interactive/background-repeat.js
index 2b83411c4..1377f7424 100644
--- a/tests/interactive/background-repeat.js
+++ b/tests/interactive/background-repeat.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage({ width: 640, height: 480 });
diff --git a/tests/interactive/background-size.js b/tests/interactive/background-size.js
index 7e269ff12..91f8149c7 100644
--- a/tests/interactive/background-size.js
+++ b/tests/interactive/background-size.js
@@ -2,9 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Cogl = imports.gi.Cogl;
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Cogl, Clutter, St } = imports.gi;
 
 
 function test() {
diff --git a/tests/interactive/border-radius.js b/tests/interactive/border-radius.js
index 3b7d3d306..4d26518bd 100644
--- a/tests/interactive/border-radius.js
+++ b/tests/interactive/border-radius.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage({ width: 640, height: 480 });
diff --git a/tests/interactive/border-width.js b/tests/interactive/border-width.js
index cb84187e0..30c7575a0 100644
--- a/tests/interactive/border-width.js
+++ b/tests/interactive/border-width.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage({ width: 640, height: 480 });
diff --git a/tests/interactive/borders.js b/tests/interactive/borders.js
index 23212e4fb..4812acbfa 100644
--- a/tests/interactive/borders.js
+++ b/tests/interactive/borders.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage({ width: 640, height: 480 });
diff --git a/tests/interactive/box-layout.js b/tests/interactive/box-layout.js
index 5eb83a46b..bb9a5bbc2 100644
--- a/tests/interactive/box-layout.js
+++ b/tests/interactive/box-layout.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage();
diff --git a/tests/interactive/box-shadow-animated.js b/tests/interactive/box-shadow-animated.js
index 020c28976..5facee3dc 100644
--- a/tests/interactive/box-shadow-animated.js
+++ b/tests/interactive/box-shadow-animated.js
@@ -2,10 +2,8 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, GLib, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const GLib = imports.gi.GLib;
 
 const DELAY = 2000;
 
diff --git a/tests/interactive/box-shadows.js b/tests/interactive/box-shadows.js
index 4a14df1c9..c9c677c97 100644
--- a/tests/interactive/box-shadows.js
+++ b/tests/interactive/box-shadows.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage({ width: 640, height: 480 });
diff --git a/tests/interactive/calendar.js b/tests/interactive/calendar.js
index 3253a4939..6428cb462 100644
--- a/tests/interactive/calendar.js
+++ b/tests/interactive/calendar.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage({ width: 400, height: 400 });
diff --git a/tests/interactive/css-fonts.js b/tests/interactive/css-fonts.js
index 56c19055d..a25769318 100644
--- a/tests/interactive/css-fonts.js
+++ b/tests/interactive/css-fonts.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage();
diff --git a/tests/interactive/entry.js b/tests/interactive/entry.js
index c3dffb6a8..2f0abeab1 100644
--- a/tests/interactive/entry.js
+++ b/tests/interactive/entry.js
@@ -2,9 +2,8 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
+const { Clutter, St } = imports.gi;
 const Mainloop = imports.mainloop;
-const St = imports.gi.St;
 
 function test() {
     let stage = new Clutter.Stage({ width: 400, height: 400 });
diff --git a/tests/interactive/gapplication.js b/tests/interactive/gapplication.js
index d072b910c..ec38b806f 100755
--- a/tests/interactive/gapplication.js
+++ b/tests/interactive/gapplication.js
@@ -1,13 +1,8 @@
 #!/usr/bin/env gjs
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-imports.gi.versions.Gdk = '3.0';
-imports.gi.versions.Gtk = '3.0';
-
-const Gdk = imports.gi.Gdk;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const Gtk = imports.gi.Gtk;
+imports.gi.versions = { Gdk: '3.0', Gtk: '3.0' };
+const { Gdk, Gio, GLib, Gtk } = imports.gi;
 
 function do_action(action, parameter) {
     print ("Action '" + action.name + "' invoked");
diff --git a/tests/interactive/icons.js b/tests/interactive/icons.js
index 55afdbf2b..65b7f6560 100644
--- a/tests/interactive/icons.js
+++ b/tests/interactive/icons.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage();
diff --git a/tests/interactive/inline-style.js b/tests/interactive/inline-style.js
index 2f9000579..3952c3a98 100644
--- a/tests/interactive/inline-style.js
+++ b/tests/interactive/inline-style.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage();
diff --git a/tests/interactive/scroll-view-sizing.js b/tests/interactive/scroll-view-sizing.js
index 9b264d05f..f01352188 100644
--- a/tests/interactive/scroll-view-sizing.js
+++ b/tests/interactive/scroll-view-sizing.js
@@ -2,11 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const GObject = imports.gi.GObject;
-const Gtk = imports.gi.Gtk;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
+const { Clutter, GObject, Gtk, Shell, St } = imports.gi;
 
 // This is an interactive test of the sizing behavior of StScrollView. It
 // may be interesting in the future to split out the two classes at the
diff --git a/tests/interactive/scrolling.js b/tests/interactive/scrolling.js
index 5087e5dfe..91951ce10 100644
--- a/tests/interactive/scrolling.js
+++ b/tests/interactive/scrolling.js
@@ -2,9 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const Gtk = imports.gi.Gtk;
-const St = imports.gi.St;
+const { Clutter, Gtk, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage();
diff --git a/tests/interactive/transitions.js b/tests/interactive/transitions.js
index acb5db479..7b2eac1c7 100644
--- a/tests/interactive/transitions.js
+++ b/tests/interactive/transitions.js
@@ -2,8 +2,7 @@
 
 const UI = imports.testcommon.ui;
 
-const Clutter = imports.gi.Clutter;
-const St = imports.gi.St;
+const { Clutter, St } = imports.gi;
 
 function test() {
     let stage = new Clutter.Stage();
diff --git a/tests/testcommon/ui.js b/tests/testcommon/ui.js
index 291f3b145..abacea5f7 100644
--- a/tests/testcommon/ui.js
+++ b/tests/testcommon/ui.js
@@ -2,13 +2,9 @@
 
 const Config = imports.misc.config;
 
-imports.gi.versions.Clutter = Config.LIBMUTTER_API_VERSION;
-imports.gi.versions.Gtk = '3.0';
+imports.gi.versions = { Clutter: Config.LIBMUTTER_API_VERSION, Gtk: '3.0' };
 
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
-const St = imports.gi.St;
+const { Clutter, Gio, GLib, St } = imports.gi;
 
 const Environment = imports.ui.environment;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]