Skip to content

Commit

Permalink
feat: add waydroid
Browse files Browse the repository at this point in the history
  • Loading branch information
apoordev committed Dec 19, 2024
1 parent ec1fef1 commit 8f7170a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is my personal opinionated fork of [ublue](https://universal-blue.org/)'s B

- Replaced VSCode with VSCodium (topgrade support in [#788](https://github.com/topgrade-rs/topgrade/pull/788))
- Added install-nix ujust command [EXPERIMENTAL]
- Added waydroid and waydroid ujust command from bazzite
- Changed Logo

### Secure Boot
Expand Down
48 changes: 48 additions & 0 deletions just/bazzite-waydroid.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# vim: set ft=make :

alias configure-waydroid := setup-waydroid

# Launch Waydroid configuration helper
setup-waydroid ACTION="":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-waydroid <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'init' to select Initialize Waydroid"
echo " Use 'configure' to select Configure Waydroid"
echo " Use 'gpu' to choose Select GPU for Waydroid"
echo " Use 'integration' to enable desktop window integration for Waydroid"
echo " Use 'reset' to select Configure Waydroid"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Waydroid Setup${normal}"
echo "Please read the $(Urllink "https://docs.bazzite.gg/Installing_and_Managing_Software/Waydroid_Setup_Guide/" "Waydroid setup documentation") before continuing"
OPTION=$(Choose "Initialize Waydroid" "Configure Waydroid" "Select GPU for Waydroid" "Reset Waydroid (also removes waydroid-related files from user folder)")
fi
if [[ "${OPTION,,}" =~ ^init ]]; then
if [[ ! $IMAGE_NAME =~ "deck" && ! $IMAGE_NAME =~ "ally" ]]; then
sudo systemctl enable --now waydroid-container
fi
sudo waydroid init -c 'https://ota.waydro.id/system' -v 'https://ota.waydro.id/vendor'
echo "Waydroid has been initialized, please run waydroid once before you Configure Waydroid"
elif [[ "${OPTION,,}" =~ ^configure ]]; then
git clone https://github.com/ublue-os/waydroid_script.git --depth 1 /tmp/waydroid_script
python -m venv /tmp/waydroid_script/venv
source /tmp/waydroid_script/venv/bin/activate
sudo pip install -r /tmp/waydroid_script/requirements.txt
sudo /tmp/waydroid_script/main.py
deactivate
sudo rm -rf /tmp/waydroid_script
elif [[ "${OPTION,,}" =~ gpu ]]; then
sudo /usr/bin/waydroid-choose-gpu
elif [[ "${OPTION,,}" =~ integration ]]; then
waydroid prop set persist.waydroid.multi_windows true
elif [[ "${OPTION,,}" =~ ^reset ]]; then
echo "Resetting Waydroid"
bash -c 'sudo rm -rf /var/lib/waydroid /home/.waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid'
echo "Waydroid has been reset"
fi
1 change: 1 addition & 0 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"tmux",
"usbmuxd",
"wireguard-tools",
"waydroid",
"xprop",
"wl-clipboard",
"zsh"
Expand Down

0 comments on commit 8f7170a

Please sign in to comment.