feat(just): turn sunshine recipes into 1 recipe

This commit is contained in:
HikariKnight 2024-02-14 01:09:20 +01:00
parent 4763200859
commit c893ac7a02

View File

@ -48,26 +48,49 @@ configure-waydroid:
deactivate
sudo rm -rf /tmp/waydroid_script
# Install Sunshine
install-sunshine:
#!/usr/bin/bash
systemctl enable sunshine-workaround.service
ublue-update --wait
rpm-ostree install -y https://github.com/LizardByte/Sunshine/releases/download/nightly-dev/sunshine-fedora-$(rpm -E %fedora)-amd64.rpm
echo "Sunshine is installed!"
# Remove Sunshine
remove-sunshine:
#!/usr/bin/bash
systemctl disable sunshine-workaround.service
ublue-update --wait
rpm-ostree remove -y sunshine
echo "Sunshine has been uninstalled."
# Autostart Sunshine
autostart-sunshine:
#!/usr/bin/bash
systemctl enable --user --now sunshine.service
# Setup and configure Sunshine Game Streaming host
setup-sunshine ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
SUNSHINE_STATE="$(rpm -qa sunshine)"
SERVICE_STATE="$(systemctl is-enabled --user sunshine.service)"
OPTION={{ ACTION }}
if [ "$SUNSHINE_STATE" == "" ]; then
SUNSHINE_STATE="${red}${b}Not Installed${n}"
else
SUNSHINE_STATE="${green}${b}Installed${n}"
fi
if [ "$SERVICE_STATE" == "enabled" ]; then
SERVICE_STATE="${green}${b}Enabled${n}"
else
SERVICE_STATE="${red}${b}Disabled${n}"
fi
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust setup-sunshine <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'install' to select Install Sunshine"
echo " Use 'remove' to select Remove Sunshine"
echo " Use 'autostart' to select Toggle Autostart"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Sunshine setup and configuration${normal}"
echo "Sunshine is $SUNSHINE_STATE"
echo "Service is $SERVICE_STATE"
OPTION=$(Choose "Install Sunshine" "Remove Sunshine" "Toggle Autostart")
fi
if [[ "${OPTION,,}" =~ ^install ]]; then
systemctl enable sunshine-workaround.service
ublue-update --wait
rpm-ostree install -y https://github.com/LizardByte/Sunshine/releases/download/nightly-dev/sunshine-fedora-$(rpm -E %fedora)-amd64.rpm
echo "Sunshine is installed!"
elif [[ "${OPTION,,}" =~ ^(remove|uninstall) ]]; then
systemctl disable sunshine-workaround.service
ublue-update --wait
rpm-ostree remove -y sunshine
echo "Sunshine has been uninstalled."
elif [[ "${OPTION,,}" =~ ^autostart ]]; then
systemctl enable --user --now sunshine.service
fi
# Install LACT for overclocking & undervolting AMD GPUs
install-lact: