feat(waydroid): Set density and gralloc from /etc/default/waydroid-launcher before start

This commit is contained in:
Kyle Gospodnetich 2023-11-03 00:15:09 -07:00
parent 7038cd1049
commit 17ffc696e1
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,17 @@
#!/usr/bin/env bash
source /etc/default/waydroid-launcher
# Ensure needed props are present
if ! grep -q "persist.waydroid.udev=true" "/var/lib/waydroid/waydroid_base.prop"; then
sudo sh -c 'echo "persist.waydroid.udev=true\n" >> /var/lib/waydroid/waydroid_base.prop'
fi
if ! grep -q "persist.waydroid.uevent=true" "/var/lib/waydroid/waydroid_base.prop"; then
sudo sh -c 'persist.waydroid.uevent=true\n" >> /var/lib/waydroid/waydroid_base.prop'
fi
sudo sed -i "s/ro.sf.lcd_density=.*/ro.sf.lcd_density=${WAYDROID_DENSITY:-215}/g" /var/lib/waydroid/waydroid_base.prop
sudo sed -i "s/ro.hardware.gralloc=.*/ro.hardware.gralloc=${WAYDROID_GRALLOC:-minigbm_gbm_mesa}/g" /var/lib/waydroid/waydroid_base.prop
sudo systemctl start waydroid-container.service

View File

@ -1,2 +1,4 @@
WAYDROID_WIDTH=1280
WAYDROID_HEIGHT=800
WAYDROID_DENSITY=215
WAYDROID_GRALLOC=minigbm_gbm_mesa