Skip to content

Instantly share code, notes, and snippets.

@mkg20001
Last active October 13, 2024 14:40
Show Gist options
  • Save mkg20001/74825938f660510a1013a28f967f286b to your computer and use it in GitHub Desktop.
Save mkg20001/74825938f660510a1013a28f967f286b to your computer and use it in GitHub Desktop.
Waydroid in non-wayland desktop (requires cage)
#!/usr/bin/env bash
set -euxo pipefail
if [ -v INSIDE ]; then
sleep 10s
waydroid show-full-ui
exit 0
fi
# don't spawn display in main xdg runtime dir, as this causes wayland-supporting apps to spawn in cage
NEW_XDG=$(mktemp -d)
# fix audio
for f in $XDG_RUNTIME_DIR/pulse* $XDG_RUNTIME_DIR/pipewire*; do
ln -s "$f" "$NEW_XDG/$(basename "$f")"
done
# NOTE: this is compatible with multi-window mode!
# enable with: waydroid prop set persist.waydroid.multi_windows true
# NOTE: resize window to maximum (if not already maximized) BEFORE sleep 10s is over
# otherwise waydroid won't pick the size up
XDG_RUNTIME_DIR="$NEW_XDG" XKB_DEFAULT_LAYOUT=de INSIDE=1 cage -s -m extend -- bash "$(readlink -f "$0")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment