Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Port sunshine config from bazzite #29

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions just/bluefin-apps.just
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,53 @@ setup-brew-not-found ACTION="":
pkexec rm -f "${FILES_TO_BE_REMOVED[@]}"
echo "Brew command-not-found has been ${b}${red}disabled${n}"
fi


# Enable Sunshine for remote desktop and game streaming | https://app.lizardbyte.dev/Sunshine/
[group('Apps')]
setup-sunshine ACTION="":
#!/usr/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
ublue-update --wait
dnf5 copr enable -y lizardbyte/beta
rpm-ostree install --apply-live -y Sunshine
echo "Sunshine is installed!"
elif [[ "${OPTION,,}" =~ ^(remove|uninstall) ]]; then
ublue-update --wait
rpm-ostree remove -y Sunshine
dnf5 copr disable lizardbyte/beta
echo "Sunshine has been uninstalled."
elif [[ "${OPTION,,}" =~ autostart ]]; then
if [[ "${SERVICE_STATE,,}" =~ disabled ]]; then
systemctl enable --user --now sunshine.service
else
systemctl disable --user --now sunshine.service
fi
fi
Loading