Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waydroid setup #22

Open
7 of 10 tasks
Tracked by #38
boredsquirrel opened this issue Jan 15, 2023 · 17 comments
Open
7 of 10 tasks
Tracked by #38

Waydroid setup #22

boredsquirrel opened this issue Jan 15, 2023 · 17 comments
Assignees
Labels
deep mod includes in depth tweaks | not simple tweaks priority prioritized software related software stuffs system wide modification program option that will modify a system wide setting

Comments

@boredsquirrel
Copy link
Collaborator

boredsquirrel commented Jan 15, 2023

ToDo:

  • install waydroid as package, launch the following commands:
  • init waydroid with specific parameters
  • create shutdown, start and fullscreen desktop entries (have to try what is already there)
  • add a delete command and notify about it somewhere useful (Waydroid folder in home?)
  • install the waydroid-extras script for ARM emulation, NDK, Magisk or GAPPS (guide how to use, maybe choosable options)
  • get keyboard layouts working (remount /var/lib rw, edit a .kl file, no fixes and closed issues...)
  • enable autostart of waydroid (if wanted for some reason)
  • mount bind folders
  • fix appstarters for enabling and disabling systemd service against RAM hog
  • additional bugfixes

Waydroid starting manually commands

@boredsquirrel
Copy link
Collaborator Author

boredsquirrel commented Jan 15, 2023

Create an appstarter containing

waydroid show-full-ui

as Multi-windows mode is buggy af.

printf """[Desktop Entry]
Type=Application
Name=Waydroid Fullscreen
Exec=waydroid show-full-ui
X-Purism-FormFactor=Workstation;Mobile;
Icon=/usr/lib/waydroid/data/AppIcon.png""" > ~/.local/share/applications/waydroid-fullscreen.desktop

Maybe it is already installed? That appstarter is not mine.

@boredsquirrel
Copy link
Collaborator Author

boredsquirrel commented Jan 15, 2023

Waydroid delete script:

printf """#!/bin/bash

echo "- - - - - - - Stopping Waydroid - - - - - - - - "
waydroid session stop
sudo waydroid container stop

echo "- - - - - - - - uninstalling Waydroid, this will take some time - - - - - -"
rpm-ostree remove waydroid

echo "- - - - - - - Removing Waydroid files - - - - - - "
sudo rm -rf /var/lib/waydroid /var/home/.waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid ~/.local/share/applications/ons/*waydroid* 

notify-send -a "Waydroid" -t 5000 "Removed" "Reboot to complete removal"
""" > ~/.local/bin/remove-waydroid

Appstarter currently doesnt work, because Kickoff cant launch sudo commands, annoying. running remove-waydroid from terminal will work though

@boredsquirrel
Copy link
Collaborator Author

boredsquirrel commented Jan 15, 2023

Waydroid stop appstarter (doesnt really work normally):

printf """[Desktop Entry]
Exec='waydroid session stop'
GenericName=close running Waydroid instance
Icon=system-shutdown-symbolic
Name=Shutdown Waydroid
StartupNotify=true
Type=Application""" > ~/.local/share/applications/shutdown-waydroid.desktop

@boredsquirrel

This comment was marked as outdated.

@boredsquirrel
Copy link
Collaborator Author

Does GNOME Allow desktop files? My experience was they are not shown. On Kubuntu with GNOME installed it was very messy too.

@iaacornus
Copy link
Collaborator

iaacornus commented Jan 23, 2023

Does GNOME Allow desktop files? My experience was they are not shown. On Kubuntu with GNOME installed it was very messy too.

yes in $HOME/.local/share/applications/ you create a .desktop file

https://wiki.archlinux.org/title/desktop_entries

@iaacornus
Copy link
Collaborator

do we really need waydroid? it seems to be only for specific strata of population, not for general one.

@boredsquirrel
Copy link
Collaborator Author

boredsquirrel commented Feb 2, 2023

I mean Waydroid is the only Wayland Android emulator there is. Its very hacky, getting to run aarch64 Apps on it even more, but possible. Use cases for example:

  • banking app as second factor (as we all know our LUKS encrypted computer is safer than a phone)
  • Netflix app for downloading DRM videos on Linux
  • games, some people use an extra package to assign keyboard shortcuts. Not as powerful as Proton maybe but an easy and mostly free fix for gaming on Linux
  • some proprietary software
  • stupid software like Telegram allowing encryption only on Android, or Signal to setup an Account
  • tons of FOSS Android apps from F-Droid

@boredsquirrel
Copy link
Collaborator Author

But no problem I will handle that all, as I nearly got all configs for setting it up. Waydroid is also in the main repo now, so even better!

@iaacornus
Copy link
Collaborator

I mean Waydroid is the only Wayland Android emulator there is. Its very hacky, getting to run aarch64 Apps on it even more, but possible. Use cases for example:

* banking app as second factor (as we all know our LUKS encrypted computer is safer than a phone)

* Netflix app for downloading DRM videos on Linux

* games, some people use an extra package to assign keyboard shortcuts. Not as powerful as Proton maybe but an easy and mostly free fix for gaming on Linux

* some proprietary software

* stupid software like Telegram allowing encryption only on Android, or Signal to setup an Account

* tons of FOSS Android apps from F-Droid

well then, i'll put it in recommendation. Also to mention, all the things are features/tasks in the program are optional that will only be done if the user agreed to it

@iaacornus iaacornus added feature priority prioritized labels Feb 2, 2023
@iaacornus iaacornus added this to the 0.1-alpha milestone Feb 2, 2023
@iaacornus
Copy link
Collaborator

although perhaps this can be installed in toolbox/distrobox? so the base system image is not really cluttered? i think it's nice if the things layered in the base image is limited as much as possible to only drivers or codecs or applications that really need high level of permission and accesses. although not sure in case of virtualization

@iaacornus iaacornus added system wide modification program option that will modify a system wide setting and removed addition change labels Feb 2, 2023
@iaacornus iaacornus added software related software stuffs deep mod includes in depth tweaks | not simple tweaks labels Mar 4, 2023
@iaacornus iaacornus removed this from the 0.1-alpha milestone Mar 4, 2023
@boredsquirrel
Copy link
Collaborator Author

although perhaps this can be installed in toolbox/distrobox? so the base system image is not really cluttered? i think it's nice if the things layered in the base image is limited as much as possible to only drivers or codecs or applications that really need high level of permission and accesses. although not sure in case of virtualization

I dont know if Waydroid runs through toolbox, but I can try. Launching it requires extra appstarters anyways, might be a good idea. But the folders are in seperate directories, and atm they are in system dirs that can be accessed through a root File manager at least. So I dont know if running through Distrobox/Toolbox would make that more complicated.

@boredsquirrel
Copy link
Collaborator Author

Waydroid start appstarter

printf """[Desktop Entry]
Type=Application
Name=Start Waydroid
Exec=waydroid session start
X-Purism-FormFactor=Workstation;Mobile;
Icon=/usr/lib/waydroid/data/AppIcon.png""" > ~/.local/share/applications/waydroid-start.desktop

Problem: fullscreen and start have same icon. Another problem: maybe this appstarter already exists, have to test.

@boredsquirrel
Copy link
Collaborator Author

boredsquirrel commented Mar 6, 2023

Install waydroid extras:

mkdir Waydroid
cd Waydroid

git clone https://github.com/casualsnek/waydroid_script
cd waydroid_script
python3 -m pip install -r requirements.txt
cp main.py ~/.local/bin/waydroid_extras.py

notify-send -a "Waydroid-extras" -t 30000 "How to use" "Open the Terminal and run 'sudo python3 ~/Waydroid/waydroid_script/main.py' [-i/-g/-n/-h] . See description of arguments here: https://themagisk.com/waydroid-extras-script/ . The Additions are neededed to run many ARM apps, Netflix DRM content, as well as installing Magisk and rooting the container. You could also install Google Apps, therefor an Android ID is required. It is mostly not recommended for privacy reasons."

Comment: do you know any better way of opening the python script? Moving it to ~/.local/bin didnt work for me for some reason.

@boredsquirrel
Copy link
Collaborator Author

boredsquirrel commented Mar 6, 2023

Waydroid initial setup

# 1. add it to install command (rest is in reboot script somehow, maybe manual? Handling sudo commands)

# 2. init

sudo waydroid init -c https://ota.waydro.id/system -v https://ota.waydro.id/vendor

# 3. Create shared folders
mkdir -p ~/Waydroid/Shared
sudo mount --bind ~/Waydroid/Shared ~/.local/share/waydroid/data/media/0/Documents

# sudo mount --bind ~/Downloads ~/.local/share/waydroid/data/media/0/Download
# sudo mount --bind ~/Images ~/.local/share/waydroid/data/media/0/DCIM/Camera

# 4. Link directory folder to user Waydroid folder (logs etc.)
ln -s /var/lib/waydroid ~/Waydroid/directory


# 5. Create Appstarters

cd  ~/.local/share/applications

printf """[Desktop Entry]
Type=Application
Name=Start Waydroid
GenericName=Starts Waydroid in Background
GenericName[de_DE]=Startet Waydroid im Hintergrund
Exec=waydroid session start
X-Purism-FormFactor=Workstation;Mobile;
Icon=/usr/lib/waydroid/data/AppIcon.png""" > waydroid-start.desktop

printf """[Desktop Entry]
Type=Application
Name=Waydroid Fullscreen
GenericName=Shows the Waydroid screen
GenericName[de_DE]=Zeigt den Waydroid Bildschirm
Exec=waydroid show-full-ui
X-Purism-FormFactor=Workstation;Mobile;
Icon=/usr/lib/waydroid/data/AppIcon.png""" > waydroid-fullscreen.desktop

printf """[Desktop Entry]
Exec='waydroid session stop'
GenericName=close running Waydroid instance
GenericName[de_DE]=Schließt laufende Waydroid Instanz
Name=Shutdown Waydroid
X-Purism-FormFactor=Workstation;Mobile;
Icon=system-shutdown-symbolic
Type=Application""" > shutdown-waydroid.desktop

printf """[Desktop Entry]
Exec=waydroid app install
GenericName=Installs Apps to the Waydroid container
GenericName[de_DE]=Installiert eine App in den Waydroid Container
Icon=install
Name=Waydroid install
MimeType=application/vnd.android.package-archive;
Type=Application""" > install-waydroid-app.desktop

# 6. create a remove script
printf """#!/bin/bash

echo "- - - - - - - Stopping Waydroid - - - - - - - - "
waydroid session stop
sudo waydroid container stop

echo "- - - - - - - - uninstalling Waydroid, this will take some time - - - - - -"
rpm-ostree remove waydroid

echo "- - - - - - - Removing Waydroid files - - - - - - "
sudo rm -rf /var/lib/waydroid /var/home/.waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid ~/.local/share/applications/ons/*waydroid* 

notify-send -a "Waydroid" -t 5000 "Removed" "Reboot to complete removal"
""" > ~/.local/bin/remove-waydroid

notify-send -a "Waydroid remove tool" "How To" "To remove Waydroid, execute 'sudo remove-waydroid' in Terminal."

# 7. Install extra packages

cd Waydroid

git clone https://github.com/casualsnek/waydroid_script
cd waydroid_script
python3 -m pip install -r requirements.txt
cp main.py ~/.local/bin/waydroid_extras.py

notify-send -a "Waydroid-extras" -t 30000 "How to use" "Open the Terminal and run 'sudo python3 ~/Waydroid/waydroid_script/main.py' [-i/-g/-n/-h] . See description of arguments here: https://themagisk.com/waydroid-extras-script/ . The Additions are neededed to run many ARM apps, Netflix DRM content, as well as installing Magisk and rooting the container. You could also install Google Apps, therefor an Android ID is required. It is mostly not recommended for privacy reasons."

# 8. Enable Clipboard

pip3 install pyclip

# 9. Open F-Droid.org

xdg-open https://f-droid.org/en/packages/com.aurora.store
xdg-openhttps://f-droid.org/en/packages/com.looker.droidify

notify-send -a "Waydroid setup" -t 30000 "Apps" "You can install apps easily from your Desktop or in Waydroid itself. It is recommended to use the F-Droid App or a similar one like Droid-ify to keep them up-to-date. For Google Play Apps you can use AuroraStore. Some Issues like changing the Keyboard layout or having banking apps run still persist."

# 10. Enable autostart with system login

# ln -s ~/.local/share/applications/waydroid-start.desktop ~/.config/autostart/

@boredsquirrel
Copy link
Collaborator Author

It seems the waydroid folder location has changed, it works now, binding it to a good location!

mkdir -p ~/Waydroid/Data
sudo mount --bind ~/.local/share/waydroid/data/media/0/ ~/Waydroid/Shared

@boredsquirrel
Copy link
Collaborator Author

also keyboard layout seems to work. Somehow it broke my local layout, all Flatpak apps use QWERTY now which is awful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deep mod includes in depth tweaks | not simple tweaks priority prioritized software related software stuffs system wide modification program option that will modify a system wide setting
Projects
None yet
Development

No branches or pull requests

2 participants