Start using Flatpaks as the main install method for any desktop apps
This commit is contained in:
31
overlay/opt/scripts/install_firefox.sh
Executable file
31
overlay/opt/scripts/install_firefox.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "**** Installing/upgrading Firefox via flatpak ****"
|
||||
|
||||
# Install Firefox
|
||||
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak --user install --assumeyes --noninteractive --or-update flathub org.mozilla.firefox
|
||||
|
||||
# Configure Firefox as the default browser
|
||||
echo "Configure Firefox..."
|
||||
custom_webbrowser="$(cat <<EOF
|
||||
"libraryfolders"
|
||||
[Desktop Entry]
|
||||
NoDisplay=true
|
||||
Version=1.0
|
||||
Encoding=UTF-8
|
||||
Type=X-XFCE-Helper
|
||||
X-XFCE-Category=WebBrowser
|
||||
X-XFCE-CommandsWithParameter=${USER_HOME:?}/.local/share/flatpak/exports/bin/org.mozilla.firefox "%s"
|
||||
Icon=org.mozilla.firefox
|
||||
Name=org.mozilla.firefox
|
||||
X-XFCE-Commands=${USER_HOME:?}/.local/share/flatpak/exports/bin/org.mozilla.firefox
|
||||
EOF
|
||||
)"
|
||||
if [[ ! -f ${USER_HOME:?}/.local/share/xfce4/helpers/custom-WebBrowser.desktop ]]; then
|
||||
mkdir -p ${USER_HOME:?}/.local/share/xfce4/helpers
|
||||
echo "${custom_webbrowser}" > ${USER_HOME:?}/.local/share/xfce4/helpers/custom-WebBrowser.desktop
|
||||
gio mime x-scheme-handler/http org.mozilla.firefox.desktop
|
||||
fi
|
||||
|
||||
echo "DONE"
|
||||
@@ -1,89 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: install_heroic.sh
|
||||
# Project: scripts
|
||||
# File Created: Thursday, 1st January 1970 12:00:00 pm
|
||||
# Author: Console and webGui login account (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Wednesday, 31st August 2022 10:01:31 pm
|
||||
# Modified By: Josh.5 (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
pkg=heroic
|
||||
script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
|
||||
script_name=$( basename "${BASH_SOURCE[0]}" )
|
||||
|
||||
github_get_all_release() {
|
||||
REPO="${1}";
|
||||
curl --silent "https://api.github.com/repos/${REPO}/releases" \
|
||||
| grep '"tag_name":' \
|
||||
| sed -E 's/.*"([^"]+)".*/\1/';
|
||||
}
|
||||
github_get_release_download_url() {
|
||||
REPO="${1}";
|
||||
TAG="${2}";
|
||||
TYPE="${3}";
|
||||
IGNORE="${4}";
|
||||
curl --silent "https://api.github.com/repos/${REPO}/releases/tags/${TAG}" \
|
||||
| grep '"browser_download_url":' \
|
||||
| sed -E 's/.*"([^"]+)".*/\1/' \
|
||||
| grep -P "${TYPE}" \
|
||||
| grep -P "${TYPE}" \
|
||||
| head -n1;
|
||||
}
|
||||
|
||||
install() {
|
||||
|
||||
# Download Heroic deb package if it does not yet exist
|
||||
__latest_heroic_release=$(github_get_all_release "Heroic-Games-Launcher/HeroicGamesLauncher" | head -n1)
|
||||
if [[ ! -f "/home/${USER}/Downloads/heroic-${__latest_heroic_release}.deb" ]]; then
|
||||
__heroic_download_link=$(github_get_release_download_url "Heroic-Games-Launcher/HeroicGamesLauncher" "${__latest_heroic_release}" ".deb")
|
||||
wget -O /tmp/heroic.deb "${__heroic_download_link}"
|
||||
[[ $? -gt 0 ]] && echo "Error downloading pacakge. Exit!" && return 1
|
||||
mv /tmp/heroic.deb "/home/${USER}/Downloads/heroic-${__latest_heroic_release}.deb"
|
||||
fi
|
||||
|
||||
# Install/Update the latest version of Heroic
|
||||
[[ "${APT_UPDATED:-false}" == 'false' ]] && apt-get update && APT_UPDATED=true
|
||||
apt-get install -y "/home/${USER}/Downloads/heroic-${__latest_heroic_release}.deb"
|
||||
|
||||
# Install/Update deps for HeroicBashLauncher
|
||||
[[ "${APT_UPDATED:-false}" == 'false' ]] && apt-get update && APT_UPDATED=true
|
||||
apt-get install -y zenity
|
||||
|
||||
# Install/Update the latest version HeroicBashLauncher
|
||||
__latest_hbl_release=$(github_get_all_release "redromnon/HeroicBashLauncher" | head -n1)
|
||||
if [[ ! -e "/home/${USER}/HeroicBashLauncher/.${__latest_hbl_release}" ]]; then
|
||||
# Download HeroicBashLauncher
|
||||
if [[ ! -f "/home/${USER}/Downloads/HeroicBashLauncher-${__latest_hbl_release}.zip" ]]; then
|
||||
__hbl_download_link=$(github_get_release_download_url "redromnon/HeroicBashLauncher" "${__latest_hbl_release}" "\d\.zip")
|
||||
wget -O /tmp/hbl.zip "${__hbl_download_link}"
|
||||
[[ $? -gt 0 ]] && echo "Error downloading pacakge. Exit!" && return 1
|
||||
mv /tmp/hbl.zip "/home/${USER}/Downloads/HeroicBashLauncher-${__latest_hbl_release}.zip"
|
||||
fi
|
||||
|
||||
# Extract HeroicBashLauncher
|
||||
mkdir -p "/home/${USER}/HeroicBashLauncher"
|
||||
rm -rf "/tmp/hbl"
|
||||
su ${USER} -c "mkdir -p /tmp/hbl && cd /tmp/hbl && unzip -o /home/${USER}/Downloads/HeroicBashLauncher-${__latest_hbl_release}.zip"
|
||||
su ${USER} -c "cp -rfv /tmp/hbl/HeroicBashLauncher*/HeroicBashLauncher/* /home/${USER}/HeroicBashLauncher/"
|
||||
chmod +x "/home/${USER}/HeroicBashLauncher/HeroicBashLauncher"
|
||||
|
||||
# Setup script in user PATH
|
||||
su ${USER} -c "mkdir -p /home/default/.local/bin"
|
||||
su ${USER} -c "ln -sf /home/${USER}/HeroicBashLauncher/HeroicBashLauncher /home/${USER}/.local/bin/HeroicBashLauncher"
|
||||
fi
|
||||
|
||||
# Remove installer shortcut
|
||||
rm -f /usr/share/applications/install.heroic.desktop
|
||||
}
|
||||
|
||||
|
||||
#INSTALLER:
|
||||
source "${script_path}/installer.sh"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: install_legendary.sh
|
||||
# Project: scripts
|
||||
# File Created: Thursday, 1st January 1970 12:00:00 pm
|
||||
# Author: Console and webGui login account (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Sunday, 16th January 2022 5:44:25 am
|
||||
# Modified By: Console and webGui login account (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
pkg=legendary
|
||||
script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
|
||||
script_name=$( basename "${BASH_SOURCE[0]}" )
|
||||
|
||||
github_get_all_release() {
|
||||
REPO="${1}";
|
||||
curl --silent "https://api.github.com/repos/${REPO}/releases" \
|
||||
| grep '"tag_name":' \
|
||||
| sed -E 's/.*"([^"]+)".*/\1/';
|
||||
}
|
||||
|
||||
install() {
|
||||
if ! command -v ${pkg} >/dev/null; then
|
||||
# Download/install the latest legendary binary
|
||||
latest_release=$(github_get_all_release derrod/legendary | head -n1)
|
||||
download_url="https://github.com/derrod/legendary/releases/download/${latest_release}/legendary"
|
||||
wget -O "/tmp/legendary-${latest_release}" "${download_url}"
|
||||
chmod +x /tmp/legendary-${latest_release}
|
||||
cp -f /tmp/legendary-${latest_release} /usr/bin/legendary-${latest_release}
|
||||
rm -f /usr/bin/legendary
|
||||
ln -s /usr/bin/legendary-${latest_release} /usr/bin/legendary
|
||||
fi
|
||||
|
||||
if ! command -v rare >/dev/null; then
|
||||
# Install rare for a gui
|
||||
python3 -m pip install Rare
|
||||
fi
|
||||
|
||||
if ! command -v steam-legendary-wrapper >/dev/null; then
|
||||
# Download/install the steam-legendary-wrapper script
|
||||
wget -O "/tmp/steam-legendary-wrapper.sh" \
|
||||
"https://raw.githubusercontent.com/toalex77/steam-legendary-wrapper/main/steam-legendary-wrapper.sh"
|
||||
chmod +x /tmp/steam-legendary-wrapper.sh
|
||||
rm -f /usr/bin/steam-legendary-wrapper
|
||||
cp -f /tmp/steam-legendary-wrapper.sh /usr/bin/steam-legendary-wrapper
|
||||
fi
|
||||
|
||||
# Remove installer shortcut
|
||||
rm -f /usr/share/applications/install.legendary.desktop
|
||||
|
||||
# Add launcher shortcut
|
||||
cat << EOF > /usr/share/applications/rare.desktop
|
||||
[Desktop Entry]
|
||||
Name=Rare - (Epic Games Store)
|
||||
Comment=A frontend for legendary, the open source Epic Games Store alternative
|
||||
GenericName=Rare - (Epic Games Store)
|
||||
X-GNOME-FullName=Rare - (Epic Games Store)
|
||||
Exec=/usr/local/bin/rare %u
|
||||
Terminal=false
|
||||
X-MultipleArgs=false
|
||||
Type=Application
|
||||
Icon=rare
|
||||
Categories=Game;
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
#INSTALLER:
|
||||
source "${script_path}/installer.sh"
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: install_lutris.sh
|
||||
# Project: scripts
|
||||
# File Created: Thursday, 1st January 1970 12:45:00 pm
|
||||
# Author: Console and webGui login account (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Sunday, 16th January 2022 4:54:11 am
|
||||
# Modified By: Console and webGui login account (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
pkg=lutris
|
||||
script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
|
||||
script_name=$( basename "${BASH_SOURCE[0]}" )
|
||||
|
||||
|
||||
install() {
|
||||
if ! dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
|
||||
echo "deb http://download.opensuse.org/repositories/home:/strycore/Debian_10/ ./" | tee /etc/apt/sources.list.d/lutris.list
|
||||
wget -q https://download.opensuse.org/repositories/home:/strycore/Debian_10/Release.key -O- | apt-key add -
|
||||
apt-get update
|
||||
apt-get -y install \
|
||||
lutris \
|
||||
python3-dbus
|
||||
|
||||
sed -i '/Exec=lutris %U/c\Exec=/usr/games/lutris %U' /usr/share/applications/net.lutris.Lutris.desktop
|
||||
fi
|
||||
|
||||
# Remove installer shortcut
|
||||
rm -f /usr/share/applications/install.lutris.desktop
|
||||
}
|
||||
|
||||
|
||||
#INSTALLER:
|
||||
source "${script_path}/installer.sh"
|
||||
38
overlay/opt/scripts/install_protonup.sh
Normal file → Executable file
38
overlay/opt/scripts/install_protonup.sh
Normal file → Executable file
@@ -1,34 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: install_protonup.sh
|
||||
# Project: scripts
|
||||
# File Created: Thursday, 1st January 1970 12:45:00 pm
|
||||
# Author: Console and webGui login account (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Sunday, 16th January 2022 4:55:12 am
|
||||
# Modified By: Console and webGui login account (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
pkg=protonup-ng
|
||||
script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
|
||||
script_name=$( basename "${BASH_SOURCE[0]}" )
|
||||
echo "**** Installing/upgrading ProtonUp-Qt via flatpak ****"
|
||||
|
||||
# Install ProtonUp-Qt
|
||||
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak --user install --assumeyes --noninteractive --or-update net.davidotek.pupgui2
|
||||
|
||||
install() {
|
||||
if ! command -v ${pkg} >/dev/null; then
|
||||
# Install application
|
||||
python3 -m pip install ${pkg}
|
||||
# Set installation path as user
|
||||
# Note: Run command with su because init processes are run as root but this is a user thing...
|
||||
su ${USER} -c "${pkg} -d '/home/${USER}/.steam/root/compatibilitytools.d/'"
|
||||
# Update to the latest version on startup using the users Downloads directory
|
||||
su ${USER} -c "${pkg} -y -o '/home/${USER}/Downloads/'" &
|
||||
fi
|
||||
# Configure Firefox as the default browser
|
||||
echo "Configure ProtonUp-Qt..."
|
||||
sed -i 's/^Categories=.*$/Categories=Utility;/' \
|
||||
${USER_HOME}/.local/share/flatpak/exports/share/applications/net.davidotek.pupgui2.desktop
|
||||
|
||||
# Remove installer shortcut
|
||||
rm -f /usr/share/applications/install.protonup.desktop
|
||||
}
|
||||
|
||||
|
||||
#INSTALLER:
|
||||
source "${script_path}/installer.sh"
|
||||
echo "DONE"
|
||||
|
||||
54
overlay/opt/scripts/install_steam.sh
Executable file
54
overlay/opt/scripts/install_steam.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "**** Installing/upgrading Steam via flatpak ****"
|
||||
|
||||
# Install Steam client
|
||||
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak --user install --assumeyes --noninteractive --or-update flathub com.valvesoftware.Steam
|
||||
# Configure any required overrides
|
||||
flatpak --user override --filesystem=/mnt/games com.valvesoftware.Steam
|
||||
# TODO: Check if we should add /dev/dri here??
|
||||
|
||||
# Configure default steam library paths
|
||||
echo "Configure Steam default libraries..."
|
||||
mkdir -p /mnt/games/GameLibrary/SteamLibrary
|
||||
libraryfolders="$(cat <<EOF
|
||||
"libraryfolders"
|
||||
{
|
||||
"0"
|
||||
{
|
||||
"path" "${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam"
|
||||
"label" ""
|
||||
"contentid" "5619710282499379610"
|
||||
"totalsize" "0"
|
||||
"update_clean_bytes_tally" "0"
|
||||
"time_last_update_corruption" "0"
|
||||
"apps"
|
||||
{
|
||||
}
|
||||
}
|
||||
"1"
|
||||
{
|
||||
"path" "/mnt/games/GameLibrary/SteamLibrary"
|
||||
"label" "Mounted Games"
|
||||
"contentid" "4437054932394438372"
|
||||
"totalsize" "0"
|
||||
"update_clean_bytes_tally" "0"
|
||||
"time_last_update_corruption" "0"
|
||||
"apps"
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
)"
|
||||
if [[ ! -f ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/libraryfolders.vdf ]]; then
|
||||
mkdir -p ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps
|
||||
echo "${libraryfolders}" > ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/libraryfolders.vdf
|
||||
fi
|
||||
if [[ ! -f ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/config/libraryfolders.vdf ]]; then
|
||||
mkdir -p ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/config
|
||||
echo "${libraryfolders}" > ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/config/libraryfolders.vdf
|
||||
fi
|
||||
|
||||
echo "DONE"
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
if [[ "${script_path}" == *"opt/script"* ]]; then
|
||||
while true; do
|
||||
echo
|
||||
read -p "Would you like to configure this container to install ${pkg^} on startup? (Y/N) " ans
|
||||
|
||||
case $ans in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
|
||||
# Install this script to the home directory init.d
|
||||
dest_file="/home/${USER}/init.d/${script_name}"
|
||||
cp -f "${script_path}/${script_name}" "${dest_file}"
|
||||
# Remove anything under '#INSTALLER:'
|
||||
sed -i '/^#INSTALLER.*$/Q' "${dest_file}"
|
||||
# Append 'install' command
|
||||
echo 'install' >> "${dest_file}"
|
||||
echo
|
||||
echo
|
||||
echo "Installed init script '${dest_file}'"
|
||||
echo "This script will install ${pkg^} when you next restart the container."
|
||||
echo
|
||||
read -s -p "Press enter to continue"
|
||||
echo
|
||||
fi
|
||||
Reference in New Issue
Block a user