Gamescope with flatpak vs layered?

I’m getting used to immutable distros, and having unique challenge with gamescope and flatpak - installing any version (there are few) with flatpak install gamescope doesn’t make them accessible in command line - which gamescope returns none. I can find the flatpak binaries but can’t seem to get it working that way.

On the other hand, layered gamescope works great!

In this case, should i stick to layered anyways because I’d assume that gamescope needs OS access than flatpak allows?

(funny, on other hand, flatpak steam works just fine!)

That depends. I use bazzite not aurora so it differs a little, but hear me out. I got both mangohud and gamescope layered, and it is used basically only by layered steam

I also have flatpaks of heroic and bottles. In these cases I needed to install the newest runtimes of flatpak gamescope (these programs couldn’t find the layered package)

Ah ok yes yes, not obvious but makes sense.

do you need to do anything special to tell flatpak heroic to see flatpak gamescope?

I’m also exploring distrobox (this is all newish to me!), since I use gamescope outside of steam for just one old game.

I’ve done my fair amount of miss and matching. For what i understand you need to match runtimes. The best way to find out what you need is to use warehouse

I.g.
I have heroic installed

There I can see I have 25.08 runtime. Now all i need to do is find the matching realese of gamescope

After installation, heroic/bottles should see gamescope automatically

One note. These programs tend to sh*t themselves if you have more than one runtime installed, so you should only install the correct one.

(Sorry for polish on screenshots, but I’m to lazy to change locale)

So the way to run the gamescope flatpak is by flatpak run org.freedesktop.Platform.VulkanLayer.gamescope. If your program expects gamescope to exist as an executable, you can just write a script that wraps the flatpak run.

#!/bin/bash

flatpak run org.freedesktop.Platform.VulkanLayer.gamescope "$@"

It should be visible to other programs if you save it as ~/.local/bin/gamescope.


What I’ve been experimenting with is writing a generic wrapper that I make symlinks to for each flatpak I want to expose as an executable. It relies on being able to grep the output of flatpak list to deduce what flatpak should be run.

Saved as ~/.local/bin/flatwrapper;

#!/bin/bash

if [[ "$CONTAINER_ID" ]]; then
    # In distrobox
    distrobox-host-exec "$0" "$@"
    exit $?
fi

app="$(flatpak list --columns=application,name | grep -i -- "${0##*/}" | head -n1 | awk '{ print $1 }')"

if [[ ! "$app" ]]; then
    echo "no flatpak installed matching ${0##*/}"
    exit 1
fi

exec flatpak run "$app" "$@"

Then just make symlinks of it, like ~/.local/bin/gwenview. The name of the symlink decides what flatpak will be run.

cd ~/.local/bin
ln -s flatwrapper gwenview
ln -s flatwrapper mpv
ln -s flatwrapper okular
ln -s flatwrapper plex
ln -s flatwrapper zoom
ln -s flatwrapper telegram
ln -s flatwrapper element
ln -s flatwrapper firefox

And so forth.

It does its best but is not 100% accurate. If the grep matches more than one flatpak, the topmost one will be used. When it doesn’t work as expected you can just use the other script.

Thank you, i’ve learned a lot! is runtime matching something specific to gamescope, or that works for everything? if so, this is a really big deal in getting flatpaks to see each other in some cases

Yep. It works with other programs. E.g. mangohud or lsfg-vk

ah i remember why i stopped this, i get this error

➜ flatpak run org.freedesktop.Platform.VulkanLayer.gamescope
bwrap: execvp /bin/sh: No such file or directory

I found some stuff about this but didn’t fully understand what. I wonder if this is why steam, even if on same version as gamescope, fails. Going to poke around some more - thank you for confirming that it should work if platform versions match.

Confirmed that gamescope is visible inside steam

flatpak run --command=/usr/lib/extensions/vulkan/gamescope/bin/gamescope com.valvesoftware.Steam --help

so now it’s just some details to figure out (wayland issue? etc)

Maybe explain what are you trying to do. I and other guy approached your problem from different sides, but I don’t know what are you trying to do

Sure, here’s some background info, i’ve been trying out few things to:

  • figure out how i feel about aurora (like most defaults, but do miss layered steam + gamescope) vs bazzite
  • flatpak vs distrobox vs layered installation

In my case, i have desktop PC for gaming and framework 13 laptop for productivity. For gamescope specifically, sticking points (both EgoSoft games lol)

  • X4 has wayland issues unless it’s running under gamescope with steam
  • X3FL only runs well under gamescope without steam (to scale game visually)

Currently it seems that bazzite is the way to go, as much as i’d like to use aurora. With bazzite remaining problems are much smaller (like getting steam overlay + gamescope). However i’ll keep trying few more things in next few days - this is mostly been a great learning curve by design!

1 Like

Sorry to ask a newbie question but… what is layered Gamescope ?

It’s well described in documentation . It’s a way of installing dnf packages on immutable system

And I use it from command line with “gamescope (parameters) (game executable)”, which I need for few old games that don’t scale well to “high resolution” (stretch 1280x800 to my screen size)