Crie um novo arquivo no /usr/share/polkit-1/actions/
sudo nano /usr/share/polkit-1/actions/FlashTool.policy
e adicione as linhas abaixo:
<?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>
Em seguida, crie um novo arquivo /home/natasha/FlashTool/
nano /home/natasha/FlashTool/flashtool-pkexec
e adicione as linhas abaixo:
#!/bin/sh
pkexec "/home/natasha/FlashTool/FlashTool" "$@"
Use a linha abaixo para Exec
no seu desktop
arquivo:
Exec=/home/natasha/FlashTool/flashtool-pkexec
Testado no meu sistema Ubuntu 15.04 GNOME com os seguintes arquivos:
$ 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" "$@"