Skip to content

Instantly share code, notes, and snippets.

@eddnav
Forked from srid99/install-intellij.sh
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddnav/fd140149f07d85f9903c to your computer and use it in GitHub Desktop.
Save eddnav/fd140149f07d85f9903c to your computer and use it in GitHub Desktop.
srid99's bash script for IntelliJ IDEA desktop entry with a bit of Marketing hah!
#!/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 IDEA" >> $FILE_DESKTOP
echo "GenericName=IDEA" >> $FILE_DESKTOP
echo "Comment=The Best Java & Polyglot IDE" >> $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 now has a desktop entry!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment