Last active
November 9, 2024 20:38
-
-
Save ayunami2000/25e0c4a4cf9fa82b806a55ba8173087e to your computer and use it in GitHub Desktop.
waydroid helper for linux mint X11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$WAYLAND_DISPLAY" ]; then | |
unset WAYLAND_DISPLAY | |
fi | |
if [ -z "$WAYLAND_SOCKET" ]; then | |
unset WAYLAND_SOCKET | |
fi | |
if [ $1 != "show-full-ui" ] && [ $1 != "app" ]; then | |
waydroid-wayland $@ | |
exit | |
fi | |
if [ -z "$WAYLAND_DISPLAY" ]; then | |
if pidof -qx "cage"; then | |
waydroid-wayland $@ | |
else | |
( | |
sleep 1 | |
wmctrl -c "wlroots - X11-" -b toggle,fullscreen | |
) & | |
SLEEP_PLS=1 cage -- waydroid $@ | |
fi | |
else | |
( | |
while true; do | |
timeout 1s wlr-randr | |
if [ $? -ne 0 ]; then | |
waydroid-wayland session stop | |
# killall -9 cage | |
break | |
fi | |
sleep 1 | |
done | |
) & | |
if $SLEEP_PLS; then | |
sleep 2 | |
fi | |
waydroid-wayland $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment