#!/bin/sh

cat <<-END
<?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>Kali Linux</vendor>
    <vendor_url>https://kali.org</vendor_url>
    <icon_name>kali-menu</icon_name>
END
(while read key path; do
    cat <<END

    <action id="org.kali.pkexec.$key">
	<description>Run $key as root</description>
	<message>Authentication is required to run $path as root</message>
	<defaults>
	    <allow_any>auth_admin</allow_any>
	    <allow_inactive>auth_admin</allow_inactive>
	    <allow_active>auth_admin</allow_active>
	</defaults>
	<annotate key="org.freedesktop.policykit.exec.path">$path</annotate>
	<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
    </action>
END
done) <x11-apps
cat <<END

</policyconfig>
END
