Recreating PyCharm launcher in Ubuntu

Games Brainiac picture Games Brainiac · Nov 2, 2013 · Viewed 50.7k times · Source

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 Downloads folder.

I later on moved the directory to /opt/Pycharm/. This is causing the once functioning unity launcher (which was added when PyCharm was initially installed) to fail every time I attempt to use it (as expected).

How can I re-add pycharm.sh as a lauchable app from the unity launcher? I know the location of the pycharm.sh file. I've tried to add it to /usr/bin/ but that does not change anything.

I can still launch pycharm via bash /usr/opt/Pycharm/bin/Pycharm.sh. But this is tedious.

UPDATE

I have tried making a new .desktop file for pycharm, using the following script:

[Desktop Entry]
Encoding=UTF-8
Name=PyCharm
Exec=/opt/Pycharm-3.0.1/bin/pycharm.sh
Icon=/opt/Pycharm-3.0.1/bin/PyCharm_32.png
Type=Application
Categories=Development;
StartupWMClass=PyCharm

However, I get a "Unable to save Pycharm.desktop" error when I try to save the file inside /usr/share/applications/pycharm.desktop. Any help regarding this would be deeply appreciated.

Answer

Shan Valleru picture Shan Valleru · Nov 22, 2013

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..