feat: on a supported NVIDIA card the SteamOS conversion replaces Gaming on NVIDIA
Sync git.upriser.nl mirror / sync (push) Skipped

The conversion also sets up what Gaming on NVIDIA did there (kernel parameters, early modules, suspend memory, 32-bit libraries). Gaming on NVIDIA is only offered on older NVIDIA cards, or while it is on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkpbsMw4rQyBsxDG6ebHK2
This commit is contained in:
theupriserandClaude Sonnet 5.5 committed 2026-10-13 18:24:54 +02:00
1 parent 515019770f
commit 2811ecce1c
5 files changed
+29 -16

No files matched your search

+9 -1
View File
@@ -61,12 +61,20 @@ gsn_env_disable() {
gsn_enable() {
# Only on a supported NVIDIA card; elsewhere the stock gamescope is right.
nvidia_supported || return 0
# What NVIDIA's DRM stack wants (lib/nvidia.sh): modeset/fbdev on the kernel command line, the modules in the
# initramfs, video memory kept over suspend, the 32-bit libraries. Takes effect at the next boot, like the session.
nvidia_kernel_enable || return 1
nvidia_extras_enable || return 1
gsn_install_package || return 1
gsn_env_enable
ok "gamescope draws NVIDIA's picture through GBM (gamescope_drm_gbm_scanout=1) from the next gaming mode start."
}
gsn_disable() {
# The setting goes; the patched package stays, like the other packages (steam, gamescope-session-cachyos).
# The setting goes, and what nvidia_*_enable added; the packages stay (patched gamescope, 32-bit libraries), like
# the other packages of the conversion (steam, gamescope-session-cachyos).
gsn_env_disable
nvidia_supported || return 0
nvidia_extras_disable
nvidia_kernel_disable
}
-4
View File
@@ -206,8 +206,6 @@ detect_components() {
component_available "$c" && component_selectable "$c" && ! is_action "$c" &&
[[ " ${NO_PRESELECT[*]} " != *" $c "* ]] && WANTED[$c]=1
done
# On NVIDIA "Gaming on NVIDIA" is the default; the conversion (a patched gamescope, built here) is a choice.
nvidia_present && WANTED[gaming]=0 WANTED[glyphs]=0
machine_available && WANTED[cec]=1
fi
}
@@ -286,8 +284,6 @@ defaults_list() {
sel=false; component_selectable "$c" && sel=true
on=false
[[ "$sel" == true && " ${NO_PRESELECT[*]} " != *" $c "* ]] && on=true
# (On NVIDIA the conversion is a choice: "Gaming on NVIDIA" is preselected, see show_menu's first run.)
[[ "$c" == gaming || "$c" == glyphs ]] && nvidia_present && on=false
[[ "$c" == cec ]] && machine_available && on=true
items+="${items:+,}{\"id\":$(json_str "$c"),\"label\":$(json_str "${LABEL[$c]%%:*}")"
items+=",\"hint\":$(json_str "$( [[ "${LABEL[$c]}" == *:* ]] && echo "${LABEL[$c]#*: }")")"
+12 -5
View File
@@ -37,9 +37,11 @@ nvidia_present() {
return 1
}
# Shown on NVIDIA PCs. It and the SteamOS conversion exclude each other (both
# would start Steam at login): the menu unticks one when the other is ticked.
nvidia_available() { nvidia_present; }
# The SteamOS conversion with the patched gamescope (lib/gamescope-nvidia.sh) replaces this on a supported card, so
# this is for older NVIDIA cards, and for a PC where it is already on (so it can be turned off, or swapped for the
# conversion). It and the conversion exclude each other (both would start Steam at login): the menu unticks one when
# the other is ticked.
nvidia_available() { nvidia_present && { ! nvidia_supported || nvidia_status; }; }
bigpicture_available() { nvidia_available; }
nvidia_status() {
@@ -76,14 +78,19 @@ nvidia_disable() {
user_systemctl disable --now "$NVIDIA_UNIT" >/dev/null 2>&1
rm -f "$unit"
user_systemctl daemon-reload
nvidia_extras_disable
# Swapped for the SteamOS conversion (turned on first, in the same run): it needs the same settings, they stay.
gaming_status 2>/dev/null || nvidia_extras_disable
pkgs="$(state_get nvidia installed_pkgs)"
if gaming_status 2>/dev/null; then
local p; pkgs=" $pkgs "
for p in $NVIDIA_LIB32_PKGS; do pkgs="${pkgs// $p / }"; done
fi
# Only what Steamify installed; games and the Steam folder stay.
# shellcheck disable=SC2086 # a list of package names
[[ -n "$pkgs" ]] && sudo pacman -Rns --noconfirm $pkgs >/dev/null 2>&1
state_clear nvidia
krevert bigpicture
nvidia_kernel_disable
gaming_status 2>/dev/null || nvidia_kernel_disable
ok "Steam no longer starts at login."
}