1 import St
from 'gi://St';
2 import * as Main
from 'resource:///org/gnome/shell/ui/main.js';
4 export default class ShowAppMenuOnKeyPressExtension
{
7 // show apps on startup
8 Main
.layoutManager
.connect('startup-complete', () => {
9 Main
.overview
._overview
._controls
._toggleAppsPage();
12 // show apps on key press when there are no windows
13 global
.stage
.connect('key-press-event', () => {
14 if (!this.hasVisibleWindows() && !Main
.overview
.visible
) {
15 Main
.overview
.showApps();
19 // keyboard focus for apps view
20 Main
.overview
.connect('shown', () => {
21 if (Main
.overview
._overview
.dash
.showAppsButton
.checked
) {
22 Main
.overview
._overview
._controls
.appDisplay
.navigate_focus(null, St
.DirectionType
.TAB_FORWARD
, false)
25 Main
.overview
._overview
.controls
.appDisplay
.connect('view-loaded', () => {
26 Main
.overview
._overview
._controls
.appDisplay
.navigate_focus(null, St
.DirectionType
.TAB_FORWARD
, false)
34 return global
.display
.get_tab_list(0, null).find((w
) => !w
.is_hidden());