Tech News
← Back to articles

Replacing My Window Manager with Google Chrome

read original related products more articles

Replacing My Linux Desktop With Google Chrome

All code in this blog post is fully open source at github.com/FoxMoss/DoteWM/.

This is an image of my window manager with full X11 support but border decorations, background, and window interactions are handled by a web browser.

Let me explain.

A Primer

To display a program window an operating system uses a window display server. On Linux this is mainly X11 written by MIT in 1984, it’s old and starting to show it’s age and Wayland is taking some of X11 market share. So with a window display server you can display windows, makes sense, but to get the nice behavior of movement, resizing buttons, and keybinds, we need a window manager. This is a separate program that the display server consults on how it should render and handle the windows. Then all the windows need to know is how to talk to the display server and all the window manager needs to know is how to handle the windows. This is a lovely system which allows for window managers to take on all different kinds of shapes sizes and appearances while maintaining general compatibility with most programs.

The goal of the project was to decrease the skill needed to write a fully customized window manager. I’ve been aware of many projects that try to do the very opposite of this project for a while, i.e. put the desktop environment into the web, with some decent success. See puter and AnuraOS for two great examples of such projects. It’s quite a bit easier to tweak CSS constants, and JS snippets then it is to change style embedded already in a long standing modern desktop/window manager. So lets bring the web to the desktop and have a browser control the system. That’s the pitch and that’s what we’re going to do.

The Browser

So how do we actually pull off this magic trick? I started with the web browser because I figured this would be the hardest bit. We need to communicate with the Javascript process while keeping access to low level interfaces as to interact with our windows. Then the other requirement is being able to serve our webpage without a HTTPS request leaving our computer.

How? CEF.

... continue reading