Running Pycharm as root from launcher

Zorgmorduk picture Zorgmorduk · Apr 10, 2016 · Viewed 25.2k times · Source

How is it possible to run Pycharm from the launcher with root privileges?

I can do that from the terminal window, with sudo ./pycharm.sh, but I'd like to do the same directly from the launcher.

Answer

Reut Sharabani picture Reut Sharabani · Apr 10, 2016

Try: gksudo ./path/to/pycharm/executable

More about gksudo

If you're on ubuntu and don't have gksudo install it using:

apt-get install gksu

Here is an example launcher configuration (under: ~/.local/share/applications/jetbrains-pycharm-ce.desktop):

[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/home/YOUR_USER/pycharm/bin/pycharm.png
Exec=gksudo -k -u root "/home/YOUR_USER/pycharm/bin/pycharm.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
  • ce indicates community edition, yours may differ.