Skip to content
Snippets Groups Projects
Verified Commit 8248357d authored by JennaHuntsman's avatar JennaHuntsman Committed by Xenhat Hex
Browse files

Update indra/newview/linux_tools/refresh_desktop_app_entry.sh

parent c019799f
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
#!/bin/bash #!/bin/bash
VIEWERNAME="Alchemy" #Store the viewer's name as a variable, for portability. This should be correctly capitalized.
SCRIPTSRC="$(readlink -f "$0" || echo "$0")" SCRIPTSRC="$(readlink -f "$0" || echo "$0")"
RUN_PATH="$(dirname "${SCRIPTSRC}" || echo .)" RUN_PATH="$(dirname "${SCRIPTSRC}" || echo .)"
...@@ -8,24 +10,45 @@ install_prefix="${RUN_PATH}"/.. ...@@ -8,24 +10,45 @@ install_prefix="${RUN_PATH}"/..
function install_desktop_entry() function install_desktop_entry()
{ {
local installation_prefix="${1}" local installation_prefix="${1}"
local desktop_entries_dir="${2}"
desktoppath="${installation_prefix}/${VIEWERNAME,,}-viewer.desktop"
local desktop_entry="\ cat >"${desktoppath}" <<desktopfile || print "Warning: Could not write $desktoppath"s
[Desktop Entry]\n\ [Desktop Entry]
Name=Alchemy\n\ Version=1.4
Comment=Client for the On-line Virtual World, Second Life\n\ Name=${VIEWERNAME}
Exec=${installation_prefix}/alchemy\n\ GenericName=Second Life Viewer
Icon=${installation_prefix}/alchemy_icon.png\n\ Comment=Client for the Online Virtual World, Second Life
Terminal=false\n\ Exec=${installation_prefix}/${VIEWERNAME,,}
Type=Application\n\ Icon=${VIEWERNAME}-Viewer
Categories=Game;Simulation;\n\ Terminal=false
StartupNotify=true\n\ Type=Application
StartupWMClass=Alchemy\n\ Categories=Game;Simulation;
X-Desktop-File-Install-Version=3.0" StartupNotify=true
StartupWMClass=${VIEWERNAME}
echo " - Installing menu entries in ${desktop_entries_dir}" PrefersNonDefaultGPU=true
mkdir -vp "${desktop_entries_dir}" Actions=DefaultGPU;AssociateMIME;
echo -e "${desktop_entry}" > "${desktop_entries_dir}/alchemy-viewer.desktop" || "Failed to install application menu!"
[Desktop Action DefaultGPU]
Exec=${installation_prefix}/${VIEWERNAME}
Name=Launch on default GPU
Comment=Launch the viewer using the system's integrated GPU, instead of the dedicated one. (if available)
PrefersNonDefaultGPU=false
[Desktop Action AssociateMIME]
Exec=${installation_prefix}/etc/register_secondlifeprotocol.sh
Name=Associate SLURLs
Comment=Set this viewer as the default handler for secondlife:// links.
Terminal=true
desktopfile
#The "PrefersNonDefaultGPU" line should automatically run the viewer on the most powerful GPU in the system, if it is not default. If it is, this is ignored.
# NOTE: DO NOT CHANGE THE "GenericName" FIELD - ONLY CHANGE THE "Name" FIELD. (This is to ensure that searching "Second Life" will show all the viewers installed in a user's system, regardless of their canonical name.)
echo " - Installing menu entries via XDG..."
xdg-icon-resource install --novendor "${install_prefix}/${VIEWERNAME,,}_icon.png" ${VIEWERNAME}-Viewer
#NOTE: Above command takes the path to the icon to install && The name of the icon to be used by XDG. This should always be in the format of "x-Viewer" to avoid potential naming conflicts, as per XDG spec.
xdg-desktop-menu install --novendor ./alchemy-viewer.desktop
} }
if [ "$UID" == "0" ]; then if [ "$UID" == "0" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment