COSMIC Team Interview: Building Your Own User Experience

We’re gearing up to release the alpha for COSMIC, a new desktop environment for Linux. An accessible platform builder for user experiences, COSMIC is poised to kickstart the next era in operating systems across any device with a screen.

In this month’s podcast, we were joined by COSMIC team members — CEO Carl Richell, UX Designer Maria Komarova, and Principal Engineer Jeremy Soller — to discuss COSMIC’s beginnings, its design, and its future.

Fuss Around or Build From Scratch?

The COSMIC desktop environment — the part of an operating system that determines how windows are drawn, how applications are built, what settings are available to the user, and how the user navigates their OS — began as a pros-and-cons list for determining the future of Pop!_OS. We wanted to make the OS more flexible for our users, make advanced features more user-friendly, and the team was trying to figure out how to proceed.

First was the GNOME DE (desktop environment) extension by the same name, released for Pop!_OS 21.04. However, building and maintaining an OS experience on top of an extension was unsustainable, as changes to the main project could break the extension with profound impact for Pop!_OS users.

Another consideration, a plugin for GNOME’s Mutter window manager, would struggle with similar instability. Jeremy explored this route initially, but the complexity involved led us to seek out more viable solutions.

Forking GNOME as a whole — duplicating its current state and applying our own changes — was also considered, which would require taking on decades of legacy code and adapting it to fit what we want to build.

The final option? Building a custom DE from the ground up. This was the most work, and the most expensive of the options, but would give us the most control over its quality for our users. And, well, we love making our users happy.


A Shiny New Toy Called Rust

The limitations of our alternatives led us to try something new. This largely included investing resources into the Rust programming language. System76 engineers loved working with Rust for its readability, stability, and memory safety; many modern computer vulnerabilities happen in the system’s memory, and Rust makes it easy to write memory-safe code.

However, it’s a newer language. Where Rust projects like the Iced application toolkit existed, they were not as feature-rich as the alternatives. Building out these functionalities was a high priority, and informed who we selected to work on this project. COSMIC’s toolkit will also be available for Windows and macOS.

Victoria joined the COSMIC team as Product Engineer for her experience with building the Rust-based compositor, Smithay. She would go on to be the primary builder for COSMIC’s own compositor, cosmic-comp, which Jeremy says has been one of the biggest projects we’ve taken on so far as part of the new DE. The core responsibility of the compositor is to manage the drawing of windows and graphical elements on the screen and combining them into a single image for display, while also handling effects like transparency and animations. It is an essential piece that determines the whole feel of the desktop environment.


Rust allows each action to feel more responsive, more fluid, while also being more stable and secure. Jeremy recalls, “The first time I saw tiling integrated into the COSMIC compositor and just how much more fluid and logical it could be than if we had built it as an extension, everything just clicked into place. That was the moment I switched over to COSMIC.”


The Role of Iced: Revolutionizing GUI Development

As the saying goes, if you build it, they will come. Toolkits determine the experience a developer will have in developing an application for your DE. A fluid, intuitive app toolkit will make COSMIC an attractive platform for developers, and a large library of available applications will attract more users. We considered toolkits like GTK, Flutter, and QT, and though the team was already experienced working with GTK for Pop!_OS,  eventually landed on the Rust-based toolkit, Iced. This was in part due to its use of the Elm programming model, which simplifies state management and UI updates, making it easier to develop and maintain applications.

The infrastructure was there with Iced. But again, with the project so young, we needed to build out functionality. Michael and Ashley were the main contributors here, adding base functions like drag-and-drop, clipboard support, and support for input methods, while also building out libcosmic, a widget library that houses a variety of different elements such as list views, grid views, context menus, and the theming system.

Jeremy, meanwhile, worked on text. “Essentially,” he explained to us, “Iced would require you to define a font that you wanted to use, and that would be used for all of the text in the application. You couldn't have any text that wasn't the font that you had chosen.” He went about writing what would become COSMIC Text: a text library for Rust that provides support for scanning the system fonts, finding fonts that match a certain script, rendering using that script, and doing this in an extremely performant way. This was then integrated into Iced, enabling GPU-rendering of any localized font.

Crafting Customization: Design Philosophy and Theming System

The theming system is one of the main focuses of COSMIC. Maria wanted to add quite a lot of flexibility, the process involved determining different sets of elements that could be color-customized and which elements should be paired together. She also created an in-depth system for automatic color calculation that factored in the need to keep sufficient -contrast for text on all surfaces. Container backgrounds can be a different color from window backgrounds, interface text could be tinted, accent color customized. The result is a comprehensive theming system capable of a wide variety of aesthetics, from soothing tones to bright, bold experiences.

Or, as Carl likes to say, your theming system isn’t powerful enough for users to create something beautiful until it’s powerful enough to create something ugly, too.

In COSMIC’s second release, called Epoch 2, we’ll be working towards a feature where the user’s theme is automatically derived from their active wallpaper.

Themes from the Podcast

These are the custom themes that were referenced during a conversation on the latest episode of the System76 Transmission Log podcast. (Included screenshots may predate the current version of COSMIC.)

Frost Giant
Frost Giant
Forest Green
Forest Green
Scarlet Witch
Scarlet Witch
Early Sunset
Early Sunset
Dark Steel
Dark Steel
DOOM (wallpaper artwork by Elena "Greenedera" Zambelli)
DOOM (wallpaper artwork by Elena "Greenedera" Zambelli)
COS 95
COS 95
COSMac
COSMac
Cyberpunk 2077 (artwork by Michal Lisowski)
Cyberpunk 2077 (artwork by Michal Lisowski)

Parts of a Whole

Layer Shell, an advanced protocol for positioning windows, plays a pivotal role in COSMIC's stability. It allows different UI components, such as panels, applets, and even the wallpaper, to operate as independent processes. If an applet were to freeze up, it would not impact the rest of the system; the session for that applet would simply restart, good as new. Another benefit to this is bolstered security: because each applet is its own process, vulnerability in one would not compromise the whole.


Bon Alphétit!

As COSMIC approaches its first alpha release, the team is eager to gather feedback from all of you. Up until now, they’ve been working closely with people who have already been excited about COSMIC’s release. But users have different needs and workflows, and would likely view COSMIC through a different lens. We’re hopeful that the alpha release will provide a glimpse into what we need to polish to make the user experience work for them, too.

The alpha will be an interesting start to our journey with COSMIC. A rough roadmap including accessibility and additional features is on the horizon. When all is said and done, we’ll get to see what custom experiences you build for your own users with COSMIC.


Like what you see?

Share on Social Media