refresh_desktop_app_entry.sh
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:1k
源码类别:
游戏引擎
开发平台:
C++ Builder
- #!/bin/bash
- SCRIPTSRC=`readlink -f "$0" || echo "$0"`
- RUN_PATH=`dirname "${SCRIPTSRC}" || echo .`
- install_prefix=${RUN_PATH}/..
- function install_desktop_entry()
- {
- local installation_prefix="$1"
- local desktop_entries_dir="$2"
- local desktop_entry="
- [Desktop Entry]n
- Name=Second Lifen
- Comment=Client for the On-line Virtual World, Second Lifen
- Exec=${installation_prefix}/secondlifen
- Icon=${installation_prefix}/secondlife_icon.pngn
- Terminal=falsen
- Type=Applicationn
- Categories=Application;Network;n
- StartupNotify=truen
- X-Desktop-File-Install-Version=3.0"
- echo " - Installing menu entries in ${desktop_entries_dir}"
- mkdir -vp "${desktop_entries_dir}"
- echo -e $desktop_entry > "${desktop_entries_dir}/secondlife-viewer.desktop" || "Failed to install application menu!"
- }
- if [ "$UID" == "0" ]; then
- # system-wide
- install_desktop_entry "$install_prefix" /usr/local/share/applications
- else
- # user-specific
- install_desktop_entry "$install_prefix" "$HOME/.local/share/applications"
- fi