feat(gnome): Add nested desktop support from SteamOS

This commit is contained in:
Kyle Gospodnetich 2023-10-22 14:47:45 -07:00
parent a699c90ea8
commit f89018743a
15 changed files with 38 additions and 40 deletions

View File

@ -381,6 +381,7 @@ RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
steamdeck-kde-presets \
; else \
rpm-ostree install \
steamdeck-gnome-presets \
gnome-shell-extension-bazzite-menu \
sddm && \
wget https://raw.githubusercontent.com/doitsujin/dxvk/master/dxvk.conf -O /usr/etc/dxvk-example.conf \

View File

@ -210,6 +210,7 @@ Ported SteamOS and ChimeraOS packages, among others used by Bazzite, are built o
|[ryzenadj](https://github.com/FlyGoat/RyzenAdj)|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/ryzenadj/status_image/last_build.png?)|
|[sddm-sugar-steamOS](https://github.com/JiayuanWen/sddm-sugar-steamOS)|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/sddm-sugar-steamOS/status_image/last_build.png?)|
|[sdgyrodsu](https://github.com/kmicki/SteamDeckGyroDSU)|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/sdgyrodsu/status_image/last_build.png?)|
|steamdeck-gnome-presets|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/steamdeck-gnome-presets/status_image/last_build.png?)|
|steamdeck-kde-presets|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/steamdeck-kde-presets/status_image/last_build.png?)|
|steamdeck-kde-presets-desktop|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/steamdeck-kde-presets-desktop/status_image/last_build.png?)|
|steam_notif_daemon|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/steam_notif_daemon/status_image/last_build.png?)|

View File

@ -5,9 +5,9 @@ Summary: Portions of steamdeck-kde-presets reconfigured for use in GNOME
License: GPLv2
URL: https://github.com/ublue-os/bazzite
Source: https://gitlab.com/evlaV/%{name}/-/archive/master/%{name}-master.tar.gz
VCS: {{{ git_dir_vcs }}}
Source: {{{ git_dir_pack }}}
BuildArch: noarch
Patch0: fedora.patch
Requires: steamdeck-backgrounds
Requires: zenity
@ -22,35 +22,20 @@ Portions of steamdeck-kde-presets reconfigured for use in GNOME
%define debug_package %{nil}
%prep
%autosetup -p1 -n %{name}-master
%build
{{{ git_dir_setup_macro }}}
%install
mkdir -p %{buildroot}%{_datadir}/
mkdir -p %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_prefix}/lib/
mkdir -p %{buildroot}%{_sysconfdir}/
cp -rv usr/share/* %{buildroot}%{_datadir}
cp -rv usr/bin/* %{buildroot}%{_bindir}
cp -rv usr/lib/* %{buildroot}%{_prefix}/lib
cp -rv etc/* %{buildroot}%{_sysconfdir}
mv %{buildroot}%{_sysconfdir}/skel %{buildroot}%{_sysconfdir}/skel.d
mv %{buildroot}%{_datadir}/icons/hicolor/scalable/places/distributor-logo-steamdeck.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/places/steamdeck.svg
# Remove unneeded files
rm %{buildroot}%{_datadir}/icons/hicolor/scalable/places/distributor-logo.svg
rm %{buildroot}%{_sysconfdir}/xdg/autostart/steam.desktop
rm %{buildroot}%{_datadir}/applications/org.mozilla.firefox.desktop
rm %{buildroot}%{_sysconfdir}/profile.d/kde.sh
rm %{buildroot}%{_sysconfdir}/xdg/kcm-about-distrorc
rm %{buildroot}%{_sysconfdir}/X11/Xsession.d/50rotate-screen
# This lists all the files that are included in the rpm package and that
# are going to be installed into target system where the rpm is installed.
%files
%{_bindir}/steamos-add-to-steam
%{_bindir}/steamos-nested-desktop
%{_datadir}/applications/steam/steamos-nested-desktop
%{_datadir}/applications/steam/steamos-nested-desktop/*
# Finally, changes from the latest release of your application are generated from
# your project's Git history. It will be empty until you make first annotated Git tag.

View File

@ -1,4 +1,4 @@
#! /bin/sh
#!/usr/bin/env bash
set -e

View File

@ -1,18 +1,8 @@
#!/bin/sh
#!/usr/bin/env bash
source /etc/default/steamos-nested-desktop
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
## Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
#!/bin/sh
/usr/bin/kwin_wayland_wrapper --width 1280 --height 800 --no-lockscreen \$@
EOF
chmod a+x $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
export PATH=$XDG_RUNTIME_DIR/nested_plasma:$PATH
dbus-run-session startplasma-wayland
rm $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
env MUTTER_DEBUG_DUMMY_MODE_SPECS=${STEAMOS_NESTED_DESKTOP_WIDTH:-1280}x${STEAMOS_NESTED_DESKTOP_HEIGHT:-800} \
dbus-run-session -- gnome-shell --nested --wayland

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -0,0 +1,23 @@
diff --git a/usr/bin/steamos-nested-desktop b/usr/bin/steamos-nested-desktop
index 7cc1b05..22b345f 100755
--- a/usr/bin/steamos-nested-desktop
+++ b/usr/bin/steamos-nested-desktop
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
@@ -7,8 +7,10 @@ unset LD_PRELOAD
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
-#!/bin/sh
-/usr/bin/kwin_wayland_wrapper --width 1280 --height 800 --no-lockscreen \$@
+#!/usr/bin/env bash
+source /etc/default/steamos-nested-desktop
+
+/usr/bin/kwin_wayland_wrapper --width ${STEAMOS_NESTED_DESKTOP_WIDTH:-1280} --height ${STEAMOS_NESTED_DESKTOP_HEIGHT:-800} --no-lockscreen \$@
EOF
chmod a+x $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
export PATH=$XDG_RUNTIME_DIR/nested_plasma:$PATH

View File

@ -8,6 +8,7 @@ URL: https://github.com/ublue-os/bazzite
Source: https://gitlab.com/evlaV/%{name}/-/archive/master/%{name}-master.tar.gz
BuildArch: noarch
Patch0: fedora.patch
Patch1: nested-desktop-resolution.patch
Requires: kde-filesystem

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
if grep -q "wheel" <<< $(groups); then
/usr/bin/pkexec /usr/bin/steam-patch "$*"
fi

View File

@ -0,0 +1,2 @@
STEAMOS_NESTED_DESKTOP_WIDTH=1280
STEAMOS_NESTED_DESKTOP_HEIGHT=800

View File

@ -13,7 +13,7 @@ fi
killall -9 weston
pkexec /usr/bin/waydroid-container-start
if [ -z "$(pgrep weston)" ]; then
/usr/bin/weston --socket=weston-waydroid --width=${WAYDROID_WIDTH} --height=${WAYDROID_HEIGHT} &> /dev/null &
/usr/bin/weston --socket=weston-waydroid --width=${WAYDROID_WIDTH:-1280} --height=${WAYDROID_HEIGHT:-800} &> /dev/null &
fi
# Launch Waydroid