'Da yeni bir dosya oluştur /usr/share/polkit-1/actions/
sudo nano /usr/share/polkit-1/actions/FlashTool.policy
ve aşağıdaki satırları ekleyin:
<?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>
Ardından yeni bir dosya oluşturun /home/natasha/FlashTool/
nano /home/natasha/FlashTool/flashtool-pkexec
ve aşağıdaki satırları ekleyin:
#!/bin/sh
pkexec "/home/natasha/FlashTool/FlashTool" "$@"
İçin aşağıdaki satırı kullanın Exec
sizin de desktop
dosyaya:
Exec=/home/natasha/FlashTool/flashtool-pkexec
Sistemim Ubuntu 15.04 GNOME üzerinde şu dosyalarla test edildi:
$ 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" "$@"