1. 10

Starting a new Linux desktop project, what would be your first step? Are there specs for standards to follow? Is there an example minimal Wayland window manager or the like? Would you use GTK or Qt or something else?

Thanks for any responses.

  1.  

  2. 15

    What do you want to accomplish? Do you want something with the same sorts of abstractions as existing desktops? If so is there a reason other than vanity that prevents you from contributing to KDE or GNOME (do you want to do this as a learning exercise?)? Do you want to do something novel? If so, how will you provide an incremental migration path for existing software?

    Using an existing toolkit locks you into a lot of core abstractions that the toolkit provides and limits your flexibility. Not using an existing toolkit makes it harder for existing apps to work in your environment.

    If I had time to do DE-like things today, I’d contribute to Arcan. It’s the first thing I’ve seen in a long time that looks as if someone is building tooling that enables the kind of system I want to be running ten years from now.

    1. 3

      Just wanted to see for myself how hard it is to create a barebones version. Not for any practical use or to release as an alternative to the existing ones.

      1. 6

        Then my next question is: What do you want to learn?

        • How window management works?
        • How application launchers work?
        • How Wayland / X11 works?
        • How file browsers work?
        • Something else?
        1. 2

          Yes to all of the above, except file browsers.

          1. 9

            For X11, start with XCB, which is an incredibly thin wrapper over the protocol and lets you build up each part of a window manager one step at a time. Start with reparenting, then add compositing support. You’ll find the individual protocol extension docs a good reference.

            For Wayland, the window manager is integrated into the compositor (which is what Wayland calls the window server). This means you can’t easily write one from scratch, but I believe there are some quite configurable ones that you can start with.

            1. 5

              For learning about X11, I cannot recommend this site enough: https://tronche.com/gui/x/xlib/

          2. 1

            Well, then start with a minimal X11 window manager, itʼs just a few lines of code, for instance: http://incise.org/tinywm.html

            1. 2

              Isn’t X11 deprecated? Why not Wayland?

              1. 11

                No, it’s not deprecated, even if some Linux corporations claim otherwise. People still using X11, and will continue to do so in the next decades.

                1. 6

                  For decades its development has been funded by Linux corporations. Now they’re funding something better (for their users’ needs). I’m not sure to what extent others whose needs aren’t met by Wayland have stepped up to fill the gap.

                  This is a relevant post: https://ajaxnwnk.blogspot.com/2020/10/on-abandoning-x-server.html

                  1. 5

                    It’ll exist for decades, but it’s probably going to be doing so in stasis. Still useful to understand, but probably not the future of anything.

                  2. 4

                    Try this for the Wayland equivalent: https://github.com/swaywm/wlroots/tree/master/tinywl

            2. 22

              I wouldn’t. There are too many already, especially given that most of them are (usually poor) clones of the Windows 95 interface: KDE, MATE, Cinnamon, Xfce, LXDE, LXQt, Enlightenment, EDE, Lumina and doubtless several others are all Win9x ripoffs.

              Budgie is a bit different, but it doesn’t do anything you can’t do by tweaking Xfce or MATE. TBH I don’t see the point.

              Elementary OS’s Pantheon desktop is a (very poor) Apple macOS ripoff, and considerably inferior at being that than Ubuntu’s Unity was.

              Unity 8 is still in development over at https://ubports.com/ They’d love some help.

              The Unity 7 desktop is still supported in Ubuntu Unity: https://ubuntuunity.org/ … And that team are working on a successor, Unity-X. I’m sure they’d appreciate some help too; the project lead is only about 11 or so!

              Unity used to have a Qt-based little sibling, Unity-2D: https://wiki.ubuntu.com/Unity2D … It would be wonderful to see that updated and ported to whatever version of Qt is current these days.

              There are others out there that also badly need some love.

              The ROX Desktop — http://rox.sourceforge.net/desktop/ — needs an update. Very small, simple and light, it’s basically a sophisticated version of the GUI from Acorn’s RISC OS operating system. It uses Python 2 and needs a bit of TLC to bring it up to date with Python 3. Personally, if I had the skills, I’d start by ripping out the 0launch system. That never caught on, but it did lead to AppImage.

              GNUstep – http://www.gnustep.org/ – is a reimplementation of NeXT’s NeXTstep and OpenStep GUI in Objective-C. It’s quite feature-complete, but no distro currently includes it, if you fancy experimenting with distro integration.

              There is the NeXTspace project: https://github.com/trunkmaster/nextspace – personally I think that looks promising but I’d prefer to see in on an Ubuntu base, not CentOS.

              There’s also Étoilé – http://etoileos.com/ — which was an effort to modernise GNUstep and make it more like modern macOS. Nobody ever made packages for that to be installed on a modern distro — that would be great to have.

              And an independent effort is the new Hello System: https://github.com/helloSystem/ … Its project lead would really appreciate some help.

              CDE, the original cross-Unix desktop, is FOSS now: https://sourceforge.net/projects/cdesktopenv/ It’d be great to see it on top of Ubuntu, or something lighter-weight such as Devuan or Void Linux.

              AmigaOS is undergoing a little bit of a revival and has just had its first new point release in 28 years (!) – https://www.hyperion-entertainment.com/index.php/news/1-latest-news/290-amigaos-42-for-all-classic-amigas-released-and-available

              Also after 28 years, and for reasons I do not fully understand, the FVWM team have started on a new version: https://github.com/fvwmorg/fvwm3

              Derived from FVWM is AmiWM, a cute window manager that makes your Linux box look like classic AmigaOS: http://www.lysator.liu.se/~marcus/amiwm.html

              It’s just a window manager; as I understand it, it does not include a file manager or the other components of the Amiga desktop.

              If that’s what you fancy doing, then bringing AmiWM back to life would be worthwhile.

              The AmigaOS file manager is called Workbench: https://en.wikipedia.org/wiki/Workbench_(AmigaOS)

              There is already a FOSS relative called Ambient, from the MorphOS project: https://sourceforge.net/projects/morphosambient/

              The FOSS Amiga Research OS, AROS, also has a Workbench replacement called Wanderer: https://forum.amiga.org/index.php?action=gallery;sa=view;pic=3595

              It uses the Zune toolkit: https://en.wikipedia.org/wiki/Zune_(widget_toolkit)

              You can run AROS under VMware – there is a distro specifically for this, called Icaros. Try it and get a feel for the desktop.

              I have no idea if it would be possible to port either Ambient or Wanderer to Linux and integrate it with AmiWM, but that would bring joy to a lot of old Amiga users.

              Another unusual niche desktop that once inspired a lot of love is the MAXX Desktop, which is distantly descended from SGI’s IRIX desktop environment. https://docs.maxxinteractive.com/ That’s something else it would be good to see on a modern Linux.

              There were some older ones that have been lost to history.

              I’m sure there was once a Classic MacOS-type desktop; I think it was called Sparta. I can’t find any mention of it on the modern Web. That would be a cool project to revive; the Classic Finder was a beautiful UI. Start with the black-and-white System 6 look, then add aliases and a hierarchical Apple Menu à lá System 7, then go whole hog with drawers and multithreading and Platinum, MacOS 8-stylee.

              There was XPde, an uncannily-accurate copy of the Windows XP desktop, complete with Luna and Bliss. But that’s best left to history, IMHO.

              1. 8

                I’m semi-qualified to answer this :)

                It is, in fact, a gigantic amount of work. I recommend you start with the basics of window management. There’s this project, wmutils, that lets you perform operations on windows via CLI programs. This way, you could write your own bash shell scripts and your own window manager, gluing them together. Now. This will not give you an intricate understanding of how window management works at the XCB level, however, it will give you a very detailed high level view of how it all works together. I managed my own set of scripts here: https://github.com/kori/wm

                Next, you should probably learn about things like panels. I used to use lemonbar https://github.com/lemonboy/bar for both my panel and notifications. It let you spawn X windows and write text to them, pretty basic.

                At that moment, I started learning more about libnotify, and I wanted to get around to writing my own “notification daemon”, but I never got around to it… But I then learned more about freedesktop.

                I eventually tried making a more sophisticated window manager with Xlambda but again, I also never got around to finishing it. Turns out undiagnosed ADHD is pretty impairing :) I was thinking of resurrecting this… but it’d be a lot different. Anyway, sorry for ranting.

                To sum it up, starting out with understanding how window management works is fundamental because it is the way the windows are drawn to the screen. Next up, I would try and understand more about the way the applications communicate with each other, in the sense of, how does Firefox know how to draw a window at the center of the screen when spawning a new one? (the answer is WM hints, like EWMH or ICCCM). You learn a lot about how important it is to know where to draw windows once you spend a significant amount of time not using a window manager at all.

                DEs, beyond that, are mostly about “design languages” and how to create a useful set of applications that can talk to each other.

                tl;dr: Learn about window managers, learn about panels, learn about notifications, learn about FreeDesktop, learn about design, and you should have a reasonably complete of what making a DE looks like.

                1. 1

                  Here’s a demo video of Xlambda, by the way: https://www.youtube.com/watch?v=PyXzosc0iVc

                  1. 1

                    reasonably complete picture* whoops :P

                  2. 5

                    If you are already into web technologies, maybe this (relatively obscure) project of an HTML5 Wayland compositor might be an interesting way to approach wayland in general: https://github.com/udevbe/greenfield

                    1. 1

                      Super interesting, thanks!

                    2. 5

                      I was literally playing around with window mangers this weekend, so I know exactly where to start!

                      Since you seem interested in wayland, tinwl is a great example of a minimal Wayland compositor. It’s part of the wlroots project, which seems to be a popular library for creating wayland window compositors

                      If you would rather make a window manager in X11, check out dwm, it’s also a small and easy to understand tiling window manager in X11. You could also checkout dwl which is a wayland port of dwm.

                      Last but not least, instead of writing your own window manager, you could use a custom configuration of fvwm. This what NsCDE does.

                      1. 1

                        Great, thanks! Is a window manager responsible for clearing the screen and so on? Or do I need to start a Wayland session some other way and then run the window manager?

                        1. 2

                          Last weekend I ended up using x11, so I don’t know the specifics of Wayland. But for x11 (on Ubuntu),

                          • I logged in to console mode CTRL+ALT+F3
                          • Stopped the gnome window manger, sudo service stop gdm
                          • Modified, ~/.xinitrc to exec $name_of_my_program_here
                          • Run xinit Then the x server (and my window manager) takes care of clearing the screen and so on. I imagine there is a similar process for Wayland
                      2. 3

                        Qt has a framework and some examples to write your own Wayland compositor (under GPLv3): https://doc.qt.io/qt-5/qtwaylandcompositor-examples.html

                        1. 3

                          There is no good definition of what a DE “is” which makes answering here difficult. Most answers are talking about window management, and a WM + a terminal can be a functional DE, but many also provide some way to start apps other than a terminal, or a way to have a desktop wallpaper, or desktop icons. The big fat ones provide all this plus more than can reasonably be listed. Unified settings systems, theme management, notifications, trash bin, automounting media, etcetc

                          1. 3

                            This is an enormous amount of work, you can’t imagine just how much. You’ll get to know the toolkit and adjacent libraries inside-out. The basic set of standards is https://gitlab.freedesktop.org/xdg/xdg-specs plus https://gitlab.freedesktop.org/xdg/shared-mime-info/.

                            1. 2

                              I don’t think you can build something without having an idea of what you want. Otherwise, it won’t be built (bc no motivation to do so), or it won’t be what you want (because you don’t know what you want). You need that north star.

                              That said, for Wayland, you might be interested in using wlroots as a base, since it provides many sundry details for you. For X, brush up on ICCCM/EWMH for implementation details.

                              1. 1

                                It’s an exploration exercise. I don’t have an idea of what I want because I don’t know how it works and what it can even do.

                                1. 3

                                  One “goal” you could try is to flip things around a bit: what if you made Squeak the window manager for your system? I think this would require learning a lot about either X11 or Wayland in the process…