Running Pycharm as root from launcher

后端 未结 6 2106
小鲜肉
小鲜肉 2021-02-19 07:04

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 d

6条回答
  •  北海茫月
    2021-02-19 07:33

    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.

提交回复
热议问题