Skip to content

Commit

Permalink
feat: Improve Waydroid launcher, automatically initialize Waydroid if…
Browse files Browse the repository at this point in the history
… not initialized and use first-launch as a default param
  • Loading branch information
KyleGospo committed Nov 1, 2023
1 parent d10c15a commit 5f5f74d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion system_files/desktop/shared/usr/bin/waydroid-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ if [ "$(systemctl is-active waydroid-container.service)" == 'active' ]; then
pkexec /usr/bin/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/bin/waydroid-container-start
Expand All @@ -18,7 +23,8 @@ fi
sleep 2 &&
export XDG_SESSION_TYPE='wayland'
export WAYLAND_DISPLAY='weston-waydroid'
/usr/bin/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
Expand Down

0 comments on commit 5f5f74d

Please sign in to comment.