I'm trying to be a good boy and stop using gksudo, especially since it just got orphaned in the 18.04 daily builds (note, this question is not specific to 18.04).
In the bad old days of using gksudo, I'd typically navigate to a folder containing the file I wish to edit (I use pcmanfm) then select Tools/Open Current Folder In Terminal from the menu. Then I'd type gksudo leafpad [file-I-wish-to-edit] in the newly opened terminal.
Using information in the very useful answer How to configure pkexec? I set my .bash_aliases and I am able to now type pkexec leafpad [file-I-wish-to-edit] in the newly opened terminal and I don't get any errors. Sadly, though I get a blank file instead of what I wanted. I have determined that this is because leafpad is looking in /root instead of the folder I wished to be in.
How can I maintain my halo, continue to use pkexec instead of gksudo, yet retain the functionality I'm used to?
sudo apt install gksu. – WinEunuuchs2Unix Apr 21 '18 at 01:14gsuscript which I posted in the answer below. It's nicer because it doesn't dim all attached screens likegksudoes. I guess it's nice because it "follows the rules" but I honestly have had no problems withgksu. The exception being usinggksu geditin Windows 10 (within WSL framework) where Windows 10 Ubuntu 16.04 messes up permissions within NTFS in the first place anyway. – WinEunuuchs2Unix Apr 21 '18 at 01:51