Skip to content

Commit

Permalink
feat: Ujust scripts for Cloud apps (Xbox Cloud Gaming, others?) (#2223)
Browse files Browse the repository at this point in the history
* feat: add ujust file to make non steam games for webapps

* fix: swap chrome for FF, better default compatibility

* feat: add xbox cloud, tweak script

* chore: clean up script

* feat: first pass of ugum picker menu

* feat: remove PWA firefox method, integrate Aru's Appimage with args method

* feat: add options in exec, for maybe add to yafti?

* add media app installers to yafti for baz portal

* fix: rm plex and crunchyrole as webapps are meh

* chore: add desc, fix just syntax

* fix: better description, syntax
  • Loading branch information
xXJSONDeruloXx authored Feb 20, 2025
1 parent 69466c5 commit 3b53e6f
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ RUN --mount=type=cache,dst=/var/cache/libdnf5 \
echo "import \"/usr/share/ublue-os/just/85-bazzite-image.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/86-bazzite-windows.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/87-bazzite-framegen.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/88-bazzite-webapps.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/90-bazzite-de.just\"" >> /usr/share/ublue-os/justfile && \
if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
systemctl enable usr-share-sddm-themes.mount && \
Expand Down
22 changes: 22 additions & 0 deletions system_files/deck/shared/usr/share/ublue-os/firstboot/yafti.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,28 @@ screens:
default: false
packages:
- Install Resilio Sync: ujust install-resilio-sync
Media Apps:
description: Streaming services that can be added to Steam
default: false
packages:
- YouTube: ujust get-webapp "YouTube"
- Netflix: ujust get-webapp "Netflix"
- Amazon Luna: ujust get-webapp "Amazon Luna"
- Disney Plus: ujust get-webapp "Disney Plus"
- Amazon Prime Video: ujust get-webapp "Amazon Prime Video"
- Apple TV: ujust get-webapp "Apple TV"
- Curiosity Stream: ujust get-webapp "Curiosity Stream"
- GeForce Now: ujust get-webapp "GeForce Now"
- HBO Max: ujust get-webapp "HBO Max"
- Hulu: ujust get-webapp "Hulu"
- Paramount Plus: ujust get-webapp "Paramount Plus"
- Peacock: ujust get-webapp "Peacock"
- Sling TV: ujust get-webapp "Sling TV"
- Spotify: ujust get-webapp "Spotify"
- Vimeo: ujust get-webapp "Vimeo"
- Xbox Cloud Gaming: ujust get-webapp "Xbox Cloud Gaming"
- YouTube Music: ujust get-webapp "YouTube Music"
- YouTube TV: ujust get-webapp "YouTube TV"
configure-bazzite:
source: yafti.screen.package
values:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# vim: set ft=make :

# Add various streaming services as Electron web apps to Steam
get-webapp service="":
#!/usr/bin/bash
# Load ugum for interactive menu
source /usr/lib/ujust/ujust.sh
# Function to install StreamingServiceLauncher
install_launcher() {
echo "Installing StreamingServiceLauncher..."
# Create necessary directories
mkdir -p "$HOME/.local/bin"
mkdir -p "$HOME/Applications"
# Clean up any old versions
rm -f "$HOME/.local/bin/StreamingServiceLauncher.AppImage"
rm -f "$HOME/Applications/StreamingServiceLauncher.AppImage"
rm -f "$HOME/.local/bin/streaming-service-launcher"
# Download latest release
RELEASE_URL="https://api.github.com/repos/aarron-lee/StreamingServiceLauncher/releases/latest"
wget -q $(curl -s $RELEASE_URL | jq -r ".assets[] | select(.name | test(\".*AppImage\")) | .browser_download_url") \
-O "$HOME/Applications/StreamingServiceLauncher.AppImage"
# Create launcher script
echo "#!/bin/bash" > "$HOME/.local/bin/streaming-service-launcher"
echo "\"$HOME/Applications/StreamingServiceLauncher.AppImage\" --appname=\$1 --no-sandbox" >> "$HOME/.local/bin/streaming-service-launcher"
# Make executables
chmod +x "$HOME/Applications/StreamingServiceLauncher.AppImage"
chmod +x "$HOME/.local/bin/streaming-service-launcher"
if [ ! -f "$HOME/Applications/StreamingServiceLauncher.AppImage" ]; then
echo "Installation failed"
exit 1
fi
echo "Installation completed successfully"
}
# Check for StreamingServiceLauncher and install if needed
[ ! -f "$HOME/Applications/StreamingServiceLauncher.AppImage" ] && install_launcher
# Create scripts directory
mkdir -p "$HOME/Applications/streaming_scripts"
# Display menu
if [ -n "{{ service }}" ]; then
CHOICE="{{ service }}"
else
echo -e "\n${bold}Select a streaming service to add to Steam:${normal}"
CHOICE=$(ugum choose \
"YouTube" \
"Netflix" \
"Amazon Luna" \
"Disney Plus" \
"Amazon Prime Video" \
"Apple TV" \
"Curiosity Stream" \
"GeForce Now" \
"HBO Max" \
"Hulu" \
"Paramount Plus" \
"Peacock" \
"Sling TV" \
"Spotify" \
"Vimeo" \
"Xbox Cloud Gaming" \
"YouTube Music" \
"YouTube TV" \
"Exit")
fi
# Exit early if user chose to exit
[ "$CHOICE" = "Exit" ] && { echo "Exiting..."; exit 0; }
# Create webapp script and add to Steam
create_script() {
local script_path="$HOME/Applications/streaming_scripts/$1.sh"
echo "#!/bin/bash" > "$script_path"
echo "\"$HOME/.local/bin/streaming-service-launcher\" \"$2\"" >> "$script_path"
chmod +x "$script_path"
steamos-add-to-steam "$script_path"
echo "Added $1 to Steam successfully!"
}
# Process user choice
case "$CHOICE" in
"YouTube") create_script "youtube" "youtube" ;;
"Netflix") create_script "netflix" "netflix" ;;
"Amazon Luna") create_script "amazon-luna" "amazonLuna" ;;
"Disney Plus") create_script "disney-plus" "disneyPlus" ;;
"Amazon Prime Video") create_script "prime-video" "amazonPrimeVideo" ;;
"Apple TV") create_script "apple-tv" "appleTv" ;;
"Curiosity Stream") create_script "curiosity-stream" "curiosityStream" ;;
"GeForce Now") create_script "geforce-now" "geForceNow" ;;
"HBO Max") create_script "hbo-max" "hboMax" ;;
"Hulu") create_script "hulu" "hulu" ;;
"Paramount Plus") create_script "paramount-plus" "paramountPlus" ;;
"Peacock") create_script "peacock" "peacock" ;;
"Sling TV") create_script "sling-tv" "slingTV" ;;
"Spotify") create_script "spotify" "spotify" ;;
"Vimeo") create_script "vimeo" "vimeo" ;;
"Xbox Cloud Gaming") create_script "xbox-cloud" "xboxGamePassStreaming" ;;
"YouTube Music") create_script "youtube-music" "youtubeMusic" ;;
"YouTube TV") create_script "youtube-tv" "youTubeTV" ;;
*) echo "Invalid choice" ; exit 1 ;;
esac

0 comments on commit 3b53e6f

Please sign in to comment.