Skip to content

Instantly share code, notes, and snippets.

@immacodder
Last active April 25, 2023 15:03
Show Gist options
  • Save immacodder/e283110ede34e2988a234da7820f52e2 to your computer and use it in GitHub Desktop.
Save immacodder/e283110ede34e2988a234da7820f52e2 to your computer and use it in GitHub Desktop.
Steam Deck desktop usability optimizations

Here I will teach you how to make steam deck's desktop mode actually usable. By default, you can only install flatpaks, which extremely limits the possibilities of your computer (steam deck is a computer, don't forget) I myself have been using steam deck as my main computer for about 3 months now and while at first I mainly used windows on it, I soon realized that I could utilize Linux without sacrificing functionality. Bofore each set of command there will be either Host (SteamOS) or Guest (Inside a distrobox distro). If after the command you see Host, run it inside your ususal terminal, if inside of Guest, you'll first need to distrbox-enter yourdistro

Step 1

Install podman and distrobox.

Explanation

Distrobox acts as a linux distribution inside a linux distribution. You can, for example, have an arch based distribution and install ubuntu based distribution with full support for GUI applications. It transparently mounts your user's home directory in a sandbox, allowing it access to your configuration files and filesystem in general. It does, however, require a few tweaks in order to work properly on SteamOS.

Host

# Install Distrobox
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local
# Install Podman (a dependency that manages containers, without it, distrobox will NOT work)
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/extras/install-podman | sh -s -- --prefix ~/.local

Step 2

Now that distrobox is installed, time to install a distribution

Note

You can install any distribution you like, but I strongly recommed Arch distro. Due to AUR it has the best collection of application, CLIs, scripts and whatnot out of any package manager. At the same time it's bleeding edge, so you're gonna get all the new features ASAP. Therefore the instruction below are to install Arch and YAY (an essential tool). If you want to install another distribution, please read the Distrobox's github page (you should do this regardless, though, if any issues arise, you're on your own, don't expect me to be your tech support).

Host

distrobox-create -i docker.io/library/archlinux:latest --name arch # edit the name to your liking
# After the creation is finished, enter the distrbox
distrobox-enter arch # or the name that your chose

Guest

# Install YAY
pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
# for usage, see https://github.com/Jguer/yay
# install an application
yay -S visual-studio-code-bin --noconfirm
# export the application to the host
distrobox-export --app code

Now it will show in your application search on desktop, and after you follow step 3, it will just work (not the Bethesda way).

Step 3

Make SteamOS specific optimization without which exported application from Distrobox will not work.

Explanation

I've acquired knowledge of distrobox from GamingOnLinux article and while they do tell you how to install it, unfortunatelly it seems like they never actually tested it at all. I was forced to try to make my own solution to problems that arised (application simply won't open!) and go github issues to see if there's anybody else that encountered the issues that I did. There was that somebody. Credit for the first fix goes to this person in this github issue: boxxcar It's best to reboot your steamdeck after the set of commands for Host below

Host

# For exported application to work, add run this (if you want explanation, please follow the link above)
cd $HOME/.config/plasma-workspace/env/ && echo "export PATH=${PATH}:/home/deck/.local/podman/bin:/home/deck/.local/bin" > path.sh 

Guest

# Without this fix, no applications inside a container will be able to open browser, taken from the following github issue: https://github.com/89luca89/distrobox/issues/645#issuecomment-1462560668
sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/xdg-open

Note

Gnome-boxes will not be able to redirect a usb device if you install it inside a distrobox, if you want to install it or any other application that doesn't work well inside a container (there are very few) that doesn't have a flatpak version, run these. Before you do, though, read this reddit post

Host

sudo steamos-readonly disable
sudo pacman-key --init
sudo pacman-key --populate archlinux
# Install YAY
pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
yay -Syu gnome-boxes # or any other application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment