Description: launch in non gnome-shell environments
 For non gnome-shell environments an attempt is made to bind to a
 gnome-shell extension gsetting variable.  This patch tests first
 that gnome-shell is running before attempting the binding.
Author: David Mohammed <fossfreedom@ubuntu.com>
Origin: other
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=780794
Bug-Ubuntu: https://bugs.launchpad.net/ubuntubudgie/+bug/1678420
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=780794
Last-Update: 2017-04-01

--- gnome-tweak-tool-3.24.0.orig/gtweak/tweaks/tweak_group_shell_extensions.py
+++ gnome-tweak-tool-3.24.0/gtweak/tweaks/tweak_group_shell_extensions.py
@@ -306,8 +306,10 @@ class ShellExtensionTweakGroup(ListBoxTw
                                    *extension_tweaks)
         
         self.titlebar_widget = Gtk.Switch(visible=True)
-        shell._settings.bind("disable-user-extensions", self.titlebar_widget,
-                             "active", Gio.SettingsBindFlags.INVERT_BOOLEAN)
+        
+        if shell:
+            shell._settings.bind("disable-user-extensions", self.titlebar_widget,
+                                 "active", Gio.SettingsBindFlags.INVERT_BOOLEAN)
 
         self.set_header_func(self._list_header_func, None)
 
