summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-03-24 19:24:05 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-03-24 19:24:05 +0000
commitd001d9862c2d1b00c85f17c05ceb6a702b02de2d (patch)
tree5a8fa29340f7943e14ae337bc5fc3721ee06991b
parent920f63a38ea6f05b63550767e63641792677e149 (diff)
sys-power/radeon-profile : add policykit rule, and run make use of it
-rw-r--r--sys-power/radeon-profile/files/org.redcorelinux.radeon-profile.policy22
-rwxr-xr-xsys-power/radeon-profile/files/radeon-profile-pkexec2
-rw-r--r--sys-power/radeon-profile/radeon-profile-20170714-r1.ebuild (renamed from sys-power/radeon-profile/radeon-profile-20170714.ebuild)9
3 files changed, 32 insertions, 1 deletions
diff --git a/sys-power/radeon-profile/files/org.redcorelinux.radeon-profile.policy b/sys-power/radeon-profile/files/org.redcorelinux.radeon-profile.policy
new file mode 100644
index 00000000..700b1030
--- /dev/null
+++ b/sys-power/radeon-profile/files/org.redcorelinux.radeon-profile.policy
@@ -0,0 +1,22 @@
+<?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>Redcore Linux</vendor>
+ <vendor_url>http://redcorelinux.org</vendor_url>
+
+ <action id="org.redcorelinux.radeon.pkexec.run">
+ <description>Run Radeon Profile</description>
+ <message>Authentication is required to run Radeon Profile</message>
+ <icon_name>redcore-logo</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/radeon-profile</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
diff --git a/sys-power/radeon-profile/files/radeon-profile-pkexec b/sys-power/radeon-profile/files/radeon-profile-pkexec
new file mode 100755
index 00000000..a5ddfcad
--- /dev/null
+++ b/sys-power/radeon-profile/files/radeon-profile-pkexec
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+pkexec /usr/bin/radeon-profile
diff --git a/sys-power/radeon-profile/radeon-profile-20170714.ebuild b/sys-power/radeon-profile/radeon-profile-20170714-r1.ebuild
index bc9a877d..644bb106 100644
--- a/sys-power/radeon-profile/radeon-profile-20170714.ebuild
+++ b/sys-power/radeon-profile/radeon-profile-20170714-r1.ebuild
@@ -38,8 +38,15 @@ src_install() {
dodir usr/bin
exeinto usr/bin
doexe ${PN}
+ doexe ${FILESDIR}/${PN}-pkexec
dodir usr/share/applications
insinto usr/share/applications
doins extra/${PN}.desktop
- doicon extra/${PN}.png
+ dodir usr/share/polkit-1/actions
+ insinto usr/share/polkit-1/actions
+ doins ${FILESDIR}/org.redcorelinux.radeon-profile.policy
+ doicon extra/${PN}.png
+
+ # Ugly hack to force Radeon Profile to go through policykit
+ sed -i "s/Exec=radeon-profile/Exec=radeon-profile-pkexec/g" "${D}"usr/share/applications/${PN}.desktop
}