Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Weston launcher for Waydroid using policykit to start and s…
…top service
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
sudo systemctl start waydroid-container.service |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
sudo systemctl stop waydroid-container.service |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
source /etc/default/waydroid-launcher | ||
|
||
if [ "$(systemctl is-active waydroid-container.service)" == 'active' ]; then | ||
killall -9 weston | ||
pkexec /usr/bin/stop-waydroid-container | ||
exit | ||
fi | ||
|
||
killall -9 weston | ||
pkexec /usr/bin/start-waydroid-container | ||
if [ -z "$(pgrep weston)" ]; then | ||
/usr/bin/weston --xwayland --width="${WAYDROID_WIDTH}" --height="${WAYDROID_HEIGHT}" &> /dev/null & | ||
fi | ||
|
||
sleep 2 && | ||
export XDG_SESSION_TYPE='wayland' | ||
export DISPLAY=':1' | ||
/usr/bin/waydroid show-full-ui & | ||
while [ -n "$(pgrep weston)" ];do | ||
sleep 1 | ||
done | ||
|
||
pkexec /usr/bin/stop-waydroid-container |
2 changes: 2 additions & 0 deletions
2
system_files/desktop/shared/usr/etc/default/waydroid-launcher
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
WAYDROID_WIDTH=1280 | ||
WAYDROID_HEIGHT=800 |
31 changes: 31 additions & 0 deletions
31
system_files/desktop/shared/usr/share/polkit-1/actions/org.bazzite.policy
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE policyconfig PUBLIC | ||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" | ||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> | ||
<policyconfig> | ||
<vendor>Bazzite</vendor> | ||
<vendor_url>https://bazzite.gg</vendor_url> | ||
|
||
<action id="org.bazzite.policykit.waydroid.container.start"> | ||
<description>Start 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/bin/waydroid-container-start</annotate> | ||
</action> | ||
|
||
<action id="org.bazzite.policykit.waydroid.container.stop"> | ||
<description>Stop 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/bin/waydroid-container-stop</annotate> | ||
</action> | ||
</policyconfig> | ||
|