Add install scripts (Flatpak) (#471)

Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
istori1
2022-11-18 19:52:58 -04:00
committed by GitHub
parent 9af770e217
commit 4c1371aaeb
5 changed files with 44 additions and 7 deletions

View File

@@ -104,17 +104,24 @@ Flatpak Package
:alt: GitHub issues by-label
#. Install `Flatpak <https://flatpak.org/setup/>`_ as required.
#. Download ``sunshine.flatpak`` and run the following code.
#. Download ``sunshine_{arch}.flatpak`` and run the following code.
.. Note:: Be sure to replace ``{arch}`` with the architecture for your operating system.
System level (recommended)
.. code-block:: bash
flatpak install --system sunshine.flatpak
flatpak install --system ./sunshine_{arch}.flatpak
User level
.. code-block:: bash
flatpak install --user sunshine.flatpak
flatpak install --user ./sunshine_{arch}.flatpak
Additional installation (required)
.. code-block:: bash
flatpak run --command=additional-install.sh dev.lizardbyte.sunshine
Start:
X11 and NVFBC capture (X11 Only)
@@ -130,7 +137,8 @@ Start:
Uninstall:
.. code-block:: bash
flatpak uninstall --delete-data sunshine.flatpak
flatpak run --command=remove-additional-install.sh dev.lizardbyte.sunshine
flatpak uninstall --delete-data dev.lizardbyte.sunshine
RPM Package
^^^^^^^^^^^

View File

@@ -54,8 +54,7 @@ Setup
Linux
^^^^^
The `deb`, `rpm`, and `AppImage` packages handle these steps automatically. The flatpak does not, third party packages
also may not.
The `deb`, `rpm`, `Flatpak` and `AppImage` packages handle these steps automatically. Third party packages may not.
Sunshine needs access to `uinput` to create mouse and gamepad events.
@@ -81,6 +80,8 @@ Sunshine needs access to `uinput` to create mouse and gamepad events.
[Service]
ExecStart=<see table>
#Flatpak Only
#ExecStop=flatpak kill dev.lizardbyte.sunshine
[Install]
WantedBy=graphical-session.target
@@ -95,7 +96,7 @@ Sunshine needs access to `uinput` to create mouse and gamepad events.
deb /usr/bin/sunshine ✔
rpm /usr/bin/sunshine ✔
AppImage ~/sunshine.AppImage ✔
Flatpak flatpak run dev.lizardbyte.sunshine
Flatpak flatpak run dev.lizardbyte.sunshine
======== ============================================== ===============
**Start once**

View File

@@ -208,3 +208,7 @@ modules:
- sed -r -z -i -e
's/("((do)|(undo)|(cmd)|(detached))"\s*:\s*\[?\n*\s*")(.*")/\1flatpak-spawn --host \7/gm'
/app/share/sunshine/apps.json
- sed -i
's%/app/bin/sunshine%flatpak run dev.lizardbyte.sunshine\nExecStop=flatpak kill dev.lizardbyte.sunshine%g'
/app/share/sunshine/systemd/user/sunshine.service
- install -D $FLATPAK_BUILDER_BUILDDIR/packaging/linux/flatpak/scripts/* /app/bin

View File

@@ -0,0 +1,13 @@
#!/bin/sh
# User Service
mkdir -p ~/.config/systemd/user
cp /app/share/sunshine/systemd/user/sunshine.service $HOME/.config/systemd/user/sunshine.service
echo Sunshine User Service has been installed.
echo Use [systemctl --user enable sunshine] once to autostart Sunshine on login.
# Udev rule and input group
UDEV=$(cat /app/share/sunshine/udev/rules.d/85-sunshine.rules)
echo Configuring mouse permission.
flatpak-spawn --host pkexec sh -c "usermod -a -G input $USER && echo '$UDEV' > /etc/udev/rules.d/85-sunshine.rules"
echo Restart computer for mouse permission to take effect.

View File

@@ -0,0 +1,11 @@
#!/bin/sh
# User Service
systemctl --user stop sunshine
rm $HOME/.config/systemd/user/sunshine.service
systemctl --user daemon-reload
echo Sunshine User Service has been removed.
# Udev rule and input group
flatpak-spawn --host pkexec sh -c "gpasswd -d $USER input && rm /etc/udev/rules.d/85-sunshine.rules"
echo Mouse permission removed. Restart computer to take effect.