Ubuntu
Created in thePyCharm
Desktop shortcut and fixed to the quick Launch bar (includedsudo
Version)
0. References
Section 4 mainly refer to the following article: blog.csdn.net/bskfnvjtlyz…
1. Createpycharm.desktop
file
- First switch the directory to the desktop:
CD ~ / desktop
- with
vim
createpycharm.desktop
:
vim pycharm.desktop
- It reads as follows (be sure to write the absolute path) :
[Desktop Entry]
Name = PyCharm
Type = Application
Exec = /home/jpch89/program/pycharm201821/bin/pycharm.sh
Icon = /home/jpch89/program/pycharm201821/bin/pycharm.png
Terminal = False
Copy the code
- Save the exit
vim
:
: wq enter
- The results are as follows:
2. Add the executable permission and trust
- Right-click on the desktop
pycharm.desktop
, click Properties. - Click the Permissions TAB.
- Close the window by checking allow files to be executed as programs.
- As shown in the figure:
- Double click on the icon, click Trust and launch
Trust and Launch
。
PyCharm
Successfully launched, and the icon changedPyCharm
Built-in icon, as shown in the figure:
3. The fixedPyCharm
Go to the quick launch bar
- the
pycharm.desktop
Copy from the desktop to/usr/share/applications/
Folder:
sudo cp pycharm.desktop /usr/share/applications/
- According to the
Super
Key (Win
Key), searchpycharm
, right click, and selectAdd to favoritesYou can:
4. sudo
Version of thePyCharm
A shortcut
Note: Using this approach requires reactivating PyCharm, configuring the IDE, and the project interpreter.
- Create a script file:
vim /home/jpch89/program/pycharm201821/bin/mypycharm.sh
- Write the following:
echo 'Your password' | sudo -S /home/jpch89/program/pycharm201821/bin/pycharm.sh
Copy the code
:wq
Save and exit:
- Right click
mypycharm.sh
, click Properties, select the Permissions TAB, and check allow as program execution file:
- Create a new one on your desktop
mypycharm.desktop
The file:
Vim ~/ desktop /mypycharm. Desktop
- Write the following:
[Desktop Entry]
Name = PyCharm
Type = Application
Exec = /home/jpch89/program/pycharm201821/bin/mypycharm.sh
Icon = /home/jpch89/program/pycharm201821/bin/pycharm.png
Terminal = False
Copy the code
- Save the exit
:wq
, right click the following icon:
- As before, click Properties, select the Permissions TAB, and check allow to execute as a program:
- Close the properties window and double-click to run.