7

From Understanding The Linux Kernel

Unix is a multiprocessing operating system with preemptable processes. Even when no user is logged in and no application is running, several system processes monitor the peripheral devices. In particular, several processes listen at the system terminals waiting for user logins. When a user inputs a login name, the listening process runs a program that validates the user password. If the user identity is acknowledged, the process creates another process that runs a shell into which commands are entered. When a graphical display is activated, one process runs the window manager, and each window on the display is usually run by a separate process. When a user creates a graphics shell, one process runs the graphics windows and a second process runs the shell into which the user can enter the commands. For each user command, the shell process creates another process that executes the corresponding program.

What does "graphics shell" mean here?

Is gnome shell a graphics shell?

Is my earlier question Where does "graphical shell" stand in the hierarchy of "windowing system, window manager, desktop environment"? related to the one here? The question links to https://en.wikipedia.org/wiki/Shell_(computing)#GUI, which says

Graphical shells provide means for manipulating programs based on graphical user interface (GUI), by allowing for operations such as opening, closing, moving and resizing windows, as well as switching focus between windows. Graphical shells may be included with desktop environments or come separately, even as a set of loosely coupled utilities.

Does "the shell" near the end mean a "graphics shell"? Is it a command line shell running in a terminal emulator?

3
  • "Is it a command line shell running in a terminal emulator?" Probably yes.
    – sebasth
    Commented Sep 16, 2018 at 16:53
  • judging by that fragment, that's not a great read. It's clear that in the mind of the author 'graphics shell' means 'xterm running bash', but I guess that's not the answer you're looking for.
    – user313992
    Commented Sep 16, 2018 at 17:05
  • 2
    +1 to save the question. While it seems obvious, it is not worthy the downvotes. Commented Sep 16, 2018 at 18:29

1 Answer 1

9

The term graphics shell can be both a graphical shell or a command line shell running under it. Meaning, the user graphical interface (GUI) or the command line that controls the GUI functions.

First, let's begin with the shell, what "shell" means: the definition of the word "shell" means a program, or even a group of programs working together, it controls the operating system, and the hardware, so the shell is really the software gives you direct control over the computer.

A graphical shell is a shell that presents output as 2D or 3D graphics, as opposed to plain text. In other words, it is the graphical user interface (GUI) that include windows, menus ...etc that the provide more flexible interaction between the user and the system instead of the plain dull-text offered by terminal interface.

However, given that the core of the GUI is built as a shell, then all its functions can be controlled by the command line. For example, the command gnome-shell is the graphical shell for the GNOME desktop, this command provides core user interface functions for the GNOME desktop that can be adjusted by a command line. Another example, is nautilus which is the main GUI interface of files explorer in Gnome, this interface is available as a command line called nautilus. This command line has the following functions:

$ nautilus --help
Usage:
  nautilus [OPTION...] [URI...]

Help Options:
  -h, --help                  Show help options
  --help-all                  Show all help options
  --help-gapplication         Show GApplication options
  --help-gtk                  Show GTK+ Options

Application Options:
  -c, --check                 Perform a quick set of self-check tests.
  --version                   Show the version of the program.
  -w, --new-window            Always open a new window for browsing specified URIs
  -n, --no-default-window     Only create windows for explicitly specified URIs.
  -q, --quit                  Quit Nautilus.
  -s, --select                Select specified URI in parent folder.
  --display=DISPLAY           X display to use

Meaning, you can control the GUI functions through the command line.

In Linux, a graphical shell is usually made of a couple of layers of software. The operating system should provide graphics drivers, and keyboard and mouse drivers. Then on top of the drivers, you have a windowing system like X11 or Wayland. It creates higher-level wrappers around input (like providing keyboard layouts), to manage the memory that store the 2D images that are transmitted to the display driver, and to provide apps with capabilities to paint to these 2D images in memory.

Above the windowing system you have a window manager, and this is how an application translates keyboard and mouse events into system calls that manipulate the windows that the apps are painting to. This includes tasks such as launching, pausing, hiding, showing, and closing apps, detecting when an app has failed and cleaning up after it.

There are dozens of popular window managers, including Unity, Gnome Shell, Xfwm, OpenBox, i3, Xmonad and many others.

Apps can draw graphics as they see fit, however app developers usually prefer to make use of a common set of drawing tools, so their app looks consistent with all other apps running on the system. These are software libraries that you import into your app. You then call their functions to draw menus, buttons, text input, and display images like PNG and JPG images.

These common drawing tools are called "widget toolkits." The two most popular widget toolkits on Linux are Gtk+ and Qt. You can use both Gtk+ and Qt at the same time, and this is often why different apps on Linux can sometimes have inconsistencies in their look and feel.

These layers are pretty specific to the Linux software ecosystem. Mac OS, Windows, and Android all do things differently, but they all tend to integrate each of these layers into a single monolithic graphical shell software. It simplifies things, but also prevents a lot of customization.

The reason Linux complicates things is because people prefer to have choices, and they enjoy to customize their shells. If you are managing your own Linux distribution, it is a good idea to put some effort into choosing your default set of apps so that they all use the same widget toolkits, and provide a consistent look and feel.

On top of the graphical shell, you can build graphical apps, such as file system browsers, app launchers, notification and system status apps, and system configuration ("control panel") apps. These apps taken collectively make up what we call the "desktop environment."

2
  • 2
    Congrats for synthesising such a nice read, hope you do not mind the grammar tweaks. Commented Sep 16, 2018 at 18:28
  • 1
    @Rui F Ribeiro. Fantastic revisions! thank you so much! ;-)
    – user88036
    Commented Sep 16, 2018 at 18:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .