diff --git a/Containerfile b/Containerfile index 593e86a680..91c10cd495 100644 --- a/Containerfile +++ b/Containerfile @@ -893,6 +893,8 @@ RUN /usr/libexec/containerbuild/image-info && \ echo "Compiling gschema to include Bazzite Deck setting overrides" && \ glib-compile-schemas /usr/share/glib-2.0/schemas &>/dev/null && \ rm -r /tmp/bazzite-schema-test && \ + echo "Removing Steam BPM workaround .desktop file" && \ + { rm -v /usr/share/applications/bazzite-steam-bpm.desktop || true; } && \ systemctl enable bazzite-autologin.service && \ systemctl enable wireplumber-workaround.service && \ systemctl enable wireplumber-sysconf.service && \ @@ -936,11 +938,16 @@ ARG VERSION_PRETTY="${VERSION_PRETTY}" COPY system_files/nvidia/shared system_files/nvidia/${BASE_IMAGE_NAME} / # Remove everything that doesn't work well with NVIDIA +# Install X11 session (Remove me for Fedora 41) RUN --mount=type=cache,dst=/var/cache/rpm-ostree \ rpm-ostree override remove \ rocm-hip \ rocm-opencl \ rocm-clinfo && \ + if [[ "${BASE_IMAGE_NAME}" == "kinoite" && "$FEDORA_MAJOR_VERSION" -eq "40" ]]; then \ + rpm-ostree install \ + plasma-workspace-x11 \ + ; fi && \ /usr/libexec/containerbuild/cleanup.sh && \ ostree container commit diff --git a/system_files/deck/shared/usr/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongo.lcd.lua b/system_files/deck/shared/usr/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongo.lcd.lua deleted file mode 100644 index 2c3d1035e5..0000000000 --- a/system_files/deck/shared/usr/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongo.lcd.lua +++ /dev/null @@ -1,48 +0,0 @@ -gamescope.config.known_displays.lenovo_legiongo_lcd = { - pretty_name = "Lenovo Legion Go LCD", - dynamic_refresh_rates = { - 60, - 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144 - }, - hdr = { - -- Setup some fallbacks for undocking with HDR, meant - -- for the internal panel. It does not support HDR. - supported = false, - force_enabled = false, - eotf = gamescope.eotf.gamma22, - max_content_light_level = 500, - max_frame_average_luminance = 500, - min_content_light_level = 0.5 - }, - -- Use the EDID colorimetry for now, but someone should check - -- if the EDID colorimetry truly matches what the display is capable of. - dynamic_modegen = function(base_mode, refresh) - debug("Generating mode "..refresh.."Hz for Lenovo Legion Go LCD") - local mode = base_mode - - -- These are only tuned for 1600x2560 - gamescope.modegen.set_resolution(mode, 1600, 2560) - - -- Horizontal timings: Hfront, Hsync, Hback - gamescope.modegen.set_h_timings(mode, 60, 30, 130) - -- Vertical timings: Vfront, Vsync, Vback - gamescope.modegen.set_v_timings(mode, 30, 4, 96) - - mode.clock = gamescope.modegen.calc_max_clock(mode, refresh) - mode.vrefresh = gamescope.modegen.calc_vrefresh(mode) - - return mode - end, - matches = function(display) - -- There is only a single panel in use on Lenovo Legion Go devices. - if display.vendor == "LEN" and display.model == "Go Display" and display.product == 0x0001 then - debug("[lenovo_legiongo_lcd] Matched vendor: "..display.vendor.." model: "..display.model.." product: "..display.product) - return 5000 - end - return -1 - end -} -debug("Registered Lenovo Legion Go LCD as a known display") ---debug(inspect(gamescope.config.known_displays.lenovo_legiongo_lcd)) diff --git a/system_files/desktop/shared/usr/bin/bazzite-steam-bpm b/system_files/desktop/shared/usr/bin/bazzite-steam-bpm new file mode 100755 index 0000000000..7ffbe2cf3a --- /dev/null +++ b/system_files/desktop/shared/usr/bin/bazzite-steam-bpm @@ -0,0 +1,71 @@ +#!/usr/bin/bash +# Stop Steam client and it in Big Picture Mode +# +# This is a workaround for Big Picture Mode running slugish when switching from +# desktop mode to BPM from the client. See https://github.com/ublue-os/bazzite/issues/1675 + +# TODO 20/10/2024: Remove me whenever the issue above gets solved + +# Check if we are running from a terminal or from a .desktop shortcut +if ((SHLVL > 1)); then + function echoerr() { + echo >&2 "$@" + } +else + function echoerr() { + zenity --error --icon=bazzite-logo --text="$*" + } +fi + +STEAM_BIN=/usr/bin/steam +BAZZITE_STEAM_BIN="/usr/bin/bazzite-steam" +# BAZZITE_STEAM_BIN="$(type -P bazzite-steam)" +STEAM_DIR="${HOME}/.local/share/Steam" +TIMEOUT_SECS=30 + +# List of binaries to check with lsof to prove steam is running +BIN_WATCH=( + "${STEAM_BIN}" + "${BAZZITE_STEAM_BIN}" + "${STEAM_DIR}/steam.sh" + "${STEAM_DIR}"/ubuntu*/steam +) + +# Echo pids of steam processes +function get_steam_pids() { + lsof -t -- "${BIN_WATCH[@]}" 2>/dev/null || true +} + +# Return err if steam is not running +function is_steam_running() { + (($(get_steam_pids | wc --lines) > 0)) + return +} + +function main() { + # Check if steam is running + if is_steam_running; then + # Stop it + ${STEAM_BIN} +quit + + # Wait to be fully stopped + # shellcheck disable=SC2046 + if ! waitpid --exited --timeout ${TIMEOUT_SECS} $(get_steam_pids); then + # Check if we timed out + local err=$? + if ((err == 3)); then + echoerr "ERROR: Timed out stopping Steam. Stopping script..." + exit 1 + + else # Something else happened + echoerr "ERROR: code=${err}; This is strange..." + exit ${err} + fi + fi + fi + + # Start steam in big picture mode + ${BAZZITE_STEAM_BIN} steam://open/bigpicture "$@" +} + +main "$@" diff --git a/system_files/desktop/shared/usr/share/applications/bazzite-steam-bpm.desktop b/system_files/desktop/shared/usr/share/applications/bazzite-steam-bpm.desktop new file mode 100644 index 0000000000..f68c57a0b1 --- /dev/null +++ b/system_files/desktop/shared/usr/share/applications/bazzite-steam-bpm.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Steam Big Picture Mode +Exec=/usr/bin/bazzite-steam-bpm %U +Icon=steam +Terminal=false +Type=Application +Categories=Network;FileTransfer;Game;