[gnome-shell] dash: Open 'Show Apps' with Super+A



commit dd3484b93f3f846c98a331bdc7243f91d57b6ac8
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Mon Oct 8 12:16:55 2012 -0400

    dash: Open 'Show Apps' with Super+A
    
    This is a workaround for power users for the "Show Apps" button
    placement being too inconvenient to press at the bottom of the
    dash favorites list.
    
    Unity also uses Super+A to show the Apps lens.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685738

 data/50-gnome-shell-system.xml.in      |    3 +++
 data/org.gnome.shell.gschema.xml.in.in |    8 ++++++++
 js/ui/viewSelector.js                  |   12 ++++++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/data/50-gnome-shell-system.xml.in b/data/50-gnome-shell-system.xml.in
index 4c7e992..7dac05f 100644
--- a/data/50-gnome-shell-system.xml.in
+++ b/data/50-gnome-shell-system.xml.in
@@ -8,5 +8,8 @@
 	<KeyListEntry name="toggle-message-tray"
                       _description="Show the message tray"/>
 
+	<KeyListEntry name="toggle-application-view"
+                      _description="Show all applications"/>
+
 </KeyListEntries>
 
diff --git a/data/org.gnome.shell.gschema.xml.in.in b/data/org.gnome.shell.gschema.xml.in.in
index 824d1b7..0fd89bc 100644
--- a/data/org.gnome.shell.gschema.xml.in.in
+++ b/data/org.gnome.shell.gschema.xml.in.in
@@ -83,6 +83,14 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
         Keybinding to open the application menu.
       </_description>
     </key>
+    <key name="toggle-application-view" type="as">
+      <default>["&lt;Super&gt;a"]</default>
+      <_summary>Keybinding to open the "Show Applications" view</_summary>
+      <_description>
+        Keybinding to open the "Show Applications" view of the Activities
+        Overview.
+      </_description>
+    </key>
     <key name="toggle-message-tray" type="as">
       <default>["&lt;Super&gt;m"]</default>
       <_summary>Keybinding to toggle the visibility of the message tray</_summary>
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 2e6ca52..857fa05 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const Gio = imports.gi.Gio;
 const Gtk = imports.gi.Gtk;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
@@ -19,6 +20,7 @@ const Tweener = imports.ui.tweener;
 const Wanda = imports.ui.wanda;
 const WorkspacesView = imports.ui.workspacesView;
 
+const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
 
 const FocusTrap = new Lang.Class({
     Name: 'FocusTrap',
@@ -141,6 +143,16 @@ const ViewSelector = new Lang.Class({
         // accessing the properties.
         this.constrainHeight = new Clutter.BindConstraint({ source: this._pageArea,
                                                             coordinate: Clutter.BindCoordinate.HEIGHT });
+
+        global.display.add_keybinding('toggle-application-view',
+                                      new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
+                                      Meta.KeyBindingFlags.NONE,
+                                      Lang.bind(this, this._showWithAppsPage));
+    },
+
+    _showWithAppsPage: function() {
+        Main.overview.show();
+        this._showAppsButton.set_checked(true);
     },
 
     show: function() {



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