Title: Trying some Linux distributions to free my Steam Deck
Author: Solène
Date: 16 April 2023
Tags: gaming linux
Description: In this article, I'll share my experience after trying
different Linux distributions on a Steam Deck device.

# Introduction

As the owner of a Steam Deck (a handeld PC gaming device), I wanted to
explore alternatives to the pre-installed SteamOS you can find on it. 
Fortunately, this machine is a plain PC with UEFI Firmware allowing you
to boot whatever you want.

# What's the deck?

It's like a Nintendo Switch, but much bigger.  The "deck" is a great
name because it's really what it looks like, with two touchpads and
four extra buttons behind the deck.  By default, it's running SteamOS,
an ArchLinux based system working in two modes:

* Steam gamepadUI mode with a program named gamescope as a wayland
compositor, everything is well integrated like you would expect from a
gaming device.  Special buttons trigger menus, integration with
monitoring tool to view FPS, watts consumption, TDP limits, screen
refresh rate....
* Desktop mode, using KDE Plasma, and it acts like a regular computer

Unfortunately for me, I don't like ArchLinux and I wanted to understand
how the different modes were working, because on Steam, you just have a
button menu to switch from Gaming to Desktop, and a desktop icon to
switch from desktop to gaming.
Steam Deck official website (with specs)
Here is a picture I took to compare a Nintendo Switch and a Steam Deck,
it's really beefy and huge, but while its weight is higher than the
Switch, I prefer how it holds and the buttons' placement.
# Alternatives

And after starting my quest to free my Deck, I found there were already
serious alternatives.  Let's explore them.

## HoloISO

This project purpose is to reimplement SteamOS the best it can, but
only using open source components.  They also target alternative
devices if you want to have a Steam Deck experience.
Project page
My experience wasn't great with it, once installation was done, I had
to log in into Steam, and at every reboot it was asking me to log-in
again.  As the project was mostly providing the same experience based
on ArchLinux, I wasn't really interested to look into it further.

## ChimeraOS

This project purpose is to give Steam Deck user (or similar device
owners) an OS that would fit the device, it's currently offering a
similar experience, but I've read plans to offer alternative UI.  On
top of that, they integrated a web server to manage emulations ROMS, or
Epic Games and GOG installer, instead of having to fiddle with Lutris,
minigalaxy or Heroic game launcher to install games from these store.

The project also has many side-projects such as gamescope-session,
chimera or forks with custom patches.
Project official website
My experience was very good, the web server to handle GOG/Epic is a
very cool idea and worked well, the Steam GamepadUI was working as
well.

## Jovian-NixOS

This project is truly amazing, it's currently what I'm running on my
own devices.  Let's use NixOS with some extra patches to run your Deck,
and it's just working fine!

Jovian-NixOS (in reference to Neptune, the Deck codename) is a set of
configuration to use with NixOS to adapt to the Steam Deck, or any
similar handeld device.  The installation isn't as smooth as the two
other above because you have to install NixOS from console, write a bit
of configuration, but the result is great.  It's not for everyone
though.
Project page
Obviously, my experience is very good.  I'm in full control of the
system, thanks to NixOS declarative approach, no extra services running
until I want to, it even makes a great Nix remote builder...

## Plain linux installed like a regular computer

The first attempt was to install openSUSE on the Deck like I would do
on any computer.  The experience was correct, installation went well,
and I got in GNOME without issues.

However, some things you must know about the Deck:

* patches are required on the Linux kernel to have proper fan control,
they work out of the box now but the fan curve isn't ideal, like the
fan will never stop even under low temperature
* in Desktop mode, the controller is seen as a poor mouse with triggers
to click, the touchscreen is working, but Linux isn't really ready to
be used like a tablet, you need Steam in big picture mode to make the
controller useful
* many patches here and there (Mesa, mangohud, gamescope) are useful to
improve the experience

In order to switch between Desktop and Gaming mode, I found a weird
setup that was working for me:

* gaming mode is started by automatically log-in my user on tty1 with
the user .bashrc checking if running on tty1 and running steam over
gamescope
* desktop mode is started by setting automatic login in GDM
* a script started from a .desktop file that would toggle between
gaming and desktop mode.  Either by killing gamescope and starting GDM,
or by stopping gdm and startin tty1.  The .desktop was added to Steam,
so from Steam or GNOME I was able to switch to the other.  It worked
surprisingly well.

I turned out Steam GamepadUI with Gamescope button "Switch to desktop
mode" is using a dbus signal to switch to desktop, distributions above
handle it correctly.

Although it was mostly working, my main issues were:

* No fan curve control because it's not easy to find the kernel
patches, and then run the utility to control the fans, my deck was
constantly doing some fan noise, and it was irritating
* I had no idea how to allow firmware update (OS above support that)
* Integration with mangohud was bad, and performance control in Gaming
mode wasn't working
* Sometimes, XWayland would crash or stay stuck when starting a game
from Gaming mode

But, despite these issues, performance was perfectly fine, as well as
battery life.  But usability should be priority for such a device, and
it didn't work very well here.

# Conclusion

If you already enjoy your Steam Deck the way it is, I recommend you to
stick to SteamOS.  It does the job fine, allows you to install programs
from Flatpak, and you can also root it if you really need to install
system packages.

If you want to do more on your Deck (use it as a server maybe? Who
knows), you may find it interesting to get everything under your
control.

# Pro tip

I'm using syncthing on my Steam Deck and other devices to synchronize
GOG/Epic save games, Steam cloud is neat, but with one minute per game
to configure syncthing, you have something similar.

Nintendo Switch emulation works fine on Steam Deck, more about that
soon :)