Skip to content

Commit

Permalink
feat(waydroid): Set density and gralloc from /etc/default/waydroid-la…
Browse files Browse the repository at this point in the history
…uncher before start
  • Loading branch information
KyleGospo committed Nov 3, 2023
1 parent 7038cd1 commit 17ffc69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions system_files/desktop/shared/usr/bin/waydroid-container-start
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions system_files/desktop/shared/usr/etc/default/waydroid-launcher
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
WAYDROID_WIDTH=1280
WAYDROID_HEIGHT=800
WAYDROID_DENSITY=215
WAYDROID_GRALLOC=minigbm_gbm_mesa

0 comments on commit 17ffc69

Please sign in to comment.