Created
June 9, 2014 15:14
-
-
Save srid99/8b772e0d77297e59d1ee to your computer and use it in GitHub Desktop.
A bash script to create and install a desktop entry for intellij ultimate edition in (mostly) any linux distro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Run this script from your '/.../intellij-location/bin' directory. | |
# Application name | |
APPLICATION=intellij-idea | |
# Application path | |
APPLICATION_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | |
# Make application exeuctable | |
echo "Installing to /usr/bin folder, requires permission..." | |
sudo ln -nsf $APPLICATION_PATH/idea.sh /usr/bin/$APPLICATION | |
echo "" | |
# Create desktop entry | |
FILE_DESKTOP=$APPLICATION.desktop | |
touch $FILE_DESKTOP | |
echo "[Desktop Entry]" >> $FILE_DESKTOP | |
echo "Type=Application" >> $FILE_DESKTOP | |
echo "Encoding=UTF-8" >> $FILE_DESKTOP | |
echo "Name=Intellij" >> $FILE_DESKTOP | |
echo "GenericName=Code Editor" >> $FILE_DESKTOP | |
echo "Comment=Code Editor" >> $FILE_DESKTOP | |
echo "StartupWMClass=jetbrains-idea" >> $FILE_DESKTOP | |
echo "Exec=$APPLICATION" >> $FILE_DESKTOP | |
echo "Icon=intellij-idea-ultimate-edition" >> $FILE_DESKTOP | |
echo "Categories=Development;Utilities;TextEditor;IDE" >> $FILE_DESKTOP | |
echo "Terminal=false" >> $FILE_DESKTOP | |
echo "Installing to Applications menu" | |
xdg-desktop-menu install $FILE_DESKTOP | |
xdg-desktop-menu forceupdate | |
echo "" | |
echo "Cleaning" | |
rm $FILE_DESKTOP | |
echo "" | |
echo "$APPLICATION is now installed on your desktop" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment