How to Assemble a GNU/Linux desk(top) Part 1.5 : X Window System

Unnoticeable system behind your comfy desktop

asem bused
Script Diary.sh

--

In case you want to read part 1 Here

X Window System, X.org, X11, X is word that we rarely stumble in our GNU/Linux usage. As rare as it may be, X have a huge role in our daily use without you even know it. In this article we going to learn more about terms that come with X Window System. I’m sure this gonna be another long and confusing article both for me and you, so please feel free to take some break (me myself also gonna take some break in writing this article from time to time when i get too confused with X and friends).

X Window System in general (it’s not a display server)

So from the last article about GNU/Linux desktop which you can read here, we know that display server is vital for our system graphical needs. But display server itself is another term that apply to X window system (it might also apply to it’s derivative). X Window System in general is a windowing system that it’s work is to manage different part of display screen, it provide a graphical window that contain any graphical component from a software that communicate with it. To put it my way graphically this is an image i come up with.

X Window System Representation

In the following image we can see that X Window System is like a core to our interaction with the system (graphically ofc), we can also see that every running software that needs a graphical display needs to communicate with X Window Server in order to show up in the display screen. X also handle some of the font management that going to be displayed on your display screen (neat right ?).

X11, X.org, XFree86, and other X’s name

The most common and used term in X Window System is X11, X.org, and XFree86 but we (including myself) somehow still unfamiliar with these term which have a major role in our desktop usage. Does this name / term even matter ? well for tech savvy i think it does, but for end user i believe even this article doesn’t matter that much. In short X Window System is the predecessor of X11 (of course it is, since X11 itself means X window system version 11). Then come XFree86 is an implementation of X Window System for Unix Like System which is free and open source, but it’s already outdated since it’s last updated in 2009. After XFree86 come X.org as it’s derivative(first X.org version is a fork of Xfree86) which is still maintained till the time this article is written. There also many more derivative and successor of X Window System which you can find it out yourself (search engine, wikipedia, and manual (man) is your best friend).

Note that not every software that started with X is a derivative or implementation of X Window System. There are some utility tool made to make operating, and configuring X Window System (and other) much easier. Some which are xinput (to configure input device), xev (read event of your input device), xdotools (operating X through command line *scriptable), xprop (read X window properties), xkill (kill a software using mouse pointer), xset (configuration utility for x), and many more term, command, and name that related to X Window System.

X11 Protocol (your system social media ?)

Writing “X Window System” multiple time took some time and with the previous description i think it safe to assume you guys understand X is “X window system” so from this section onward i going to use X as term for X window system.

We already know that X is communicating with several software as well with user, to ease user to communicate with system through display screen, and their trustworthy mouse. In order to make communicating with software and user much more organized, safe, simple, fast, (and many more consideration included), a protocol is used to communicate across software. X/X11 Protocol is the protocol that did just that, it become standard to communicate with X. So in order to display something to display screen, a software need to follow the rule of X protocol, just like what we did when we use social media to share stuff to the internet we need to follow the rule of the social media (X protocol is much more strict thou).

XServer, and XClient (Real world use of X)

Enough with all those definition, jargon, and terms about X, give me an example of X usage. In short i couldn’t give you much example, i usually just use startx command to start my xserver, and window manager in it(using .xinitrc file). But the CLI usage of X is just like that, other than that i think it would be mostly configuring X and tweaking your own customized behavior for your X or window manager. Even though X is a local software that can be launched without any network connection, it uses terminology of server-client model. But these terminology of server client is unusual for most people, where usually server provide the service through other computer with different specification and the client only issue command and get the output. In X these terminology is reversed, with server in your own machine display screen, client is an graphical application software (Firefox, LibreOffice, etc) that are not limited to your local software but also connected computer through network, and also server is the one that get the graphical output of the system. I hope the following image can help clear out some confusion regarding my bad presentation of words.

Note that a GNU/Linux system could also launch multiple xserver in 1 host, and hover through it providing possibilities to use multiple window manager and desktop environment. It is also possible to launch an application from different host giving a possibility to use other system resource while using graphical interface from your local system. Here a method that i learned from LibreOffice Conference Indonesia is to ssh to another system and launch an application from that system. Here is the command to do that

ssh -CY *other-system and then just launch the application with command line. (make sure you are on running X server when connecting with ssh to redirect X).

You can also run an application through local tty by using DISPLAY variable (you need to export it in order to make it environment variables.)

If you have more trick or method to use with X please let me know, i would like to learn about it as well.

Introducing X with Window Manager

Even though there are many advantage and feature using X, there also many flaw that X have, some have it’s remedy some are not. one if it’s flaw which is managing window with X by itself isn’t enough to provide many functionality, ease of use, accessibility and decoration to your desktop. The following flaw is remedied with Window Manager that provide many feature that X doesn’t have. Window manager works as X client which own an entire display screen of X and manage window through X protocol.

There are many more other flaws in X, ( of course it is, it doesn’t even release another major version since 1987) and X also have different purpose in head when it was first developed. By the time this article written X as it latest version from X.org have many plugin and by that plugin we can have our desktop like we use at this moment. Our desktop is also not only consist from X but also other application that help X to become a system that could provide us with beautiful graphical desktop. There also another X competitor called wayland which is currently developed by X.org developer to replace X at the time this article written. Even with many new competitor X still stands for 30 + year and keep growing till today. It doesn’t mean X is a great system, but X provide a way for other developer to help and build more robust system from every flaw they have. X have a standard to keep it as simple as it could without limiting it’s user to learn, modify, or even developing a better system giving freedom like other FOSS did.

I am out of word and topic at this point, with this i close this part with some information regarding this series. The reason why this is Part 1.5 and not Part 2 is, there are too many information about X but you won’t tinker much of X after you got it up and running (unless you want to do more stuff with it), but with this information you could address some of your problem to proper software and not blindly searching through the internet. I hope this article could help people understanding system behind our desktop environment that usually overlook (i myself learned a lot of stuff from writing this article). The next part is going to talk about Window Manager which you could lookup before or maybe do some research on your own.

You can learn about Window Manager in Indonesian language with video below

or maybe you are interested in trying i3 as one of the tiling window manager that i use myself. You can explore the following github repositories that provide guide on how 2 i3 beautifully.

If you are reading up to this point, thank you and it would be nice to leave a clap or follow me to motivate me to write more 😏.

--

--