Ubuntu – How to run Sublime Text from the launcher as root every time

rootsublime-text

Is there a way to automatically run as gksudo when I click on the Sublime Text icon?

Best Answer

update 2020-06-27: gksu is deprecated and has been removed for security concerns. see I need an equivalent of gksu in 18.04

long story short:

sudo -H subl

note that the sudo -H is simple enough but it suffers the same security issues as gksu. better option (for reasons beyond my understanding) would be pkexec. there's also admin:// protocol but it didn't work for me with sublime.

Related Question