Start using Flatpaks as the main install method for any desktop apps

This commit is contained in:
Josh.5
2023-07-08 02:59:43 +12:00
parent e717cd209f
commit 63754aaed5
21 changed files with 224 additions and 477 deletions

View File

@@ -64,6 +64,7 @@ RUN \
bash-completion \ bash-completion \
curl \ curl \
git \ git \
jq \
less \ less \
man-db \ man-db \
mlocate \ mlocate \
@@ -225,15 +226,37 @@ RUN \
&& \ && \
echo echo
# Install openssh server # Install desktop environment
RUN \ RUN \
echo "**** Update apt database ****" \ echo "**** Update apt database ****" \
&& apt-get update \ && apt-get update \
&& \ && \
echo "**** Install openssh server ****" \ echo "**** Install desktop environment ****" \
&& apt-get install -y \ && apt-get install -y \
openssh-server \ xfce4 \
&& echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config \ xfce4-terminal \
msttcorefonts \
fonts-vlgothic \
gedit \
# Delete these as they are not needed at all
&& rm -f \
/usr/share/applications/software-properties-drivers.desktop \
/usr/share/applications/xfce4-about.desktop \
/usr/share/applications/xfce4-session-logout.desktop \
# Hide these apps. They can be displayed if a user really wants them.
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/xfce4-accessibility-settings.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/xfce4-color-settings.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/xfce4-mail-reader.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/vim.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/thunar-settings.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/thunar.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/pavucontrol.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/debian-uxterm.desktop \
&& sed -i '/[Desktop Entry]/a\NoDisplay=true' /usr/share/applications/debian-xterm.desktop \
# Force these apps to be "System" Apps rather than "Categories=System;Utility;Core;GTK;Filesystem;"
&& sed -i 's/^Categories=.*$/Categories=System;/' /usr/share/applications/xfce4-appfinder.desktop \
&& sed -i 's/^Categories=.*$/Categories=System;/' /usr/share/applications/thunar-bulk-rename.desktop \
&& sed -i 's/^Categories=.*$/Categories=System;/' /usr/share/applications/org.gnome.gedit.desktop \
&& \ && \
echo "**** Section cleanup ****" \ echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \ && apt-get clean autoclean -y \
@@ -245,6 +268,79 @@ RUN \
&& \ && \
echo echo
# Add support for flatpaks
RUN \
echo "**** Update apt database ****" \
&& apt-get update \
&& \
echo "**** Install flatpak support ****" \
&& apt-get install -y \
bridge-utils \
flatpak \
gnome-software-plugin-flatpak \
libpam-cgfs \
libvirt0 \
lxc \
uidmap \
&& \
echo "**** Configure flatpak ****" \
&& chmod u+s /usr/bin/bwrap \
&& flatpak remote-add flathub https://flathub.org/repo/flathub.flatpakrepo \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Setup dind
# Ref:
# - https://github.com/docker-library/docker/blob/master/20.10/dind/Dockerfile
# - https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html
ARG DOCKER_VERSION=20.10.18
ARG DOCKER_COMPOSE_VERSION=v2.11.2
RUN \
echo "**** Fetch Docker static binary package ****" \
&& cd /tmp \
&& wget -O /tmp/docker-${DOCKER_VERSION}.tgz \
https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& \
echo "**** Extract static binaries ****" \
&& mkdir -p /usr/local/bin \
&& tar --extract \
--file /tmp/docker-${DOCKER_VERSION}.tgz \
--strip-components 1 \
--directory /usr/local/bin/ \
--no-same-owner \
&& \
echo "**** Install docker-compose ****" \
&& wget -O /usr/local/bin/docker-compose "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Linux-x86_64" \
&& chmod +x /usr/local/bin/docker-compose \
&& \
echo "**** Install nvidia runtime ****" \
&& distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add - \
&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list \
&& apt-get update \
&& apt-get install -y \
nvidia-container-toolkit \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
VOLUME /var/lib/docker
# TODO: Deprecate neko and noVNC for KasmVNC
# Install Neko server # Install Neko server
COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko
COPY --from=m1k1o/neko:base /var/www /var/www COPY --from=m1k1o/neko:base /var/www /var/www
@@ -314,96 +410,6 @@ RUN \
/tmp/websockify-* \ /tmp/websockify-* \
/tmp/websockify.tar.gz /tmp/websockify.tar.gz
# Add support for flatpaks
RUN \
echo "**** Update apt database ****" \
&& apt-get update \
&& \
echo "**** Install flatpak support ****" \
&& apt-get install -y \
bridge-utils \
flatpak \
libpam-cgfs \
libvirt0 \
lxc \
uidmap \
&& \
echo "**** Configure flatpak ****" \
&& chmod u+s /usr/bin/bwrap \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Install desktop environment
RUN \
echo "**** Update apt database ****" \
&& apt-get update \
&& \
echo "**** Install desktop environment ****" \
&& apt-get install -y \
xfce4 \
xfce4-terminal \
msttcorefonts \
fonts-vlgothic \
gedit \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Install Steam
RUN \
echo "**** Install steam ****" \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& echo steam steam/question select "I AGREE" | debconf-set-selections \
&& echo steam steam/license note '' | debconf-set-selections \
&& apt-get install -y \
steam \
steam-devices \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Install firefox
RUN \
echo "**** Update apt database ****" \
&& apt-get update \
&& \
echo "**** Install firefox ****" \
&& apt-get install -y \
firefox-esr \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Setup audio streaming deps # Setup audio streaming deps
RUN \ RUN \
echo "**** Update apt database ****" \ echo "**** Update apt database ****" \
@@ -444,31 +450,6 @@ RUN \
&& \ && \
echo echo
# Install sunshine
ARG SUNSHINE_VERSION=0.20.0
RUN \
echo "**** Fetch Sunshine deb package ****" \
&& cd /tmp \
&& wget -O /tmp/sunshine-debian.deb \
https://github.com/LizardByte/sunshine/releases/download/v${SUNSHINE_VERSION}/sunshine-debian-bullseye-amd64.deb \
&& \
echo "**** Update apt database ****" \
&& apt-get update \
&& \
echo "**** Install Sunshine ****" \
&& apt-get install -y /tmp/sunshine-debian.deb \
&& apt-get install -y libboost-chrono1.74.0 \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Setup video streaming deps # Setup video streaming deps
RUN \ RUN \
echo "**** Update apt database ****" \ echo "**** Update apt database ****" \
@@ -492,49 +473,6 @@ RUN \
&& \ && \
echo echo
# Setup dind
# Ref:
# - https://github.com/docker-library/docker/blob/master/20.10/dind/Dockerfile
# - https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html
ARG DOCKER_VERSION=20.10.18
ARG DOCKER_COMPOSE_VERSION=v2.11.2
RUN \
echo "**** Fetch Docker static binary package ****" \
&& cd /tmp \
&& wget -O /tmp/docker-${DOCKER_VERSION}.tgz \
https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& \
echo "**** Extract static binaries ****" \
&& mkdir -p /usr/local/bin \
&& tar --extract \
--file /tmp/docker-${DOCKER_VERSION}.tgz \
--strip-components 1 \
--directory /usr/local/bin/ \
--no-same-owner \
&& \
echo "**** Install docker-compose ****" \
&& wget -O /usr/local/bin/docker-compose "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Linux-x86_64" \
&& chmod +x /usr/local/bin/docker-compose \
&& \
echo "**** Install nvidia runtime ****" \
&& distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add - \
&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list \
&& apt-get update \
&& apt-get install -y \
nvidia-container-toolkit \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
VOLUME /var/lib/docker
# Configure default user and set env # Configure default user and set env
ENV \ ENV \
@@ -571,7 +509,8 @@ ENV \
NVIDIA_DRIVER_CAPABILITIES="all" \ NVIDIA_DRIVER_CAPABILITIES="all" \
NVIDIA_VISIBLE_DEVICES="all" \ NVIDIA_VISIBLE_DEVICES="all" \
XORG_SOCKET_DIR="/tmp/.X11-unix" \ XORG_SOCKET_DIR="/tmp/.X11-unix" \
XDG_RUNTIME_DIR="/tmp/.X11-unix/run" XDG_RUNTIME_DIR="/tmp/.X11-unix/run" \
XDG_DATA_DIRS="/home/default/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/"
# Set pulseaudio environment variables # Set pulseaudio environment variables
ENV \ ENV \

View File

@@ -40,3 +40,11 @@ services:
- /opt/container-data/steam-headless/.X11-unix/:/tmp/.X11-unix/:rw - /opt/container-data/steam-headless/.X11-unix/:/tmp/.X11-unix/:rw
# Pulse audio socket. This will be shared with other containers so they can access the audio sink. # Pulse audio socket. This will be shared with other containers so they can access the audio sink.
- /opt/container-data/steam-headless/pulse/:/tmp/pulse/:rw - /opt/container-data/steam-headless/pulse/:/tmp/pulse/:rw
# Store dind var files in a volume
- steam-headless-var-lib-docker:/var/lib/docker/:rw
# Store flatpak var files in a volume
- steam-headless-var-lib-flatpak:/var/lib/flatpak/:rw
volumes:
steam-headless-var-lib-docker:
steam-headless-var-lib-flatpak:

View File

@@ -70,10 +70,7 @@ mkdir -p ${XDG_RUNTIME_DIR}
chown -R ${PUID}:${PGID} ${XDG_RUNTIME_DIR} chown -R ${PUID}:${PGID} ${XDG_RUNTIME_DIR}
# Ensure only the 'default' user can access this directory # Ensure only the 'default' user can access this directory
chmod 700 ${XDG_RUNTIME_DIR} chmod 700 ${XDG_RUNTIME_DIR}
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:/var/lib/flatpak/exports/share:/home/${USER}/.local/share/flatpak/exports/share" # Set the default background
# Ensure the start-desktop.sh script is executable
chmod +x /usr/bin/start-desktop.sh
# Set the default background for gnome based desktop
mkdir -p /etc/alternatives mkdir -p /etc/alternatives
ln -sf /usr/share/backgrounds/steam.jpg /etc/alternatives/desktop-background ln -sf /usr/share/backgrounds/steam.jpg /etc/alternatives/desktop-background
chmod a+r /etc/alternatives/desktop-background chmod a+r /etc/alternatives/desktop-background

View File

@@ -13,9 +13,9 @@ else
# Ensure pulseaudio directories have the correct permissions # Ensure pulseaudio directories have the correct permissions
mkdir -p \ mkdir -p \
${PULSE_SOCKET_DIR} \ ${PULSE_SOCKET_DIR} \
/home/${USER}/.config/pulse ${USER_HOME:?}/.config/pulse
chmod -R a+rw ${PULSE_SOCKET_DIR} chmod -R a+rw ${PULSE_SOCKET_DIR}
chown -R ${PUID}:${PGID} /home/${USER}/.config/pulse chown -R ${PUID}:${PGID} ${USER_HOME:?}/.config/pulse
# Configure the palse audio socket # Configure the palse audio socket
sed -i "s|^; default-server.*$|default-server = ${PULSE_SERVER}|" /etc/pulse/client.conf sed -i "s|^; default-server.*$|default-server = ${PULSE_SERVER}|" /etc/pulse/client.conf
@@ -30,9 +30,6 @@ else
if [ "X${DEBUGGING:-}" == "X" ]; then if [ "X${DEBUGGING:-}" == "X" ]; then
sed -i 's|^; log-level.*$|log-level = debug|' /etc/pulse/daemon.conf sed -i 's|^; log-level.*$|log-level = debug|' /etc/pulse/daemon.conf
fi fi
# Make startup script executable
chmod +x /usr/bin/start-pulseaudio.sh
fi fi
chown -R ${USER} /etc/pulse chown -R ${USER} /etc/pulse

View File

@@ -46,7 +46,7 @@ function configure_nvidia_x_server {
sed -i '/Driver\s\+"nvidia"/a\ Option "ModeValidation" "NoMaxPClkCheck, NoEdidMaxPClkCheck, NoMaxSizeCheck, NoHorizSyncCheck, NoVertRefreshCheck, NoVirtualSizeCheck, NoTotalSizeCheck, NoDualLinkDVICheck, NoDisplayPortBandwidthCheck, AllowNon3DVisionModes, AllowNonHDMI3DModes, AllowNonEdidModes, NoEdidHDMI2Check, AllowDpInterlaced"\n Option "HardDPMS" "False"' /etc/X11/xorg.conf sed -i '/Driver\s\+"nvidia"/a\ Option "ModeValidation" "NoMaxPClkCheck, NoEdidMaxPClkCheck, NoMaxSizeCheck, NoHorizSyncCheck, NoVertRefreshCheck, NoVirtualSizeCheck, NoTotalSizeCheck, NoDualLinkDVICheck, NoDisplayPortBandwidthCheck, AllowNon3DVisionModes, AllowNonHDMI3DModes, AllowNonEdidModes, NoEdidHDMI2Check, AllowDpInterlaced"\n Option "HardDPMS" "False"' /etc/X11/xorg.conf
sed -i '/Section\s\+"Monitor"/a\ '"${MODELINE}" /etc/X11/xorg.conf sed -i '/Section\s\+"Monitor"/a\ '"${MODELINE}" /etc/X11/xorg.conf
# Prevent interference between GPUs # Prevent interference between GPUs
echo -e "Section \"ServerFlags\"\n Option \"AutoAddGPU\" \"false\"\nEndSection" | sudo tee -a /etc/X11/xorg.conf > /dev/null echo -e "Section \"ServerFlags\"\n Option \"AutoAddGPU\" \"false\"\nEndSection" | tee -a /etc/X11/xorg.conf > /dev/null
# Configure primary GPU # Configure primary GPU
sed -i '/Driver\s\+"nvidia"/a\ Option "AllowEmptyInitialConfiguration"\n Option "PrimaryGPU" "yes"' /usr/share/X11/xorg.conf.d/nvidia-drm-outputclass.conf sed -i '/Driver\s\+"nvidia"/a\ Option "AllowEmptyInitialConfiguration"\n Option "PrimaryGPU" "yes"' /usr/share/X11/xorg.conf.d/nvidia-drm-outputclass.conf
} }

View File

@@ -5,7 +5,6 @@ if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
if [ ! -S /var/run/docker.sock ]; then if [ ! -S /var/run/docker.sock ]; then
echo "Enable Dockerd daemon" echo "Enable Dockerd daemon"
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/dind.ini sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/dind.ini
chmod +x /usr/bin/start-dind.sh
else else
echo "Docker socket has been passed in from host. Using that instead" echo "Docker socket has been passed in from host. Using that instead"
fi fi
@@ -14,9 +13,9 @@ if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
echo "Add user '${USER}' to docker group for sudoless execution" echo "Add user '${USER}' to docker group for sudoless execution"
groupadd docker groupadd docker
usermod -aG docker ${USER} usermod -aG docker ${USER}
mkdir -p /home/${USER}/.docker mkdir -p ${USER_HOME:?}/.docker
chown -R ${PUID}:${PGID} /home/${USER}/.docker chown -R ${PUID}:${PGID} ${USER_HOME:?}/.docker
chmod -R g+rwx /home/${USER}/.docker chmod -R g+rwx ${USER_HOME:?}/.docker
fi fi
else else
echo "Dockerd daemon not available when container is run in 'secondary' mode" echo "Dockerd daemon not available when container is run in 'secondary' mode"

View File

@@ -5,7 +5,6 @@ if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
if [ "${ENABLE_SUNSHINE:-}" = "true" ]; then if [ "${ENABLE_SUNSHINE:-}" = "true" ]; then
echo "Enable Sunshine server" echo "Enable Sunshine server"
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/sunshine.ini sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/sunshine.ini
chmod +x /usr/bin/start-sunshine.sh
else else
echo "Disable Sunshine server" echo "Disable Sunshine server"
fi fi

View File

@@ -12,5 +12,3 @@ PS1='[\u@\h \W]\$ '
PATH=$PATH:$HOME/.local/bin:$HOME/bin PATH=$PATH:$HOME/.local/bin:$HOME/bin
# Export /usr/games # Export /usr/games
PATH=$PATH:/usr/games PATH=$PATH:/usr/games
# Export flatpak data directories
XDG_DATA_DIRS="${XDG_DATA_DIRS}:/var/lib/flatpak/exports/share:/home/${USER}/.local/share/flatpak/exports/share"

View File

@@ -4,11 +4,10 @@ Version=0.9.4
Type=Application Type=Application
Name=Steam Name=Steam
Comment=launch steam on login Comment=launch steam on login
Exec=/usr/games/steam %U -silent Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper --file-forwarding com.valvesoftware.Steam @@u %U @@ -silent
Icon=steam Icon=steam
OnlyShowIn=XFCE; OnlyShowIn=XFCE;
RunHook=0 RunHook=0
StartupNotify=false StartupNotify=false
Terminal=false Terminal=false
Hidden=false Hidden=false

View 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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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
View File

@@ -1,34 +1,14 @@
#!/usr/bin/env bash #!/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 echo "**** Installing/upgrading ProtonUp-Qt via flatpak ****"
script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
script_name=$( basename "${BASH_SOURCE[0]}" )
# 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() { # Configure Firefox as the default browser
if ! command -v ${pkg} >/dev/null; then echo "Configure ProtonUp-Qt..."
# Install application sed -i 's/^Categories=.*$/Categories=Utility;/' \
python3 -m pip install ${pkg} ${USER_HOME}/.local/share/flatpak/exports/share/applications/net.davidotek.pupgui2.desktop
# 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
# Remove installer shortcut echo "DONE"
rm -f /usr/share/applications/install.protonup.desktop
}
#INSTALLER:
source "${script_path}/installer.sh"

View 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"

View File

@@ -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

View File

@@ -5,7 +5,7 @@
# File Created: Thursday, 1st January 1970 12:00:00 pm # File Created: Thursday, 1st January 1970 12:00:00 pm
# Author: Console and webGui login account (jsunnex@gmail.com) # Author: Console and webGui login account (jsunnex@gmail.com)
# ----- # -----
# Last Modified: Wednesday, 26th January 2022 5:38:23 pm # Last Modified: Saturday, 8th July 2023 2:34:11 am
# Modified By: Console and webGui login account (jsunnex@gmail.com) # Modified By: Console and webGui login account (jsunnex@gmail.com)
### ###
set -e set -e
@@ -19,27 +19,23 @@ trap _term SIGTERM SIGINT
# CONFIGURE: # CONFIGURE:
XDG_DATA_DIRS="${XDG_DATA_DIRS}:/var/lib/flatpak/exports/share:/home/${USER}/.local/share/flatpak/exports/share"
export $(dbus-launch) export $(dbus-launch)
# EXECUTE PROCESS: # EXECUTE PROCESS:
# Install/Upgrade user apps
if [[ ! -f /tmp/.desktop-apps-updated.lock ]]; then
source /opt/scripts/install_steam.sh
source /opt/scripts/install_firefox.sh
source /opt/scripts/install_protonup.sh
touch /tmp/.desktop-apps-updated.lock
fi
# Wait for the X server to start # Wait for the X server to start
wait_for_x wait_for_x
# Run the desktop environment in order of priority # Run the desktop environment
if [[ -e /usr/bin/cinnamon-session ]]; then echo "**** Starting Xfce4 ****"
/usr/bin/cinnamon-session --display=${DISPLAY} & /usr/bin/startxfce4 &
desktop_pid=$! desktop_pid=$!
elif [[ -e /usr/bin/mate-session ]]; then
/usr/bin/mate-session &
desktop_pid=$!
elif [[ -e /usr/bin/startplasma-x11 ]]; then
/usr/bin/startplasma-x11 &
desktop_pid=$!
elif [[ -e /usr/bin/startxfce4 ]]; then
/usr/bin/startxfce4 &
desktop_pid=$!
fi
# WAIT FOR CHILD PROCESS: # WAIT FOR CHILD PROCESS:

View File

@@ -1,7 +0,0 @@
[Desktop Entry]
Name=Installer - Heroic (Epic Games Launcher)
Categories=Game;
Exec=/opt/scripts/install_heroic.sh %U
Icon=installsoftware
Terminal=true
Type=Application

View File

@@ -1,7 +0,0 @@
[Desktop Entry]
Name=Installer - Rare/Legendary (Epic Games Commandline Launcher)
Categories=Game;
Exec=/opt/scripts/install_legendary.sh %U
Icon=installsoftware
Terminal=true
Type=Application

View File

@@ -1,7 +0,0 @@
[Desktop Entry]
Name=Installer - Lutris
Categories=Game;
Exec=/opt/scripts/install_lutris.sh %U
Icon=installsoftware
Terminal=true
Type=Application

View File

@@ -1,7 +0,0 @@
[Desktop Entry]
Name=Installer - Protonup
Categories=Game;
Exec=/opt/scripts/install_protonup.sh %U
Icon=installsoftware
Terminal=true
Type=Application