this post was submitted on 08 Nov 2025
11 points (100.0% liked)

linux4noobs

3217 readers
1 users here now

linux4noobs


Noob Friendly, Expert Enabling

Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.


Seeking Support?

Community Rules

founded 2 years ago
MODERATORS
 

I have installed CachyOS in my main gaming machine and i want it to work like the steam deck: Boot into big picture mode and then you can exit to desktop mode. I went with the desktop image instead of the handheld one because i wanted to use GNOME. I've looked at the cachyos-handheld package but it seems its only for KDE systems.
I tried to make my own scripts to start the compositor using a one-shot system which i believe is what bazzite does, unfortunately i cant get the steam part to work, as the gnome part does work. If someone can take a look at it and give me a hand i would be extremely grateful.

Here is the script you run to switch the next boot:

#!/usr/bin/env bash
set -euo pipefail

usage() {
  cat <<'EOF'
Usage: os-session-select <gamescope|gnome-wayland|gnome-xorg|plasma-wayland|plasma-xorg>

Writes ~/.config/steamos-session-select and logs you out so the one-shot wrapper
can launch the requested session exactly once on next login.
EOF
}

target="${1:-}"
case "$target" in
  gamescope|gnome) ;;
  -h|--help|"") usage; exit 1 ;;
  *) echo "Unknown target: $target"; usage; exit 1 ;;
esac

cfg="$HOME/.config"
sentinel="$cfg/steamos-session-select"
mkdir -p "$cfg"
printf '%s\n' "$target" > "$sentinel"

if command -v steam >/dev/null 2>&1; then
  steam -shutdown || true
fi

# End the current session (GDM should be set to autologin)
if [[ -n "${XDG_SESSION_ID:-}" ]]; then
  loginctl terminate-session "$XDG_SESSION_ID" || true
else
  systemctl --user exit || true
fi

It creates a file in the home directory to indicate to the boot script what to launch, then it kills the current session to restart the gdm manager.

And here is the script of the actual launcher:

#!/usr/bin/env bash
set -euo pipefail

sentinel="${HOME}/.config/steamos-session-select"

xexec() {
  local cmd="$1"; shift
  if command -v "$cmd" >/dev/null 2>&1; then
    exec "$cmd" "$@"
  else
    echo "Error: required command '$cmd' not found." >&2
    exit 1
  fi
}

choice=""
if [[ -f "$sentinel" ]]; then
  choice="$(tr -d '\n\r' < "$sentinel")"
  rm -f "$sentinel" || true
fi

choice="${choice:-"gamescope"}"

case "$choice" in
  gamescope)
    if command -v gamescope-session-plus >/dev/null 2>&1; then
      unset WAYLAND_DISPLAY
      unset WAYLAND_SOCKET
      unset DISPLAY
      export XDG_SESSION_TYPE=tty
      export WLR_BACKENDS=drm
      export ENABLE_GAMESCOPE_WSI=0
      exec gamescope-session-plus steam
    else
      echo "gamescope-session(-steam) not found in PATH." >&2
      exit 1
    fi
    ;;

  gnome)
    exec gnome-session
    ;;

  *)
    echo "Unknown session choice '$choice' โ€“ falling back to GNOME Wayland." >&2
    exec gnome-session
    ;;
esac

When i look at the journalctl output for the error i see what causes the issue is:

xdg_backend: Failed to initialize input thread
Failed to load plugin 'libdecor-gtk.so': failed to init
SDL_Vulkan_CreateSurface failed: VK_KHR_wayland_surface extension is not enabled in the Vulkan instance

And then a core dump. Again, any help would be much appreciated, thanks!!

top 1 comments
sorted by: hot top controversial new old
[โ€“] salieri@lemmy.world 3 points 1 month ago

I was being dumb. Just an FYI if someone stumbles upon this. CachyOS does not include libdecor with its gaming packages selection. Just install it with paru libdecor and select cachyos-extra-znver4/libdecor.