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

Add ability to define viewer release channel to refresh_desktop_entry.sh to...

Add ability to define viewer release channel to refresh_desktop_entry.sh to avoid conflicts between installs of viewers on different release channels.
parent 2322a2a0
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
VIEWERNAME="Alchemy" #Store the viewer's name as a variable, for portability. This should be correctly capitalized. VIEWERNAME="Alchemy" #Store the viewer's name as a variable, for portability. This should be correctly capitalized.
CHANNELNAME="AgileAkita" #THIS CAN BE BLANK! Store the viewer's channel (i.e. alpha, beta, etc.) as a variable, for portability. This should be correctly capitalized. Release versions should leave this blank, so the DE will show just VIEWERNAME, not VIEWERNAME CHANNELNAME
SCRIPTSRC="$(readlink -f "$0" || echo "$0")" SCRIPTSRC="$(readlink -f "$0" || echo "$0")"
RUN_PATH="$(dirname "${SCRIPTSRC}" || echo .)" RUN_PATH="$(dirname "${SCRIPTSRC}" || echo .)"
install_prefix=$(builtin cd "${RUN_PATH}/.." || exit; pwd) #This is a cleaner way of getting the absolute path for the install directory. install_prefix=$(builtin cd "${RUN_PATH}/.." || exit; pwd) #This is a cleaner way of getting the absolute path for the install directory.
function print() { function print() {
log_prefix="${VIEWERNAME}DesktopIntegration:" log_prefix="${VIEWERNAME}${CHANNELNAME}DesktopIntegration:"
echo -e "${log_prefix} $*" echo -e "${log_prefix} $*"
} }
...@@ -21,7 +23,7 @@ function install_desktop_entry() ...@@ -21,7 +23,7 @@ function install_desktop_entry()
cat >"${desktoppath}" <<desktopfile || print "Warning: Could not write $desktoppath"s cat >"${desktoppath}" <<desktopfile || print "Warning: Could not write $desktoppath"s
[Desktop Entry] [Desktop Entry]
Version=1.4 Version=1.4
Name=${VIEWERNAME} Name=${VIEWERNAME} ${CHANNELNAME}
GenericName=Second Life Viewer GenericName=Second Life Viewer
Comment=Client for the Online Virtual World, Second Life Comment=Client for the Online Virtual World, Second Life
Exec=${installation_prefix}/${VIEWERNAME,,} Exec=${installation_prefix}/${VIEWERNAME,,}
...@@ -30,7 +32,7 @@ Terminal=false ...@@ -30,7 +32,7 @@ Terminal=false
Type=Application Type=Application
Categories=Game;Simulation; Categories=Game;Simulation;
StartupNotify=true StartupNotify=true
StartupWMClass=${VIEWERNAME} StartupWMClass=${VIEWERNAME} ${CHANNELNAME}
PrefersNonDefaultGPU=true PrefersNonDefaultGPU=true
Actions=DefaultGPU;AssociateMIME; Actions=DefaultGPU;AssociateMIME;
...@@ -52,7 +54,7 @@ desktopfile ...@@ -52,7 +54,7 @@ desktopfile
# 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.) # 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..." print "Installing menu entries via XDG..."
xdg-icon-resource install --novendor --size 256 "${install_prefix}/${VIEWERNAME,,}_icon.png" ${VIEWERNAME}-Viewer 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. #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 "${installation_prefix}"/${VIEWERNAME,,}-viewer.desktop xdg-desktop-menu install --novendor "${installation_prefix}"/${VIEWERNAME,,}-viewer.desktop
......
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