Skip to content

Commit 5f5f74d

Browse files
committedNov 1, 2023
feat: Improve Waydroid launcher, automatically initialize Waydroid if not initialized and use first-launch as a default param
1 parent d10c15a commit 5f5f74d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎system_files/desktop/shared/usr/bin/waydroid-launcher

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ if [ "$(systemctl is-active waydroid-container.service)" == 'active' ]; then
77
pkexec /usr/bin/waydroid-container-stop
88
fi
99

10+
# Check if Waydroid is initialized, initialize if not
11+
if grep -qz 'not initialized' <<< $(/usr/bin/waydroid status); then
12+
/usr/bin/ujust init-waydroid
13+
fi
14+
1015
# Launch Weston
1116
killall -9 weston
1217
pkexec /usr/bin/waydroid-container-start
@@ -18,7 +23,8 @@ fi
1823
sleep 2 &&
1924
export XDG_SESSION_TYPE='wayland'
2025
export WAYLAND_DISPLAY='weston-waydroid'
21-
/usr/bin/waydroid $@ &
26+
LAUNCH_PARAM=$@
27+
/usr/bin/waydroid ${LAUNCH_PARAM:-first-launch} &
2228

2329
# Fix controllers, we know Waydroid has started because surfaceflinger is running
2430
while [ "" == "$(pgrep surfaceflinger)" ]; do

0 commit comments

Comments
 (0)
Please sign in to comment.