Skip to content

Instantly share code, notes, and snippets.

@arthurafarias
Created April 14, 2016 03:50
Show Gist options
  • Save arthurafarias/df8e39e7afb90e0b3ca2867926c66978 to your computer and use it in GitHub Desktop.
Save arthurafarias/df8e39e7afb90e0b3ca2867926c66978 to your computer and use it in GitHub Desktop.
#!/bin/bash
eclipse_executable_path=$(realpath ./eclipse)
update-alternatives --install "/usr/local/bin/eclipse" eclipse "$eclipse_executable_path" 0
desktop_entry="/usr/share/applications/eclipse.desktop"
if [ -f $desktop_entry ]
then
rm $desktop_entry
fi
touch $desktop_entry
echo "[Desktop Entry]" >> $desktop_entry
echo "Type=Application" >> $desktop_entry
echo "Encoding=UTF-8" >> $desktop_entry
echo "Name=Eclipse Platform" >> $desktop_entry
echo "Comment=Eclipse Integrated Development Environment" >> $desktop_entry
echo "Exec=eclipse" >> $desktop_entry
echo "Icon="$(realpath icon.xpm) >> $desktop_entry
echo "Terminal=false" >> $desktop_entry
update-desktop-database
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment