Skip to content
Snippets Groups Projects

Linux - Replace legacy desktop integration with modern XDG-based integration

Closed JennaHuntsman requested to merge JennaHuntsman/xdg-integration:main into main
Compare and
6 files
+ 94
29
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -55,11 +55,13 @@ function homedir_install()
prompt "Proceed with the installation? [Y/N]: "
if [[ $? == 0 ]]; then
exit 0
exit 0
fi
if [[ -d "$XDG_DATA_HOME" ]] ; then
install_to_prefix "$XDG_DATA_HOME/alchemy-install" #$XDG_DATA_HOME is a synonym for $HOME/.local/share/ unless the user has specified otherwise (unlikely).
else
install_to_prefix "$HOME/.local/share/alchemy-install" #XDG_DATA_HOME not set, so use default path as defined by XDG spec.
fi
install_to_prefix "$HOME/.local/share/alchemy-install"
$HOME/.local/share/alchemy-install/etc/refresh_desktop_app_entry.sh
}
function root_install()
@@ -77,7 +79,6 @@ function root_install()
install_to_prefix "$install_prefix"
mkdir -p /usr/local/share/applications
${install_prefix}/etc/refresh_desktop_app_entry.sh
}
function install_to_prefix()
@@ -124,6 +125,8 @@ function install_to_prefix()
rm "$1/bin/llplugin/.user_does_not_want_chrome_sandboxing_and_accepts_the_risks" 2> /dev/null
pkexec "$1/etc/chrome_sandboxing_permissions_setup.sh" || die "Failed to set permissions on chrome-sandbox"
fi
sh "$1/etc/refresh_desktop_app_entry.sh" || echo "Failed to integrate into DE via XDG."
set_slurl_handler "$1"
}
function backup_previous_installation()
@@ -134,6 +137,16 @@ function backup_previous_installation()
mv "$1" "$backup_dir" || die "Failed to create backup of existing installation!"
}
function set_slurl_handler()
{
local install_dir=$1
prompt "Would you like to set Alchemy as your default SLurl handler? [Y/N]: "
if [[ $? == 0 ]]; then
exit 0
fi
"$install_dir"/etc/register_secondlifeprotocol.sh #Successful association comes with a notification to the user.
}
if [ "$UID" == "0" ]; then
root_install
Loading