Documentation for the Javascript files that make up GNOME Shell's Javascript side
- The actual version of GNOME Shell as of today is 3.22
- This is just a reference list, not full documentation or anything.
- Use this to get a quick idea of what is in what file.
- I might not be correct
- Contributions are welcome
- accessDialog.js
- altTab.js: The popup that appears when you press
ALT + Tab
- animation.js
- appDisplay.js: This is the selector of all apps when you click
Applications
in the viewSelector - appFavorites.js: Manages app favourites in the dash
- audioDeviceSelection.js
- background.js
- backgroundMenu.js
- boxpointer.js: Whenever you open a popup menu there's a little arrow connecting the button to the menu. That's what this is.
- calendar.js: Stuff to do with the calendar in the clock dropdown menu
- checkBox.js:
- ctrlAltTab.js: Handles the Accessibility switcher which lets you select UI elements. It appears when you press
CTRL + ALT + Tab
- dash.js: This is the bar that you have at the left in overview
- dateMenu.js: The graphical calendar widget in the calendar menu
- dnd.js: Handles drag and drop
- edgeDragAction.js
- endSessionDialog.js: The dialog that appears when you
log out/shutdown/etc
- environment.js: Sets upd the GJS environment for the rest of the code
- extensionDownloader.js: Handles
installing, uninstalling, downloading, and updating
extensions - extensionSystem.js: Handles
installing, enabling, and disabling
extensions - focusCaretTracker.js
- grabHelper.js
- ibusCandidatePopup.js
- iconGrid.js: Classes for layout out icons in a grid
- keyboard.js: On-screen keyboard class
- layout.js: This manages the shell
chrome
; the UI that is visible in the normal mode, that surrounds the main workspace content - legacyTray.js
- lightbox.js: Creates a dark translucent shade convering a UI element
- lookingGlass.js: The looking glass
ALT + F2
+lg + ENTER
. It is a tool for helo developers developing GNOME Shell and GNOME Shell extensions - magnifierDBus.js: Shell magnifier for accessibility and the DBus interface.
- magnifier.js: It is a accessibility tool, that allow to deficient users to see the desktop with zoom
- main.js: This is what defines most of the global object instances in GNOME Shell and sets everything up
- messageList.js
- messageTray.js: The instance of the message tray
- modalDialog.js: Defines the GNOME Shell popup dialogs
log out/shutdown/authentication/etc
- mpris.js
- notificationDaemon.js: Listens for notifications via DBus and adds them to the message tray
- osdMonitorLabeler.js
- osdWindow.js
- overviewControls.js
- overview.js: The overview
Super Key
. This object have all we see normally when we are in theActivities
headland. So, it has the dash, the workspaces, the window actors, the search bar, the display apps, etc - padOsd.js
- panel.js: Defines the
Top Panel
- panelMenu.js: Defines various helper functions for items in the panel
- pointerWatcher.js
- popupMenu.js: Defines the popup menus and items that can go in them
- remoteMenu.js
- remoteSearch.js: Handles remote search providers that operate through DBus
- runDialog.js: The run dialog/command prompt
ALT + F2
- screencast.js
- screenShield.js
- screenshot.js
- scripting.js
- search.js: Abstract class that handle searching and providing results
- separator.js
- sessionMode.js
- shellDBus.js: GNOME Shell DBus implementation (interface name
org.gnome.shell
, path/org/gnome/Shell
js) forinstalling/enabling/disabling/uninstalling
extensions and requesting information from them, taking screenshots, and so on - shellEntry.js: Adds context menus to entry widgets with 'copy' and 'paste' and if it is a password widget
show/hide text
- shellMountOperation.js: Wrappers around
Shell.MountOperation
that handle the ejecting of a device from the autorunManager.AutorunNotification. Provides a dialog letting you know if the device is busy/what processes are inhibiting unmounting and notifications if passwords are needed for the volume. - slider.js
- switcherPopup.js
- tweener.js: A module that wraps around
imports.tweener.tweener
adding extra goodness for GNOME Shell - unlockDialog.js
- userWidget.js
- viewSelector.js: This is the selector for
Windows
andApplications
tabs - windowAttentionHandler.js: Manage the
x is ready
dialog you got when you click to run some application and other things like this. It defines when a window is requesting attention from the user - windowManager.js: Extra bells and whistles for the window manager implemented on the JS side
- windowMenu.js
- workspace.js: Classes handling the window previews you see in overview
- workspacesView.js: Handles assembling the window previews from
workspace.js
and the workspaces sidebarworkspaceThumbnail.js
- workspaceSwitcherPopup.js: The popup you get upon switching workspaces through the keybindings that shows you which workspaces you are switching to
- workspaceThumbnail.js: Defines the classes in the workspace sidebar in overview
- xdndHandler.js: GNOME Shell handling of Xdnd: dragging and dropping things between X window and a GNOME Shell object.
- components directory
- automountManager.js: Manages the automount of devices, like when you insert a USB stick and it is mounted automatically.
- autorunManager.js: Manage the autorun function, like when you insert some device in the computer and a dialog asking what to do shown.
- init.js
- keyring.js
- networkAgent.js: Manage network interface
wifi/wire/bluetooth
- polkitAgent.js: Handles popping up a password dialog on receiving authentication requests
- telepathyClient.js: Handles chat through telepathy and setting up notifications etc for these
- status directory: This contains the files for all the standard status indicators in the
Status Area
- accessibility.js: The accessibility
a11y
indicator - bluetooth.js: The bluetooth indicator
- brightness.js: The brightness indicator
- keyboard.js: Keyboard layout indicator
- location.js
- network.js: The network
wifi/wired
indicator - power.js: The power
battery life/power settings
indicator - rfkill.js
- screencast.js
- system.js
- volume.js: The
volumen/sound
settings indicator
- accessibility.js: The accessibility
- config.js: A collection of constants that could come in handy (number versions)
- extensionUtils.js: Set of utilities to do with extensions
- fileUtils.js: Set of helpful functions for files
- gnomeSession.js: DBus stuff to do with
org.gnome.SessionManager
- history.js: A class that saves history to a gsettings key
- ibusManager.js
- jsParse.js: A set of functions for parsing strings of javascript code, used in the autocomplete function for the looking class
- keyboardManager.js
- loginManager.js
- modemManager.js: DBus stuff to do with mobile brandband
- objectManager.js
- params.js: A helpful function for parsing input parameters against default parameters
- smartcardManager.js
- util.js: A set of useful functions, mainly to do with spawning external processes in the background
- AccessDialog:
- AccessDialogDBus:
- AppSwitcherPopup:
- CyclerHighlight:
- CyclerPopup:
- GroupCyclerPopup:
- WindowSwitcherPopup:
- WindowCyclerPopup:
- AppIcon: Class defining the icon for an app
- AppSwitcher: This handles the display of icons for each app in the
AltTab
popup. Generates anAppIcon
per app - ThumbnailList: This is what appears when you hover over an app with multiple windows in the
AltTab
popup. It handles the list of thumbnails for a given app - WindowIcon:
- WindowList:
- Animation:
- AnimatedIcon: Generate a animated icon (this is used for the "waves" when you reach the hot corner of the panel)
- BaseAppView:
- PageIndicatorsActor:
- PageIndicators:
- AllView:
- FrequentView:
- ViewStackLayout:
- AppDisplay:
- AppSearchProvider: Handles finding apps matching search item(s)
- FolderView:
- FolderIcon:
- AppFolderPopup:
- AppIcon: An icon for an app
- AppIconMenu: The
right-click
menu of an App containing the relevant actionsNew Window/Remove from favourites/Add to favourites/etc
- AppFavorites: Handles your list of app favourites - updates the list when you choose
Add to Favourite
, provides API for you toadd/remove
from your favourites
- AudioDeviceSelectionDialog:
- AudioDeviceSelectionDBus:
- BackgroundCache:
- Background:
- SystemBackground:
- BackgroundSource:
- Animation:
- BackgroundManager:
- BackgroundMenu:
BoxPointer is the triangle bit
- BoxPointer: The triangle arrow connecting a
[popupMenu](#popupmenujs)
to its source (you can configure what side of the menu the pointer appears).
- Contains several functions for manipulating date formats, day abbreviations, etc
- CalendarEvent: An event in the calendar
- EmptyEventSource:
Interface for appointments/events
- DBusEventSource: A calendar event on the DBus
- Calendar: Main Calendar class, handles the UI part of the calendar
month navigation/date/graphical calendar
as well as monitoring events - EventMessage:
- NotificationMessage:
- EventsSection:
- NotificationSection:
- Placeholder:
- CalendarMessageList: Notification section
See also dateMenu.js which ties all these elements together
- CheckBox: Checkbox itself
- CtrlAltTabManager: Handles
CTRL + ALT + Tab
behaviour - showing the popup, setting up the stage to be ready for keyboard navigation - CtrlAltTabPopup: The UI popup itself
- CtrlAltTabSwitcher: UI element holding all the options you
ALT + Tab
between
- DashItemContainer: Helper class - each item in the dash is one of these
- ShowAppsIcon:
- DragPlaceholderItem:
- EmptyDropTargetItem:
- DashActor:
- Dash: The master
Dash
class, making use of all the other classes
The date menu. Red: DateMenuButton, Green: TodayButton, Yellow: WorldClockSection
- TodayButton:
- WorldClocksSection:
- MessagesIndicator:
- IndicatorPad:
- FreezableBinLayout:
- DateMenuButton: Subclass of PanelMenu.Button to provide the date menu in the middle
Top Panel
.
See also calendar.js
This allow you to add drag-and-drop
functionality to your own classes. You use the following functions defined in the file:
-
addDragMonitor: You define an object defining the drag behaviour you want, and use
addDragMonitor
to add it. A drag monitor is an object with the keydragMonitor
whick is a callback for what happens when a drag monitor event occurs See dash.js and workspacesView.js for examples -
removeDragMonitor: Remove the drag behaviour that you added with
addDragMonitor
-
makeDraggable: This is what makes an item draggable. You call it on an actor and get a draggable actor back out. You have to define some functions in
actor._delegate
's class in order for this to work:handleDragOver
,acceptDrop
,getDragActor
,getDragActorSource
-
_Draggable: Class defining a basic draggable item, defining how the dragging happens. You do not use this directly, Instead, use
makeDraggable
to make an actor draggable
- EdgeDragAction:
- EndSessionDialog: The end session dialog. Handles the UI part. In terms of actually
logging out/shutting down/etc
the dialog simply sends a message to the GNOMESessionManager
DBus to request a shutdown rather thant doing the shutdown itself
This module sets upd the GJS
environment for the rest of the JS files:
- Adds up the
global
object to the environment - Adds the
add
function toSt.BoxLayout
- Adds the
child_set
function toSt.BoxLayout
,Clutter.TableLayout
,Clutter.GridLayout
andClutter.BoxLayout
- Adds/Improevs the
toString()
function - Adds method
String.format
- Initialises various things the shell needs to work
This is a collection of functions to do with installing, updating and uninstalling extensions
The extension UUID is like
extensionname@some.website.com
-
installExtension: Installs an extension by UUID by downloading it form GNOME Shell Extensions
-
uninstallExtension: Uninstalls an extension by UUID
-
updateExtension: Updates an extension by UUID
-
InstallExtensionDialog: The dialog that pops up when you choose to install an extension from GNOME Shell Extensions confirming that you want to install the extension
This is a collection of functions to do with enabling and disabling extensions, and accessing their metadata
You can access extensions and their metadata using
imports.misc.extensionUtils.extensions
. Useimports.misc.extensionUtils.getCurrentExtension()
from withing an extension to get the object for that extension
The extension UUID is like
extensionname@some.website.com
- disableExtension: Disables an extension by UUID
- enableExtension: Enables an extension by UUID
- FocusCaretTracker:
- GrabHelper:
- CandidateArea:
- CandidatePopup:
- BaseIcon: A basic icon class consisting of an icon and a label
- IconGrid: A widget displaying its children in a grid allowing you to set a row limit or column limit, and actors that don't fit in will not be painted
- PaginatedIconGrid:
- Key: A key on the keyboard
- Keyboard: The
Keyboard
class - KeyboardSource: Inherits from MessageTray.Source, shows the keyboard in the message tray
- ShellWaylandAdapter:
- MonitorConstraint:
- Monitor:
- LayoutManager: Manages layout of items on the stage
Messsage Tray/Top Panel/Hot Corners
and updates when monitors change - HotCorner: Hot corners. The
Top Left
hot corner lets you switch to the overview - PressureBarrier:
- LegacyTray:
- RadialShaderQuad:
- Lightbox: A shade obscuring the specific container actor
Autocomplete function in the Looking Glass
Looking Glass Inspector - outlines the actor your mouse is over and lets you pick it
Looking Glass ObjInspector - inspecting
Main.panel.statusArea.dateMenu
- AutoComplete: Adds completion behaviour on
Tab/double-Tab
to the Looking Glass like the terminal - Notebook: The Looking Glass consists of
Inspector/Evaluator/Windows/Extensions
. The notebook is what holds them all - ObjLink: When you type thing into the Looking Glass console the results are clickable. This class handles those links
- Result: When you type things into the Looking Glass the results get printed like so:
r(result_number) = result
- WindowList: The
Windows
tab of the Looking Glass - ObjInspector: When you click on a result in the Looking Glass you get a window that shows you more information about that result. Clicking on an object will show some of its properties. This is that class
- RedBorderEffect: When you pick an object with the
Inspector
. There is a red border around the selected object. This class handles adding and removing these borders - Inspector: There is a
picker
icon. When you select it, you can pick an object from the stage to examine further. As you move your pointer over particular objects, they get a red border drawn around them. TheInspector
class handles tracking which object your pointer is over - Extensions: The
Extensions
tab in the Looking Glass - LookingGlass: Assembles the whole Looking Glass together. Also privedes the
Evaluator
tab and handles the actual evaluation of commands typed into the console
- ShellMagnifier:
- ShellMagnifierZoomRegion:
- Magnifier: Defines the shell magnifier
- ZoomRegion: Defines a particular zoom region
- Crosshairs: Defines the crosshairs of the magnifier
- MagShaderEffects:
This file is like the int main();
of programs, setting up the whole GNOME Shell interface and making parts available to everyone else (Top Panel/Overview/Message Tray/...
). Many global objects in GNOME Shell create just one instance. These are stored here.
This file also handles dynamic workspaces (when you have no windows left on a workspace it is removed).
-
Some of the objects stored to be accessed by others (there are more, see
main.js
):- panel: this is the top panel. If you want to add buttons to the status area etc, you use this panel to add them to.
- hotCorners: the hot corner(s), e.g. the top-left one (move your cursor over it and the Overview opens).
- overview: the Overview.
- runDialog: the dialog when you press Alt+F2.
- lookingGlass: the looking glass.
- messageTray: the message tray.
- shellDBusService: GNOME-Shell's Dbus service.
- magnifier: the accessibility magnifier.
- keyboard: the accessibility on-screen keyboard.
-
Some handy functions (there are other functions in main.js too; these are just some handy one):
getThemeStylesheet()
: gets the file path for the (custom) theme you are using for GNOME Shell, if any (e.g.$HOME/.themes/<themename>/gnome-shell/gnome-shell.css
). If you are not using a custom gnome-shell theme, this will be null.setThemeStylesheet(path)
: sets the file path for the custom theme for GNOME Shell (but doesn't actually cause a theme change; useloadTheme
to reload the theme after doing this).loadTheme()
: reloads the style for GNOME Shell. It sets thegetThemeStylesheet
(any custom GNOME Shell theme if you have one, or just the default/usr/share/gnome-shell/themes/gnome-shell.css
) as the top priority style sheet, and then loads all the extra stylesheets (e.g. extension stylesheets) at a lower priority. This is why if you set a style in your extension'sstylesheet.css
that conflicts with the a GNOME Shell style class, GNOME Shell will win.notify(msg, details)
: creates a GNOME Shell notification (i.e. popup from the message tray) with titlemsg
and textdetails
.notifyError(msg, details)
: callsnotify(msg, details)
to send a popup notification from the message traypushModal(actor, timestamp, options)
: Grabs all keyboard/mouse input to the stage and focuses actor. When the modal stack is empty we return focus to whatever had focus beforepushModal
was called. TheOverview
,Run Dialog
,Looking Glass
, andModal Dialogs
all use this (there are probably more too).popModal(actor, timestamp)
: Opposite ofpushModal
(removes actor from the modal stack).initializeDeferredWork(actor, callback, props)
: Sets up a callback to be invoked either when actor is mapped, or when the machine is idle - useful if your actor isn't always visible on the screen and you don't want to consume resources updating if the actor isn't actually visible. (TheOverview
actors are all examples of these). Returns a work ID that you can use withqueueDeferredWork
every time you update the actor.queueDeferredWork(workId)
: Ensures that the work identified byworkId
will be run on map or timeout. It is called by default oninitializeDeferredWork
, call it again when (say) the data being displayed by the actor changes.
-
RestartMessage:
- URLHighlighter: Class to markup URLs in notifications
- ScaleLayout:
- LabelExpanderLayout:
- Message:
- MessageListSection:
- FocusGrabber: Grab and control the focus for the message tray. We need this because the focus acts diferently depending of the siutation for the message tray.
- NotificationPolicy:
- NotificationGenericPolicy:
- NotificationApplicationPolicy:
- Notification: Base class defining a notification - the UI element. A notification belongs to a
Source
and has a title and text. In banner mode, the notification shows an icont, title, and banner on a single line. If the notification has additional elements in it or the banner doesn't fit on a single line, the notification is expandable. SeemessageTray.js
for much more in-depth documentation. - NotificationBanner:
- SourceActor:
- SourceActorWithLabel:
- Source: Abstract class defining a notifications source. It provides the UI element of the icon + notification counter in the message tray
- MessageTray: The
MessageTray
class - SystemNotificationSource: Define a system source. It is inherit from
Source
.
If you wish to create notifications, the MessageTray.Source
is the class you subclass. You need to implement the createNotificationIcon
function at a minimum. When you want to send a notification from that source, use source.notify(notification)
, where notification
is a MessageTray.Notification
or subclass thereof
- ModalDialog: A handy class defining a modal dialog. Use
.setButtons
to add buttons to it, andopen/close
to show or hide it.
Examples endSessionDialog.js, extensionDownloader.js...
- MediaMessage:
- MprisPlayer:
- MediaSection:
- FdoNotificationDaemon:
- FdoNotificationDaemonSource:
- GtkNotificationDaemonNotification:
- GtkNotificationDaemonAppSource:
- GtkNotificationDaemon:
- NotificationDaemon: GNOME Shell uses DBus to listen/send notifications; this handles that
- OsdMonitorLabel:
- OsdMonitorLabeler:
- LevelBar:
- OsdWindowConstraint:
- OsdWindow:
- OsdWindowManager:
- SlideLayout:
- SlidingControl:
- ThumbnailsSlider:
- DashSlider:
- DashSpacer:
- ControlsLayout:
- ControlsManager:
- ShellInfo: Handles spawning notification for actions performed from the overview and undoing them
- Overview: The
Overview
triggered when you press theSuper
key. Made up of various tabs defined in other classes. Code in here is to do with animation when the overview shows and hides, loading search providers, interaction with the overview and so on
See also viewSelector.js, the core Applications
tab appDisplay.js and the core Windows
tab workspacesView.WorkspaceDisplay
- KeybindingEntry:
- ActionComboBox:
- ActionEditor:
- PadDiagram:
- PadOsd:
- PadOsdService:
The panel. Yellow: _leftBox, Green: _centerBox, Red: _rightBox
AppMenuButton with its dropdown menu
AggregateMenu
- AppMenuButton: This is the top titlebar (stored in
Main.panel._appMenu
). Inherits from panelMenu.Button, so it has a dropdown menu (by default showingQuit
) - ActivitiesButton: The
Activities
button on the Top Left that triggers the overview. It is a panelMenu.Button but without a menu. Contains the layout.HotCorner that triggers the overview - PanelCorner: The black rounded corners that extend down from the
Top Panel
on either side of the screen. They are painted onto the screen using the panel colour - AggregateLayout:
- AggregateMenu: It is the
Status Area
button, it holds thenetwork/location/power/brightness/volume/system/etc
indicators - Panel: The
Top Panel
, stored inMain.panel
. It is split into threeboxes
into which various panel elements are all placed:- _leftBox,
Main.panel._leftBox
: Contains theActivitiesButton
and theAppMenuButton
- _centerBox,
Main.panel._centerBox
: Contains the dateMenu.DateMenuButton button - _rightBox,
Main.panel._rightBox
: Contains theAggregateMenu
/Status Area
. However when you want to insert icons into theStatus Area
you should useMain.panel.addToStatusArea(role, myButton, position)
whererole
is the role that button performs (network
,a11y
, ...). There can only be one button performing each role in theStatus Area
- _leftBox,
Example of a panelMenu.Button, being the indicator and menu where the indicator is an icon
- ButtonBox: The base
Button
class for buttons in thePanel
- Button: Inherits from panelMenu.ButtonBox - adds a menu. So this is an object for use in the
Panel
that will have a menu and some sort of display item (e.g. an icon), which you are responsible for defining and adding. The dateMenu.DateMenuButton is an example of this - SystemIndicator: This is just a
Button
with an icon. Feed it in an icon name (one of the stock icon names) and it will display it. Just about every icon you have in yourStatus Area
is one of these
- PointerWatch:
- PointerWatcher:
- PopupBaseMenuItem: Base class for popup menu items - and empty popup menu item. Has an
activate
signal that gets fired when the item is activated. Use.addActor
to add visual elements to it like aSt.Label
. All the otherPopup*MenuItem
classes inherit from this. - PopupMenuItem: A
PopupBaseMenuItem
that displays text in aSt.Label
. - PopupSeparatorMenuItem: A
PopupBaseMenuItem
that is a separator. - Switch: An on-off toggle switch
- PopupSwitchMenuItem: A
PopupBaseMenuItem
containing a label/text and aSwitch
to the right. Use thetoggled
signal to determine when the user toggles it. - PopupImageMenuItem: A
PopupBaseMenuItem
containing a label/text and an icon to the right. - PopupMenuBase: The base class for a popup menu (The menu that appears when you click most of the items in the status area). You don't use this directly (unless you are extending it); use any of its child classes and use
menu.addMenuItem
to add a popup menu item/submenu to it. - PopupMenu: Extends
PopupMenuBase
to provide a popup menu. This is the main popup menu class. (The one that gets used for all the panelMenu.Buttons) - PopupDummyMenu:
- PopupSubMenu: A popup submenu - designed to be nested within a
PopupMenu
, has a scrollbar in case the content is too long. If you want to add it to aPopupMenu
as a collapsible menu section, usePopupSubMenuMenuItem
- PopupMenuSection: This acts like a
PopupSubMenu
, but to the user just looks like a normalPopupMenu
. It can be useful to add multiplePopupMenuSection
s to a singlePopupMenu
to group items together code-wise (and to the user it looks like a flat popup menu). - PopupSubMenuMenuItem: A
PopupBaseMenuItem
defining a collapsible submenu - click on it to expand/open the submenu and reveal the items inside. It is really just aPopupBaseMenuItem
with label and aPopupSubMenu
. UsemyItem.menu.addMenuItem
to add to its menu. - PopupMenuManager: Extracted from source
Basic implementation of a menu manager. Call addMenu to add menus
- RemoteMenuSeparatorItemMapper:
- RequestSubMenu:
- RemoteMenuSubmenuItemMapper:
- RemoteMenuItemMapper:
- RemoteMenu:
- RemoteSearchProvider: A search provider that acts through DBus
- RemoteSearchProvider2:
- RunDialog: The run dialog that you get on
ALT + F2
. Type commands in here to have them executed. Also defines a couple ofspecial
commands:- lg: opens the Looking Glass
- r, restart: Restarts GNOME Shel. Needed if you make changes to JS files [WARNING: Wayland doesn't support this command, you need to change to Xorg Display Server when you log into your account]
- rt: Reloads the shell theme
- debugexit: Quits the shell with debug info
- ScreencastService:
- Clock:
- NotificationsBox:
- Arrow:
- ScreenShield:
- ScreenshotService:
- SelectArea:
- Flashspot:
Documentation extracted from the source
This module provides functionality for driving the shell user interface in an automated fashion. The primary current use case for this is automated performance testing (see runPerfScript()
), but it could be applied to other forms of automation, such as testing for correctness as well.
When scripting an automated test we want to make a series of calls in a linear fashion, but we also want to be able to let the main loop run so actions can finish. For this reason we write the script as a generator function that yields when it want to let the main loop run.
yield Scripting.sleep(1000);
main.overview.show();
yield Scripting.waitLeisure();
While it isn't important to the person writing the script, the actual yielded result is a function that the caller uses to provide the callback for resuming the script.
Provides:
sleep(milliseconds)
: Used within an automation script to pause the the execution of the current script for the specified amount of time. Use as:
yield Scripting.sleep(500);
waitLeisure()
: Used within an automation script to pause the the execution of the current script until the shell is completely idle. Use as:
yield Scripting.waitLeisure();
- PerfHelper: DBus proxy for
org.gnome.shell.PerfHelper
createTestWindow(width, height, alpha, maximized)
: Creates a window usinggnome-shell-perf-helper
for testing purposes. While this function can be used with yield in an automation script to pause until the DBus call to the helper process returns, because of the normal X asynchronous mapping process, to actually wait until the window has been mapped and exposed, usewaitTestWindows()
waitTestWindows()
: Used within an automation script to pause until all windows previously created withcreateTestWindow
have been mapped and exposed.destroyTestWindows()
: Destroys all windows previously created withcreateTestWindow()
. While this function can be used with yield in an automation script to pause until the D-Bus call to the helper process returns, this doesn't guarantee that Mutter has actually finished the destroy process because of normal X asynchronicity.defineScriptEvent(name, description)
: Convenience function to define a zero-argument performance event within thescript
namespace that is reserved for events defined locally within a performance automation script.scriptEvent(name)
: Convenience function to record a script-local performance event previously defined withdefineScriptEvent
collectStatistics()
: Convenience function to trigger statistics collection.runPerfScript(scriptModule)
: module object with run and finish functions and event handlers. Runs a script for automated collection of performance data. The script is defined as a Javascript module with specified contents. See thescripting.js
file for much more detail (it's documented in there).
See the source for full documentation.
- MaxWidthBin:
- SearchResult: Class representing a single result of a search in the
Overview
- ListSearchResult:
- GridSearchResult:
- SearchResultsBase:
- ListSearchResults:
- GridSearchResults:
- SearchResults:
- ProviderIcon:
See the source for full documentation.
- HorizontalSeparator:
- SessionMode:
- GnomeShell:
- GnomeShellExtensions:
- ScreenSaverDBus:
- EntryMenu: A subclass of popupMenu.PopupMenu used to provide a context menu to a
Clutter.Entry
orSt.Entry
(text box). Do not use this class directly; instead useShellEntry.addContextMenu(entry)
. The context menu acts like so: when the userright-click
the entry, they get a popup menu withPaste/Copy
and if it is a password dialog it will have aShow/Hide character
item too
- ListItem: A button displaying a particular application's icon and name, that will launch the application when clicked. These are used in the
ShellProcessesDialog
, one per application that impedes the removal of a device - ShellMountOperation:
- ShellUnmountNotifier:
- ShellMountQuestionDialog: Extends modalDialog.ModalDialog to provide a dialog that asks a question about a mount and offer choices
- ShellMountPasswordDialog:
- ShellProcessesDialog: Extends modalDialog.ModalDialog to provide a dialog that shows you which applications are impeding the removal of a device
- GnomeShellMountOpHandler:
- Slider:
- SwitcherPopup:
- SwitcherList:
- ClutterFrameTicker:
See the source for full documentation.
- UnlockDialog:
- Avatar:
- UserWidgetLabel:
- UserWidget:
- FocusTrap:
- TouchpadShowOverviewAction:
- ShowOverviewAction:
- ViewSelector:
- WindowAttentionHandler: Handles
window-demands-attention
signals fromglobal.display
and pops up thex is ready
notification upon receiving it. When you start up and app it can take a while to load and in the meantime you move on to another window; when the window does actually load you get a notification letting you know the application is ready to be used - Source: A messageTray.Source tailored to window attention requests. If you focus the windows then the notification is no longer relevant so it will remove itself
- DisplayChangeDialog:
- WindowDimmer: When created with an actor (for example a
Meta.WindowActor
), dims that actor. For example when you open a modal dialog from a window, that window is dimmed until you are finished with the modal dialog - WorkspaceTracker:
- TilePreview:
- TouchpadWorkspaceSwitchAction:
- WorkspaceSwitchAction:
- AppSwitchAction:
- ResizePopup:
- WindowManager: Extra bells and whistles on the undarlying window manager. This handles things like:
- Showing the workspace switcher popup upon receiving a
switch-to-workspace-*
keybinding - Animating all your windows sliding off the screen when you switch workspaces
- Adding animations to windows when they are
Minimized/Maximized/Mapped/Destroyed
- Dimming a parent window if you open a modal dialog for it and undimming when the dialog is dismissed
- Showing the window switcher
ALT + Tab
popup, and - Showing the accesibility switcher
CTRL + ALT + Tab
popup
- Showing the workspace switcher popup upon receiving a
- WindowMenu:
- AppMenu:
- WindowMenuManager:
- WindowCloneLayout:
- WindowClone: The thumbnail of a window that you see in the windows tab of the
Overview
. You can click to activate it, drag it to move it between workspaces. One per window actor - WindowOverlay: This defines items that are overlaid on the
WindowsClone
. In particular, The windows's caption and the close button that you see on each window in theOverview
- LayoutStrategy:
- UnalignedLayoutStrategy:
- Workspace: Represents a collection of
WindowOverlay
s in theOverview
. Each one just looks after the overlays in its own workspace and monitor. It handles how to lay out its overlays. This is not the workspace preview you see in the workspaces sidebar, that is a workspaceThumbnail.WorkspaceThumbnail
- WorkspacesViewBase:
- WorkspacesView: A container for many workspace.Workspaces
- ExtraWorkspaceView:
- DelegateFocusNavigator:
- WorkspacesDisplay: This is essentially the
Windows
tab in theOverview
. On the right hand side it has a sidebar showing workspace thumbnails that you can choose; this is a workspaceThumbnail.ThumbnailsBox. The part that shows all the window thumbnails is aWorkspacesView
. This class handles things like when the workspaces preview sidebar (ThumbnailsBox) should be slidden out and in. showing/animating the rectangle about the current workspace in the sidebar animating when dynamic workspaces are added/removed, changing workspaces on scrollin ove the sidebar, etc
- WorkspaceSwitcherPopup: This is the popup that appears when you switch workspaces via keybindings, showing which workspace you've switched to
- PrimaryActorLayout:
- WindowClone: This is a thumbnail of a window (used in a
WorkspaceThumbnail
) - one per window. It can be dragged to another workspace to switch its workspace - WorkspaceThumbnail: This is a thumbnail of a workspace, one per workspace. Shows thumbnails of all the windows on that workspace. It is an up-to-date snapshot of its windows (updates when windows are
Added/Removed/Minimized/State Changed
) - ThumbnailsBox: This is a collection of workspace thumbnails (the workspaces sidebar you see in the
Overview
). Handles the sliding in or out of workspaces as they areAdded/Destroyed
, and also dragging windows to create new workspaces between existing ones
- XdndHandler: Sets up
Xdnd
and passes through signals. When anon-gnome-shell object
is first dragged over agnome-shell-object
, tha handler fires adrag-begin
signal. When the object being dragged leaves thegnome-shell-object
, thedrage-end
signal is fired. The class somehow incorporates with dnd.js code too whereby a draggable target/object registered withdnd.js
has the appropiate events called on it. UseMain.xdndHandler
to access the instance of the handler and connect to its signals.
- AutomountManager: Uses
ConsoleKit
to listen for drives being added, removed, connected, disconnected, ejected, etc and automounts the drive
- HotplugSniffer: Listens on the DBus for something...
- ContentTypeDiscoverer: Guesses what content is on a media
Filesystem/Photos/Documents/Media
- AutorunManager: Master class that handles monitoring when volumens are mounted/dismounted, uses the other classes in the file to determine what content is on the media and send a notification with the right options for that media on it (If it is a camera card offer to view photos, if it is music offer to play it, ...)
- AutorunDispatcher: Determines a mounted volumen's autorun settings for its transient notification
- AutorunSource: Inherits from messageTray.Source. The notification source for the autorun notification that you get upon plugging in a device.
- AutorunNotification: Inherits from messageTray.Notification. Handles the creation of the transient notification you get upon plugging in a device. This is the notification that says
View photos with Shotwel
,Play music
,Browse Files
, etc
- ComponentManager:
- KeyringDialog: A modalDialog.ModalDialog that is a dialog for
gnome-keyring
- KeyringDummyDialog:
- KeyringPrompter:
- NetworkSecretDialog: Dialog that pops up getting you to enter in your password for wifi
- VPNRequestHandler: Handles authentication requests for VPN
- NetworkAgent: Listens for
NetworkAgent
on DBus - handles authentication requests
- AuthenticationDialog: The modalDialog.ModalDialog that appears when you have to enter your password to authenticate
- AuthenticationAgent: Wrapper around
Shell.PolkitAuthenticationAgent
, listens for authentication requests and shows theAuthenticationDialog
- TelepathyClient:
- ChatSource:
- ChatNotification:
- ChatLineBox:
- ChatNotificationBanner:
See the source for full documentation.
These files define the standar status indicators in the status are
- ATIndicator: The panelMenu.Button defining the accessibility indicator. This provides a number of popupMenu.PopupSwitchMenuItems allowing you to toggle on and off various accessibility features
- ATGreeterIndicator:
- Indicator: The panelMenu.SystemIndicator defining the bluetooth indicator.
- Indicator: The panelMenu.SystemIndicator defining the brightness indicator.
- LayoutMenuItem: Extends popupMenu.PopupMenuItem. Consists of text and an either label with the keyboard layout's abbreviation.
- InputSource:
- InputSourcePopup:
- InputSourceSwitcher:
- InputSourceSettings:
- InputSourceSystemSettings:
- InputSourceSessionSettings:
- InputSourceManager:
- InputSourceIndicator:
- Indicator:
- AppAuthorizer:
- GeolocationDialog:
- NMConnectionItem:
- NMConnectionSection:
- NMConnectionDevice:
- NMDeviceWired: Extends
NMConnectionDevice
for wired connections. It will only display theOn/Off
switch if you only have one wired connection port - if you have more it will have a menu section with them all - NMDeviceModem: Extends
NMConnectionDevice
for modemDial up/Brandband
. Items for individual connections have text describing the connection with an icon for signal strength - NMDeviceBluetooth: Extends
NMConnectionDevice
for bluetooth. - NMWirelessDialogItem:
- NMWirelessDialog:
- NMDeviceWireless: Extends
NMConnectionDevice
for wireless connections. - NMVPNConnectionItem:
- NMVPNSection:
- DeviceCategory:
- NMApplet: The panelMenu.SystemIndicator defining the network connections indicator. Contains the various
NMConnectionDevice
subclasses for each connection device you have.
Also contains functions for comparing SSID
s and converting signal strengths to a category excellent/good/ok/weak
- Indicator: The panelMenu.SystemIndicator defining the power indicator. Displays an appropiate icon for your current power state as well as calculating estimated battery life, etc
- RfkillManager:
- Indicator:
- Indicator:
- AltSwitcher:
- Indicator:
- StreamSlider:
- OutputStreamSlider:
- InputStreamSlider:
- VolumeMenu:
- Indicator: The panelMenu.SystemIndicator defining the volume indicator. Containst a slider.Slider for the volume of each of your sound devices and adjusts its icon according to the volume
Contains the constants:
- PACKAGE_NAME:
gnome-shell
(non-localized name of the package). - PACKAGE_VERSION: your gnome-shell version, a string (e.g. '3.22.2').
- HAVE_BLUETOOTH: whether
gnome-bluetooth
is available (1 or 0). - HAVE_NETWORKMANAGER: whether
networkmanager
is available (0 or 1) - GETTEXT_PACKAGE:
gnome-shell
. GNOME-shell's gettext package name. - LOCALEDIR: the locale directory (/usr/share/locale).
- LIBEXECDIR: /usr/libexe/
- SYSCONFDIR: /etc
Contains the extensions object (maps UUID to extension object, described in createExtensionObject
)
-
Helpful functions:
getCurrentExtension
: call it from your extension file to get the current extension object (imports.misc.extensionUtils.getCurrentExtension()
).versionCheck
: checks if the version in metadata.json is compatible with the current shell version.isOutOfDate
: checks if an extension is out of date.createExtensionObject
: creates an object representing an extension.
-
ExtensionFinder:
Functions:
- deleteGFile: deletes a
Gio
file object ("work arounddelete
being a keyword in JS" -- just callsfile['delete'](null)
). - recursivelyDeleteDir: recursively deletes a directory.
- recursivelyMoveDir: recursively move a directory.
- HistoryManager: An object that remembers text up to 512 items
DEFAULT_LIMIT
and optionally saves them into agsettings
key
- IBusManager:
This is a set of functions doing some basic parsing of javascript code in order to provide sensible autocompletions.
The main function you will probably want to call from external modules (according to the source) is getCompletions(text, commandHeader, globalCompletionList)
.
There are a whole bunch of other helper functions in there too.
See the source for full documentation.
- KeyboardManager:
- LoginManagerSystemd:
- LoginManagerDummy:
- ModemGsm: Class for interacting with DBus interface
org.freedesktop.ModemManager.Modem.Gsm.Network
(mobile internet). - ModemCdma: Class for interacting with DBus interface
org.freedesktop.ModemManager.Modem.Cdma
(mobile internet). - BroadbandModem:
- ObjectManager:
Contains a handy function parse that parses user-provided parameters against default parameters (filling in with defaults if not supplied),
and throwing an error if unrecognised parameters are given (if unrecognised parameters are not allowed). Used throughout the js/ui/*.js
code.
- SmartcardManager:
-
Handful of utility functions:
- findUrls: searches input string for URLs.
- spawn: spawns a process specified by the argument in array form (e.g.
['ls', '-al', '$HOME']
), handling errors by popping up a notification in the message tray. - spawnCommandLine: spawns a process specified by a string (e.g.
ls -al $HOME
), handling errors by popping up a notification in the message tray (usingMain.notifyError(#main.notifyError)
).
-
CloseButton:
See the source for full documentation.