mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-14 07:58:26 +02:00
feat: Gaming on NVIDIA is not offered any more, the SteamOS conversion covers NVIDIA PCs
The conversion installs the patched gamescope on every NVIDIA PC and sets up the kernel parameters, suspend memory and 32-bit libraries on a supported card; it turns off an existing Gaming on NVIDIA.
This commit is contained in:
1 parent
bad9a6bf44
commit
2ae3c4f4b3
7 files changed
+45
-58
No files matched your search
+2
-8
@@ -147,15 +147,9 @@ backend_apply() {
|
||||
for id in "${want[@]}"; do [[ "$id" == "$c" ]] && WANTED[$c]=1; done
|
||||
done
|
||||
# The same rules as the menu's toggles.
|
||||
# (Single user mode only needs the conversion where it is offered: not on NVIDIA PCs, where it works without it.)
|
||||
[[ "${WANTED[single]:-0}" == 1 ]] && component_available gaming && ! nvidia_present && WANTED[gaming]=1
|
||||
# On NVIDIA the conversion and "Gaming on NVIDIA" exclude each other: the one that is not on yet wins.
|
||||
if nvidia_present && [[ "${WANTED[gaming]:-0}" == 1 && "${WANTED[nvidia]:-0}" == 1 ]]; then
|
||||
if [[ "${CURRENT[gaming]:-0}" == 1 ]]; then WANTED[gaming]=0; WANTED[boot]=0; WANTED[silent]=0; WANTED[glyphs]=0
|
||||
else WANTED[nvidia]=0; WANTED[bigpicture]=0; WANTED[nvsilent]=0; fi
|
||||
fi
|
||||
[[ "${WANTED[single]:-0}" == 1 ]] && component_available gaming && WANTED[gaming]=1
|
||||
if component_available gaming; then
|
||||
[[ "${WANTED[gaming]:-0}" == 0 ]] && { nvidia_present || WANTED[single]=0; WANTED[boot]=0; }
|
||||
[[ "${WANTED[gaming]:-0}" == 0 ]] && { WANTED[single]=0; WANTED[boot]=0; }
|
||||
else
|
||||
WANTED[boot]=0
|
||||
fi
|
||||
|
||||
+10
-6
@@ -4,8 +4,9 @@
|
||||
# https://github.com/theupriser/steamify-gamescope-nvidia; the package `steamify-gamescope-nvidia` is built here, on the PC,
|
||||
# and replaces `gamescope` (it provides it). The patch is opt-in: gamescope reads `gamescope_drm_gbm_scanout=1` from its
|
||||
# environment, which is set for the gaming session (gamescope-session's environment file, and environment.d).
|
||||
# Used by the SteamOS conversion (`gaming_enable`/`gaming_disable`) on a supported NVIDIA card (`nvidia_supported`):
|
||||
# GTX 16 / RTX 20 series or newer (Turing and later, what NVIDIA's open kernel driver supports).
|
||||
# Used by the SteamOS conversion (`gaming_enable`/`gaming_disable`) on every NVIDIA PC (`nvidia_present`); the kernel
|
||||
# parameters and the rest of lib/nvidia.sh's setup only on a supported card (`nvidia_supported`): GTX 16 / RTX 20 series or
|
||||
# newer (Turing and later, what NVIDIA's open kernel driver supports). Tested on an RTX 5080 only.
|
||||
# Sourced by steamify.sh; not meant to be run on its own.
|
||||
|
||||
GSN_PKG=steamify-gamescope-nvidia
|
||||
@@ -60,9 +61,12 @@ 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_present || return 0
|
||||
# A PC that had "Gaming on NVIDIA" on: Steam must not also start on the desktop.
|
||||
nvidia_swap_out
|
||||
# What NVIDIA's DRM stack wants (lib/nvidia.sh; a supported card only, the functions check): 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
|
||||
@@ -74,7 +78,7 @@ gsn_disable() {
|
||||
# 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_present || return 0
|
||||
nvidia_extras_disable
|
||||
nvidia_kernel_disable
|
||||
}
|
||||
+5
-18
@@ -57,12 +57,9 @@ declare -A CURRENT WANTED
|
||||
|
||||
component_available() {
|
||||
case "$1" in
|
||||
# gamescope's own session shows a corrupted picture on NVIDIA unless it is the patched one (lib/gamescope-nvidia.sh,
|
||||
# installed with the conversion on a supported card); "Gaming on NVIDIA" is the alternative there. Older NVIDIA
|
||||
# cards only get the alternative (the conversion is shown anyway when it's already on, so it can be turned off).
|
||||
gaming|boot|silent|glyphs) ! nvidia_present || gaming_status || nvidia_supported ;;
|
||||
nvidia) nvidia_available ;;
|
||||
bigpicture|nvsilent) bigpicture_available ;;
|
||||
# The SteamOS conversion is offered on NVIDIA PCs too: it installs the patched gamescope there (lib/gamescope-nvidia.sh)
|
||||
# and turns off "Gaming on NVIDIA" (lib/nvidia.sh), which is not offered any more (nvidia_available).
|
||||
nvidia|bigpicture|nvsilent) nvidia_available ;;
|
||||
machine|poweroff) machine_available ;;
|
||||
vram) vram_available ;;
|
||||
# Steamify in the Steam library is for gaming mode's controller: not needed for Big Picture on the desktop (NVIDIA PCs;
|
||||
@@ -297,9 +294,8 @@ toggle_component() {
|
||||
component_selectable "$c" || return 1
|
||||
WANTED[$c]=$(( 1 - WANTED[$c] ))
|
||||
# Single user mode only makes sense on top of the SteamOS conversion.
|
||||
# (On NVIDIA the conversion isn't offered: single user mode logs in by itself, see lib/single-user.sh.)
|
||||
if [[ "$c" == single && "${WANTED[single]}" == 1 ]] && component_available gaming && ! nvidia_present; then WANTED[gaming]=1; fi
|
||||
if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then nvidia_present || WANTED[single]=0; WANTED[boot]=0; fi
|
||||
if [[ "$c" == single && "${WANTED[single]}" == 1 ]] && component_available gaming; then WANTED[gaming]=1; fi
|
||||
if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then WANTED[single]=0; WANTED[boot]=0; fi
|
||||
# Where to boot to is part of the conversion, too.
|
||||
if [[ "$c" == boot && "${WANTED[boot]}" == 1 ]]; then WANTED[gaming]=1; fi
|
||||
# Big Picture is opt-out: ticked along with "Gaming on NVIDIA".
|
||||
@@ -311,15 +307,6 @@ toggle_component() {
|
||||
if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then WANTED[silent]=0; WANTED[glyphs]=0; fi
|
||||
if [[ "$c" == silent && "${WANTED[silent]}" == 1 ]]; then WANTED[gaming]=1; fi
|
||||
if [[ "$c" == glyphs && "${WANTED[glyphs]}" == 1 ]]; then WANTED[gaming]=1; fi
|
||||
# On NVIDIA the SteamOS conversion and "Gaming on NVIDIA" exclude each other (both would start Steam at login);
|
||||
# single user mode works with either.
|
||||
if nvidia_present; then
|
||||
if [[ "$c" == nvidia && "${WANTED[nvidia]}" == 1 ]]; then
|
||||
WANTED[gaming]=0; WANTED[boot]=0; WANTED[silent]=0; WANTED[glyphs]=0
|
||||
elif [[ "$c" =~ ^(gaming|boot|silent|glyphs)$ && "${WANTED[$c]}" == 1 && "${WANTED[gaming]}" == 1 ]]; then
|
||||
WANTED[nvidia]=0; WANTED[bigpicture]=0; WANTED[nvsilent]=0
|
||||
fi
|
||||
fi
|
||||
# The power-off fix is opt-out: ticked along with Steam Machine support.
|
||||
if [[ "$c" == machine ]]; then WANTED[poweroff]=${WANTED[machine]}; fi
|
||||
if [[ "$c" == poweroff && "${WANTED[poweroff]}" == 1 ]]; then WANTED[machine]=1; fi
|
||||
|
||||
+15
-5
@@ -37,11 +37,21 @@ nvidia_present() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# 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; }; }
|
||||
# Not offered any more (2.11.2): the SteamOS conversion with the patched gamescope (lib/gamescope-nvidia.sh) covers NVIDIA PCs.
|
||||
# A PC that has this on keeps it until the conversion is turned on, which calls nvidia_swap_out.
|
||||
nvidia_available() { return 1; }
|
||||
|
||||
nvidia_swap_out() {
|
||||
# The conversion takes over: Steam no longer starts by itself on the desktop at login (both would start it). Steam, the
|
||||
# packages and the NVIDIA settings stay: the conversion needs them too. The state stays for the conversion's own disable.
|
||||
nvidia_status || return 0
|
||||
info "Gaming on NVIDIA is replaced by the SteamOS conversion: Steam no longer starts on the desktop at login."
|
||||
user_systemctl disable --now "$NVIDIA_UNIT" >/dev/null 2>&1
|
||||
rm -f "$(nvidia_unit_file)"
|
||||
user_systemctl daemon-reload
|
||||
krevert bigpicture
|
||||
return 0
|
||||
}
|
||||
bigpicture_available() { nvidia_available; }
|
||||
|
||||
nvidia_status() {
|
||||
|
||||
Reference in new issue
Block a user