Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alchemy/viewer
  • Miezhiko/alchemy-next
  • JennaHuntsman/xdg-integration
  • logue/alchemy-next
  • FelixWolf/alchemy-viewer
  • XenHat/xdg-integration
6 results
Show changes
Commits on Source (2)
#!/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")"
RUN_PATH="$(dirname "${SCRIPTSRC}" || echo .)"
install_prefix="${RUN_PATH}"/..
install_prefix=$(builtin cd "${RUN_PATH}/.." || exit; pwd) #This is a cleaner way of getting the absolute path for the install directory.
function install_desktop_entry()
{
local installation_prefix="${1}"
local desktop_entries_dir="${2}"
local desktop_entry="\
[Desktop Entry]\n\
Name=Alchemy\n\
Comment=Client for the On-line Virtual World, Second Life\n\
Exec=${installation_prefix}/alchemy\n\
Icon=${installation_prefix}/alchemy_icon.png\n\
Terminal=false\n\
Type=Application\n\
Categories=Game;Simulation;\n\
StartupNotify=true\n\
StartupWMClass=Alchemy\n\
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}/alchemy-viewer.desktop" || "Failed to install application menu!"
desktoppath="${installation_prefix}/${VIEWERNAME,,}-viewer.desktop"
cat >"${desktoppath}" <<desktopfile || print "Warning: Could not write $desktoppath"s
[Desktop Entry]
Version=1.4
Name=${VIEWERNAME}
GenericName=Second Life Viewer
Comment=Client for the Online Virtual World, Second Life
Exec=${installation_prefix}/${VIEWERNAME,,}
Icon=${VIEWERNAME}-Viewer
Terminal=true
Type=Application
Categories=Game;Simulation;
StartupNotify=true
StartupWMClass=${VIEWERNAME}
PrefersNonDefaultGPU=true
Actions=DefaultGPU;AssociateMIME;
[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 --size 256 "${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 ./${VIEWERNAME,,}-viewer.desktop
}
if [ "$UID" == "0" ]; then
......