fix: Add hhd.steamos to polkit

This commit is contained in:
Kyle Gospodnetich 2025-01-20 09:46:50 -08:00
parent e06eef7e0d
commit b75492d22f
2 changed files with 14 additions and 3 deletions

View File

@ -7,7 +7,7 @@
<vendor>Bazzite</vendor>
<vendor_url>https://github.com/ublue-os/bazzite/</vendor_url>
<action id="org.bazzite.hhd.pkexec">
<action id="org.bazzite.enable.hhd.pkexec">
<description>Handheld Daemon is a project that aims to provide utilities for managing handheld devices</description>
<icon_name>package-x-generic</icon_name>
<defaults>
@ -18,4 +18,15 @@
<annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/bazzite-enable-hhd</annotate>
</action>
<action id="org.bazzite.hhd.steamos.pkexec">
<description>Handheld Daemon is a project that aims to provide utilities for managing handheld devices</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/hhd.steamos</annotate>
</action>
</policyconfig>

View File

@ -1,6 +1,6 @@
polkit.addRule(function(action, subject) {
if (action.id == "org.bazzite.hhd.pkexec" &&
subject.isInGroup("wheel")) {
if ((action.id == "org.bazzite.enable.hhd.pkexec" || action.id == "org.bazzite.hhd.steamos.pkexec") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});