You are not logged in.

#1 2019-06-28 11:14:32

Portal
Member
Registered: 2019-03-11
Posts: 33

where to learn xlib

I really want to learn x11 programming... but I can't seem to find any good resources to learn xlib. https://www.x.org/docs/X11/xlib.pdf is huge, but it is more a documentation than a tutorial, plus it is extremely hard to understand... I've tried searching everywhere
How did you learn xlib? What courses/books do you recommend?

Last edited by Portal (2019-06-28 11:17:10)

Offline

#2 2019-06-28 11:46:18

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 487
Website

Re: where to learn xlib

Do you want to contribute to X11 or use X11's interface code?
If the former: Read X11's source code.
If the latter: Read the documentation you already found and maybe the source code of e.g. dwm to get an example of how to use it.

Offline

#3 2019-06-28 12:20:36

Portal
Member
Registered: 2019-03-11
Posts: 33

Re: where to learn xlib

are there really no easier ways to learn the interface?

Offline

#4 2019-06-28 13:03:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,040
Website

Re: where to learn xlib

Tinker with window managers.  Start here:
http://incise.org/tinywm.html


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2019-06-28 13:19:52

Portal
Member
Registered: 2019-03-11
Posts: 33

Re: where to learn xlib

thanks that looks really helpful!
but did you guys learn xlib just by reading the documentation? It is flooded with comfusing terminologies...

Offline

#6 2019-06-28 13:23:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,040
Website

Re: where to learn xlib

Don't just read the docs.  Read and implement, or read while you are using it.  Read and understand the documentation for particular functions or structures as you are seeing them put into use.

So to understand and modify tinywm, there are only a couple pages of the Xorg docs, with a couple functions and structures you'd need to understand.  Then start adding things to tinywm, or start with other small but not quite so minimal wms like dwm.

As for the actual documentation, I'd never read it in a pdf like that.  Use the man pages.  I've also used this site extensively.

Last edited by Trilby (2019-06-28 13:25:33)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2019-06-30 00:51:52

ARaCHnid
Member
Registered: 2018-09-20
Posts: 6

Re: where to learn xlib

You are right, the documentation and recommended books are impossible to read.

Here's a tutorial for X Window System Basics:
https://magcius.github.io/xplain/article/x-basics.html

Here's a tutorial for writing a window manager:
https://jichu4n.com/posts/how-x-window- … one-part-i

In terms of getting started, just google around for tiny "main()" style snippets that show how to create a program that draws simple lines / text, etc, then try to understand the programs as best you can.

Offline

Board footer

Powered by FluxBB