Recreating PyCharm launcher in Ubuntu

后端 未结 17 1046
一向
一向 2021-01-30 06:16

I installed pycharm normally via bin/pycharm.sh, but the mistake I made was doing bash pycharm.sh while the pycharm directory has inside the D

相关标签:
17条回答
  • 2021-01-30 06:43

    Run $ pycharm-community Right after you will see the icon on the taskbar. Right Click, select Lock on the Taskbar. Somewhat solves the problem.

    0 讨论(0)
  • 2021-01-30 06:44

    With Ubuntu 16.04, I used the "snap" installer, which doesn't include an easily accessible icon (there's probably one hidden inside the snap image, but it's hard to get at). Instead it shows a grey question mark icon in the launcher instead. Also there doesn't seem to be a Tools > Create Desktop Entry option in version 2017.3.3 as far as I can see - maybe it has been moved somewhere.

    So I copied pycharm.png from an earlier non-snap Community installation, saved it somewhere, then created ~/.local/share/applications/jetbrains-pycharm-ce.desktop:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=PyCharm Community Edition
    Icon=/path/to/pycharm.png
    Exec="/snap/bin/pycharm-community" %f
    Comment=The Drive to Develop
    Categories=Development;IDE;
    Terminal=false
    StartupWMClass=jetbrains-pycharm-ce
    

    Then when I start PyCharm (from the command line), the launcher item appears with the correct icon, and then I right-click on it and choose "Lock to Launcher", and it now persists.

    A downside is that the icon will not be automatically updated with the app, so it might fall out of date.

    0 讨论(0)
  • 2021-01-30 06:46

    I guess you didn't check 'Create the entry for all users (requires superuser privileges)' option on Tools -> Create Desktop Entry. You should check it.

    You don't have to create something new.

    0 讨论(0)
  • 2021-01-30 06:53

    I have an LXDE desktop (on Debian Buster) and using PyCharm CE 2020.2.3. Choosing Create Desktop Entry... created nothing on the desktop, no matter whether Create the entry for all users was checked or not.

    However, the PyCharm menu entry (under Programming) offers a context menu entry Add to desktop. Clicking this finally made the desktop icon appear.

    0 讨论(0)
  • 2021-01-30 06:54

    I managed to solve it. The thing is, Pycharm already installs a launcher inside .local/share/applications. Thus, you need to get rid of it before proceeding to create your own. After that, all you have to do is add your own *.desktop file to the applications directory inside usr/share/applications/.

    You need to create your .desktop file using sudo and inside the desktop file:

    [Desktop Entry]
    Encoding=UTF-8
    Name=PyCharm
    Exec=/opt/pycharm-3.0.1/bin/pycharm.sh
    Icon=/opt/pycharm-3.0.1/bin/pyCharm.png  # Changed from pycharm_32.png
    Type=Application
    Categories=Development;
    StartupWMClass=PyCharm
    

    After that is done, you can launch your app properly. Please note that pycharm.sh must also have execution rights.

    0 讨论(0)
  • 2021-01-30 06:56

    First start pyCharm from it's bin folder via command line

    $ ./pycharm.sh

    Then, goto

    Tools -> Create Desktop Entry.

    It will create a correct Desktop file in the correct place. Afterward you can initiate it from the menu and pin the icon or drag and drop it to the bar. This way, you don't have to deal with .desktop files and mumbo jumbo..

    0 讨论(0)
提交回复
热议问题