Pass arguments for waydroid-launcher through to waydroid.

This commit is contained in:
Hosh 2024-05-26 15:48:06 -07:00 committed by GitHub
parent 226e73d5b7
commit d29633bd07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,14 @@
#!/usr/bin/bash
set -eux
source /etc/default/waydroid-launcher
# for backwards compatibility, default to show-full-ui
if (($# == 0)); then
set -- show-full-ui
fi
# Kill any previous remnants
if [ "$(systemctl is-active waydroid-container.service)" == 'active' ]; then
pkexec /usr/libexec/waydroid-container-stop
@ -15,7 +22,7 @@ fi
# Launch Cage & Waydroid
pkexec /usr/libexec/waydroid-container-start
if [ -z "$(pgrep wlr-randr)" ]; then
cage -- bash -c "wlr-randr --output X11-1 --custom-mode ${WAYDROID_WIDTH:-1280}x${WAYDROID_HEIGHT:-800}; sleep 1; waydroid show-full-ui &> /dev/null &" &
cage -- bash -uxc 'wlr-randr --output X11-1 --custom-mode "$1"; sleep 1; shift; waydroid "$@" &> /dev/null' _ "${WAYDROID_WIDTH:-1280}x${WAYDROID_HEIGHT:-800}" "$@" &
fi
# Fix controllers, we know Waydroid has started because surfaceflinger is running

View File

@ -1,3 +1,3 @@
#!/usr/bin/bash
sudo /usr/bin/bash -c 'echo add > /sys/devices/virtual/input/input*/event*/uevent'
echo add | exec sudo tee /sys/devices/virtual/input/input*/event*/uevent