में एक नई फ़ाइल बनाएँ /usr/share/polkit-1/actions/
sudo nano /usr/share/polkit-1/actions/FlashTool.policy
और नीचे लाइनें जोड़ें:
<?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>
<action id="org.freedesktop.policykit.pkexec.run-FlashTool">
<description>Run FlashTool</description>
<message>Authentication is required to run FlashTool</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/home/natasha/FlashTool/FlashTool</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
</action>
</policyconfig>
फिर एक नई फ़ाइल बनाएँ /home/natasha/FlashTool/
nano /home/natasha/FlashTool/flashtool-pkexec
और नीचे लाइनें जोड़ें:
#!/bin/sh
pkexec "/home/natasha/FlashTool/FlashTool" "$@"
Exec
अपनी desktop
फ़ाइल के लिए नीचे दी गई पंक्ति का उपयोग करें :
Exec=/home/natasha/FlashTool/flashtool-pkexec
निम्न फ़ाइलों के साथ मेरे सिस्टम Ubuntu 15.04 GNOME पर परीक्षण किया गया:
$ cat /usr/share/applications/gedit.root.desktop
[Desktop Entry]
Name=Gedit as root
GenericName=Text Editor
X-GNOME-FullName=
Comment=
Exec=gedit-pkexec
Icon=gedit
Terminal=false
Type=Application
Categories=GNOME;System;Filesystem;Settings;
StartupNotify=true
X-Ubuntu-Gettext-Domain=gedit
$ cat /usr/share/polkit-1/actions/gedit.policy
<?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>
<action id="org.freedesktop.policykit.pkexec.run-FlashTool">
<description>Run FlashTool</description>
<message>Authentication is required to run FlashTool</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/gedit</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
</action>
</policyconfig>
$ cat /usr/bin/gedit-pkexec
#!/bin/sh
pkexec "gedit" "$@"