36 lines
852 B
Bash
Executable File
36 lines
852 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -x
|
|
|
|
bin_file=/opt/pycharm/bin/pycharm.sh
|
|
|
|
if [[ -f /opt/pycharm/bin/pycharm ]]; then
|
|
bin_file=/opt/pycharm/bin/pycharm
|
|
else
|
|
echo '' >>$bin_file
|
|
echo '# chinese input settings' >>$bin_file
|
|
echo 'export GTK_IM_MODULE=fcitx' >>$bin_file
|
|
echo 'export QT_IM_MODULE=fcitx' >>$bin_file
|
|
echo 'export XMODIFIERS=@im=fcitx' >>$bin_file
|
|
fi
|
|
|
|
if [[ ! -d ~/.local/share/applications ]]; then
|
|
mkdir -p ~/.local/share/applications
|
|
fi
|
|
|
|
if [[ ! -f ~/.local/share/applications/pycharm.desktop ]]; then
|
|
touch ~/.local/share/applications/pycharm.desktop
|
|
fi
|
|
|
|
cat >~/.local/share/applications/pycharm.desktop <<EOF
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Name=Pycharm
|
|
Icon=/opt/pycharm/bin/pycharm.svg
|
|
Exec="${bin_file}" %f
|
|
Terminal=false
|
|
Comment=Python IDE for Professional Developers
|
|
Categories=Development;IDE;
|
|
Encoding=UTF-8
|
|
EOF
|