Get the latest tech news

Opening Windows in Linux with sockets, bare hands and 200 lines of C


Intro In this post I want to create a single file C file program to open a windows inside Linux without using xlib or any similar libraries. The idea is to explore X11 protocol and see how it is used to interact with X server to create windows.

Initial request seems like a lot of information to fill but if we skip authorization process we can drastically reduce amount of code we need to write and understand. For this simplification to work we need to disable regular cookie based authentication and allow all app on local machine to connect to X server directly. Here is full source code which contains a bit more functionality than discussed in post (text movement and more detailed debug info):

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Linux

Linux

Photo of Windows

Windows

Photo of lines

lines

Related news:

News photo

The Xbox app on Windows is getting even more handheld-friendly

News photo

Apple Releases iTunes for Windows 12.13.2 With Support for New iPads

News photo

Lucid Bots secures $9M for drones to clean more than your windows