Skip to content

Commit 0f8987e

Browse files
committed
[linux] notes on X Window System
1 parent 38b90f1 commit 0f8987e

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed
Loading

docs/dev-notes/linux/wsl.md

+56-4
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
|`ignoredPorts` **|`null`|(if `experimental.networkingMode=mirrored`) specifies bindable ports for Linux apps even if ports under active use by Windows (e.g. `3000,9000,9090`); enables unblocking apps using a port for purely Linux side traffic. Ex: port `53` for _Linux Docker Desktop_|
123123
|`hostAddressLoopback` **|`false`|(if `experimental.networkingMode=mirrored`) enables additional local IP address assigned to Host; allows connectivity Container to Host, or Host to Container|
124124

125-
- `path` values must be escaped Windows paths e.g: `C:\\Temp\\myCustomKernel`
125+
- `path` values must be escaped Windows paths e.g: `C:\\Temp\\myCustomKernel`
126126
- `size` values must be a size followed by a unit e.g. `8GB` or `512MB`
127127
- `*` only for Windows 11
128128
- `**` only for [Windows Insiders Program](https://www.microsoft.com/windowsinsider/)
@@ -132,12 +132,62 @@
132132
- `%USERPROFILE%/.wslgconfig`: _**global**_ settings for WSLg
133133
- [WSLg Configuration/Debug Options](https://github.com/microsoft/wslg/wiki/WSLg-Configuration-Options-for-Debugging)
134134

135-
## X11
135+
## X Window System
136136

137-
### Overview
137+
### Terminology
138+
139+
![](../_assets/linux/x11-arch-overview.png)
140+
141+
- `Window System`: provides an interface between keyboard, mouse, gpu and monitor
142+
- `Window Manager`: responsible for window layout, moving, resizing
143+
- `Desktop Environment`: responsible for common graphical UI elements (e.g. icons, toolbars, wallpapers) through bundle components/applications meant to work with each other
144+
- `Display Manager`: graphical login manager responsible for starting login session
145+
- `Session Manager`: responsible for persisting/restoring _desktop session state_ i.e. state of window manager/running applications
146+
147+
### Window System vs Window Manager vs Desktop Environment
148+
149+
_ELI5_ from [source](https://old.reddit.com/r/linuxquestions/comments/8euccd/what_is_the_difference_between_a_window_system_eg/dxye6of/)
150+
151+
- _**Window System**_ (`Xorg`/`Wayland`) talking to _**Kernel**_:
152+
153+
- The entire screen is mine now
154+
- Only I can draw to it
155+
- Put it in pretty color mode
156+
- The entire mouse and keyboard is mine now
157+
- Only tell me if the mouse or keyboard does anything
158+
- _**Programs**_ talking to _**Window System**_:
159+
160+
- Give me a square of screen to draw on
161+
- How big is that square?
162+
- Put a white box in that screen square
163+
- Put a black line in that square
164+
- Did the mouse just click in my square
165+
- Where did it click
166+
- How long for
167+
- Did it move while it was clicked
168+
- _**Window Manager**_ (`i3`/`awesome`) talking to _**Window System**_:
169+
170+
- When you make a square for a program, make a extra bit at the top
171+
- When the mouse clicks and drags that extra bit, move the entire square
172+
- Put an X in that extra bit
173+
- If the mouse clickes that X tell the program to stop, and then delete it's square
174+
- Put an empty box in that extra bit
175+
- When the mouse clicks that empty box in the extra bit, make the square as BIG as you can
176+
- Let's pretend there is a line arround the programs square
177+
- If the mouse clicks and drags that line, change the size of the square, and tell the program it's a different size now
178+
- Maybe put the title of the program in human words in the extra bit too, humans like that
179+
- _**Desktop Environment**_ (`kde`/`gnome`) talking to _**Window System**_:
180+
181+
- Draw loads of pretty little pictures on the screen, but behind everything else
182+
- This picture is a planet with a fox arround it
183+
- Put the human word 'firefox' under that picture
184+
- If the mouse clicks twice really fast on that picture, tell me, and I can start the /usr/bin/firefox program
185+
- HEY, if the mouse ever clicks twice on a picture that is a file, not a program, let me know, I can find the program the mouse needs to open that file
186+
- Hey, if the user ever taps the `super` key on the keyboard, let's move ALL the windows side by side, so the mouse can choose the one it wants
187+
188+
### X11
138189

139190
- `X11`: client-server system for managing GUI using `X protocol` [(reference)](https://goteleport.com/blog/x11-forwarding/)
140-
![](../_assets/linux/x11-program.png)
141191

142192
>
143193
> \[!warning\] `X Server` runs on _**physical/local user machine**_; `X Client` runs on _**server/remote machine**_
@@ -159,6 +209,8 @@
159209
- `hostname:n` -> `localhost:6000+n`
160210
- `hostname/unix:n` -> `/tmp/.X11-unix/Xn`
161211

212+
![X11 Architecture details](../_assets/linux/x11-arch-detailed.png)
213+
162214
### X11 Startup files
163215

164216
[Bash Init Scripts and Loading/Execution Order](https://www.sitepoint.com/understanding-nix-login-scripts/)

0 commit comments

Comments
 (0)