I strongly suggest creating your own .policy
file and leave org.freedesktop.policykit.exec
alone, for several reasons:
pkexec
does not work as expected under certain circunstances, in Terminal, in.desktop
files, etc. This is actually a Gnome bug about double-fork.With your own
.policy
file you edit it at will and even configure it for password-less root privileges for your script! And that's a very interesting feature!You could invoke your script simply using its name, as any other command, no need to prepend it with
pkexec
orsudo
or anything so it would work anywhere.
You may use gparted
's policy file as a template.