Skip to content

Commit

Permalink
feat(gnome): Add nested desktop support from SteamOS
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Oct 22, 2023
1 parent a699c90 commit f890187
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 40 deletions.
1 change: 1 addition & 0 deletions Containerfile
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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?)|
Expand Down
23 changes: 4 additions & 19 deletions spec_files/steamdeck-gnome-presets/steamdeck-gnome-presets.spec
Expand Up @@ -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
Expand All @@ -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.
Expand Down
@@ -1,4 +1,4 @@
#! /bin/sh
#!/usr/bin/env bash

set -e

Expand Down
18 changes: 4 additions & 14 deletions spec_files/steamdeck-gnome-presets/usr/bin/steamos-nested-desktop
@@ -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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions spec_files/steamdeck-kde-presets/nested-desktop-resolution.patch
@@ -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
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions system_files/deck/shared/usr/bin/steam-patch-wrapper

This file was deleted.

@@ -0,0 +1,2 @@
STEAMOS_NESTED_DESKTOP_WIDTH=1280
STEAMOS_NESTED_DESKTOP_HEIGHT=800
2 changes: 1 addition & 1 deletion system_files/desktop/shared/usr/bin/waydroid-launcher
Expand Up @@ -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
Expand Down

0 comments on commit f890187

Please sign in to comment.