chore: Add polkit rules for scx_lavd

This commit is contained in:
Kyle Gospodnetich 2024-07-16 22:25:59 -07:00
parent f888452e21
commit d0d108ef3e
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?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://github.com/ublue-os/bazzite/</vendor_url>
<action id="org.bazzite.schedulers.pkexec">
<description>Allows certain sched_ext schedulers to be run with root permissions</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/scx_lavd</annotate>
</action>
</policyconfig>

View File

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