mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-01-18 04:10:16 +00:00
4c8034f5a6
chore: Standardize all python scripts on #!/usr/bin/python3 chore: Update path for ds-inhibit patch chore(readme): Remove unused package
42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
source /etc/default/waydroid-launcher
|
|
|
|
# Kill any previous remnants
|
|
if [ "$(systemctl is-active waydroid-container.service)" == 'active' ]; then
|
|
pkexec /usr/libexec/waydroid-container-stop
|
|
fi
|
|
|
|
# Check if Waydroid is initialized, initialize if not
|
|
if grep -qz 'not initialized' <<< $(/usr/bin/waydroid status); then
|
|
/usr/bin/ujust init-waydroid
|
|
fi
|
|
|
|
# Launch Weston
|
|
killall -9 weston
|
|
pkexec /usr/libexec/waydroid-container-start
|
|
if [ -z "$(pgrep weston)" ]; then
|
|
/usr/bin/weston --socket=weston-waydroid --width=${WAYDROID_WIDTH:-1280} --height=${WAYDROID_HEIGHT:-800} &> /dev/null &
|
|
fi
|
|
|
|
# Launch Waydroid
|
|
sleep 2 &&
|
|
export XDG_SESSION_TYPE='wayland'
|
|
export WAYLAND_DISPLAY='weston-waydroid'
|
|
LAUNCH_PARAM=$@
|
|
/usr/bin/waydroid ${LAUNCH_PARAM:-first-launch} &
|
|
|
|
# Fix controllers, we know Waydroid has started because surfaceflinger is running
|
|
while [ "" == "$(pgrep surfaceflinger)" ]; do
|
|
sleep 1
|
|
done
|
|
pkexec /usr/libexec/waydroid-fix-controllers
|
|
|
|
# Waydroid is now live!
|
|
# Wait for exit and then clean up
|
|
while [ -n "$(pgrep weston)" ]; do
|
|
sleep 1
|
|
done
|
|
|
|
pkexec /usr/libexec/waydroid-container-stop
|