35 lines
837 B
Bash
Executable File
35 lines
837 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -x
|
|
bin_file=/opt/idea/bin/idea.sh
|
|
|
|
if [[ -f /opt/idea/bin/idea ]]; then
|
|
bin_file=/opt/idea/bin/idea
|
|
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/idea.desktop ]]; then
|
|
touch ~/.local/share/applications/idea.desktop
|
|
fi
|
|
|
|
cat >~/.local/share/applications/idea.desktop <<EOF
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Name=IntelliJ IDEA Community Edition
|
|
Icon=/opt/idea/bin/idea.svg
|
|
Exec="${bin_file}" %f
|
|
Comment=Capable and Ergonomic IDE for JVM
|
|
Terminal=false
|
|
Categories=Development;IDE;
|
|
Encoding=UTF-8
|
|
EOF
|