Add sunshin-run and -stop wrapper scripts

These can be used to manage starting and stopping processes that spawn children that otherwise would not be terminated when the moonlight session ends
This commit is contained in:
Josh.5
2023-08-23 16:19:55 +12:00
parent 8ad830d5e4
commit b51036a697
3 changed files with 58 additions and 3 deletions

View File

@@ -29,8 +29,8 @@ mkdir -p "${USER_HOME:?}/.config/autostart"
if [[ ! -f "${USER_HOME:?}/.config/autostart/Sunshine.desktop" ]]; then
echo "${sunshine_autostart_desktop:?}" > "${USER_HOME:?}/.config/autostart/Sunshine.desktop"
fi
# Configure default launchers:
sunshine_apps_json="$(cat <<EOF
# Generate default launchers template:
sunshine_apps_data="$(cat <<EOF
{
"env": {
"PATH": "\$(PATH):\$(HOME)\/.local\/bin"
@@ -62,9 +62,18 @@ sunshine_apps_json="$(cat <<EOF
}
EOF
)"
# Generate default sunshine configuration template:
sunshine_config_data="$(cat <<EOF
global_prep_cmd = [{"do":"","undo":"flatpak-spawn --host /usr/bin/sunshine-stop"}]
EOF
)"
mkdir -p "${USER_HOME:?}/.config/sunshine"
if [[ ! -f "${USER_HOME:?}/.config/sunshine/apps.json" ]]; then
echo "${sunshine_apps_json:?}" > "${USER_HOME:?}/.config/sunshine/apps.json"
echo "${sunshine_apps_data:?}" > "${USER_HOME:?}/.config/sunshine/apps.json"
fi
if [[ ! -f "${USER_HOME:?}/.config/sunshine/sunshine.conf " ]]; then
echo "${sunshine_config_data:?}" > "${USER_HOME:?}/.config/sunshine/sunshine.conf "
fi
echo "DONE"