PageRenderTime 20ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/linux_tools/refresh_desktop_app_entry.sh

https://bitbucket.org/lindenlab/viewer-beta/
Shell | 36 lines | 27 code | 6 blank | 3 comment | 6 complexity | 798909f3ec1b434cff1d3bf062ddb758 MD5 | raw file
 1#!/bin/bash
 2
 3SCRIPTSRC=`readlink -f "$0" || echo "$0"`
 4RUN_PATH=`dirname "${SCRIPTSRC}" || echo .`
 5
 6install_prefix=${RUN_PATH}/..
 7
 8function install_desktop_entry()
 9{
10    local installation_prefix="$1"
11    local desktop_entries_dir="$2"
12
13    local desktop_entry="\
14[Desktop Entry]\n\
15Name=Second Life\n\
16Comment=Client for the On-line Virtual World, Second Life\n\
17Exec=${installation_prefix}/secondlife\n\
18Icon=${installation_prefix}/secondlife_icon.png\n\
19Terminal=false\n\
20Type=Application\n\
21Categories=Application;Network;\n\
22StartupNotify=true\n\
23X-Desktop-File-Install-Version=3.0"
24
25    echo " - Installing menu entries in ${desktop_entries_dir}"
26    mkdir -vp "${desktop_entries_dir}"
27    echo -e $desktop_entry > "${desktop_entries_dir}/secondlife-viewer.desktop" || "Failed to install application menu!"
28}
29
30if [ "$UID" == "0" ]; then
31    # system-wide
32    install_desktop_entry "$install_prefix" /usr/local/share/applications
33else
34    # user-specific
35    install_desktop_entry "$install_prefix" "$HOME/.local/share/applications"
36fi