下载的ECLIPSE直接解压可以用,没有GUI快捷方式,启动不方便。参照 smartsvn带的脚本,稍微改动一下添加成功。指定加载图标的地方稍微不一样。
添加ECLIPSE快捷方式脚本:
#!/bin/bash
# double.620 (at) 163.com
# modified from SmartSVN installation.
# Resolve the location of the ECLIPSE installation.
# This includes resolving any symlinks.
PRG=$0
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
if expr "$link" : '^/' 2> /dev/null >/dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
ECLIPSE_BIN=`dirname "$PRG"`
# absolutize dir
oldpwd=`pwd`
cd "${ECLIPSE_BIN}"
ECLIPSE_BIN=`pwd`
cd "${oldpwd}"
ICON_NAME=icon
TMP_DIR=`mktemp --directory`
DESKTOP_FILE=$TMP_DIR/clipse-juno.desktop
cat << EOF > $DESKTOP_FILE
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Eclipse Juno
Keywords=eclipse;juno
GenericName=Eclipse Juno
Type=Application
Categories=Development;RevisionControl
Terminal=false
StartupNotify=true
Exec="$ECLIPSE_BIN/eclipse" %f
MimeType=x-directory/normal
Icon=$ICON_NAME.xpm
X-Ayatana-Desktop-Shortcuts=NewWindow;RepositoryBrowser
[NewWindow Shortcut Group]
Name=Open a New Window
Exec="$ECLIPSE_BIN/eclipse"
TargetEnvironment=Unity
[RepositoryBrowser Shortcut Group]
Name=Open the Repository Browser
Exec="$ECLIPSE_BIN/eclipse" --repository-browser
TargetEnvironment=Unity
EOF
# seems necessary to refresh immediately:
chmod 644 $DESKTOP_FILE
xdg-desktop-menu install $DESKTOP_FILE
xdg-icon-resource install --size 32 --novendor "$ECLIPSE_BIN/icon.xpm" $ICON_NAME
xdg-icon-resource install --size 48 --novendor "$ECLIPSE_BIN/icon.xpm" $ICON_NAME
xdg-icon-resource install --size 64 --novendor "$ECLIPSE_BIN/icon.xpm" $ICON_NAME
xdg-icon-resource install --size 128 --novendor "$ECLIPSE_BIN/icon.xpm" $ICON_NAME
rm $DESKTOP_FILE
rm -R $TMP_DIR
smartsvn 脚本:
#!/bin/bash
#
# Resolve the location of the SmartSVN installation.
# This includes resolving any symlinks.
PRG=$0
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
if expr "$link" : '^/' 2> /dev/null >/dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
SMARTSVN_BIN=`dirname "$PRG"`
# absolutize dir
oldpwd=`pwd`
cd "${SMARTSVN_BIN}"
SMARTSVN_BIN=`pwd`
cd "${oldpwd}"
ICON_NAME=smartsvn-9_1
TMP_DIR=`mktemp --directory`
DESKTOP_FILE=$TMP_DIR/smartsvn-9_1.desktop
cat << EOF > $DESKTOP_FILE
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=SmartSVN 9.1
Keywords=svn;subversion
GenericName=SVN Client
Type=Application
Categories=Development;RevisionControl
Terminal=false
StartupNotify=true
Exec="$SMARTSVN_BIN/smartsvn.sh" %f
MimeType=x-directory/normal
Icon=$ICON_NAME.png
X-Ayatana-Desktop-Shortcuts=NewWindow;RepositoryBrowser
[NewWindow Shortcut Group]
Name=Open a New Window
Exec="$SMARTSVN_BIN/smartsvn.sh"
TargetEnvironment=Unity
[RepositoryBrowser Shortcut Group]
Name=Open the Repository Browser
Exec="$SMARTSVN_BIN/smartsvn.sh" --repository-browser
TargetEnvironment=Unity
EOF
# seems necessary to refresh immediately:
chmod 644 $DESKTOP_FILE
xdg-desktop-menu install $DESKTOP_FILE
xdg-icon-resource install --size 32 "$SMARTSVN_BIN/smartsvn-32.png" $ICON_NAME
xdg-icon-resource install --size 48 "$SMARTSVN_BIN/smartsvn-48.png" $ICON_NAME
xdg-icon-resource install --size 64 "$SMARTSVN_BIN/smartsvn-64.png" $ICON_NAME
xdg-icon-resource install --size 128 "$SMARTSVN_BIN/smartsvn-128.png" $ICON_NAME
rm $DESKTOP_FILE
rm -R $TMP_DIR