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

feat(waydroid) - Add waydroid force restart shortcut #2131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/bash

sudo waydroid container restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=Force Restart Waydroid
Exec=pkexec /usr/libexec/waydroid-container-restart
Categories=X-WayDroid-App;
X-Purism-FormFactor=Workstation;Mobile;
Icon=waydroid
NoDisplay=false
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
<annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/waydroid-container-stop</annotate>
</action>

<action id="org.bazzite.policykit.waydroid.container.restart">
<description>Restart Waydroid Container</description>
<icon_name>package-x-generic</icon_name>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/waydroid-container-restart</annotate>
</action>

<action id="org.bazzite.policykit.waydroid.fix.controllers">
<description>Fix Controllers in Waydroid</description>
<icon_name>package-x-generic</icon_name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
polkit.addRule(function(action, subject) {
if ((action.id == "org.bazzite.policykit.waydroid.container.start" ||
action.id == "org.bazzite.policykit.waydroid.container.stop" ||
action.id == "org.bazzite.policykit.waydroid.container.restart" ||
action.id == "org.bazzite.policykit.waydroid.fix.controllers") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ setup-waydroid ACTION="":
fi
sudo waydroid init -c 'https://ota.waydro.id/system' -v 'https://ota.waydro.id/vendor'
sudo restorecon -R /var/lib/waydroid
cp /usr/share/applications/waydroid-container-restart.desktop ~/.local/share/applications
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this will work as-intended, or if there's a better approach. the idea is to add the waydroid-container-restart desktop entry after the user inits waydroid

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can merge to testing instead and find out

echo "Waydroid has been initialized, please run waydroid once before you Configure Waydroid"
elif [[ "${OPTION,,}" =~ ^configure ]]; then
git clone https://github.com/ublue-os/waydroid_script.git --depth 1 /tmp/waydroid_script
Expand Down