Move app install scripts to /usr/bin
This commit is contained in:
16
overlay/usr/bin/drop_caches.sh
Executable file
16
overlay/usr/bin/drop_caches.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: drop_caches.sh
|
||||
# Project: docker-steam-headless
|
||||
# File Created: Wednesday, 12th January 2022 5:08:46 pm
|
||||
# Author: Josh.5 (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Wednesday, 12th January 2022 5:44:17 pm
|
||||
# Modified By: Josh.5 (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
# Clear out the memory page cache
|
||||
echo 1 > /proc/sys/vm/drop_caches
|
||||
|
||||
# Flush any FS buffers
|
||||
sync
|
||||
31
overlay/usr/bin/install_firefox.sh
Executable file
31
overlay/usr/bin/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 --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"
|
||||
14
overlay/usr/bin/install_protonup.sh
Executable file
14
overlay/usr/bin/install_protonup.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 --or-update net.davidotek.pupgui2
|
||||
|
||||
# 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
|
||||
|
||||
echo "DONE"
|
||||
70
overlay/usr/bin/install_sunshine.sh
Executable file
70
overlay/usr/bin/install_sunshine.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "**** Installing/upgrading Sunshine via flatpak ****"
|
||||
|
||||
# Install Sunshine
|
||||
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak --user install --assumeyes --or-update flathub dev.lizardbyte.app.Sunshine
|
||||
# Configure any required overrides
|
||||
flatpak --user override --talk-name=org.freedesktop.Flatpak dev.lizardbyte.app.Sunshine
|
||||
|
||||
# Configure Sunshine as the default browser
|
||||
echo "Configure Sunshine..."
|
||||
sunshine_autostart_desktop="$(cat <<EOF
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
Name=Sunshine
|
||||
Comment=Launch sunshine on login
|
||||
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=dev.lizardbyte.app.Sunshine.sh dev.lizardbyte.app.Sunshine
|
||||
Icon=sunshine
|
||||
OnlyShowIn=XFCE;
|
||||
RunHook=0
|
||||
StartupNotify=false
|
||||
Terminal=false
|
||||
Hidden=false
|
||||
EOF
|
||||
)"
|
||||
mkdir -p "${USER_HOME:?}/.config/autostart"
|
||||
if [[ ! -f "${USER_HOME:?}/.config/autostart/Sunshine.desktop" ]]; then
|
||||
echo "${sunshine_autostart_desktop:?}" > "${USER_HOME:?}/.config/autostart/Sunshine.desktop"
|
||||
fi
|
||||
# Configure default launchers:
|
||||
sunshine_apps_json="$(cat <<EOF
|
||||
{
|
||||
"env": {
|
||||
"PATH": "\$(PATH):\$(HOME)\/.local\/bin"
|
||||
},
|
||||
"apps": [
|
||||
{
|
||||
"name": "Desktop",
|
||||
"image-path": "desktop.png"
|
||||
},
|
||||
{
|
||||
"name": "Low Res Desktop",
|
||||
"image-path": "desktop.png",
|
||||
"prep-cmd": [
|
||||
{
|
||||
"do": "xrandr --output HDMI-1 --mode 1920x1080",
|
||||
"undo": "xrandr --output HDMI-1 --mode 1920x1200"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Steam Big Picture",
|
||||
"image-path": "steam.png",
|
||||
"exclude-global-prep-cmd": "false",
|
||||
"detached": [
|
||||
"flatpak-spawn --host \/usr\/bin\/flatpak run --branch=stable --arch=x86_64 --command=\/app\/bin\/steam-wrapper com.valvesoftware.Steam steam:\/\/open\/bigpicture"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
)"
|
||||
mkdir -p "${USER_HOME:?}/.config/sunshine"
|
||||
if [[ ! -f "${USER_HOME:?}/.config/sunshine/apps.json" ]]; then
|
||||
echo "${sunshine_apps_json:?}" > "${USER_HOME:?}/.config/sunshine/apps.json"
|
||||
fi
|
||||
|
||||
echo "DONE"
|
||||
@@ -28,9 +28,9 @@ wait_for_x
|
||||
# Install/Upgrade user apps
|
||||
if [[ ! -f /tmp/.desktop-apps-updated.lock ]]; then
|
||||
xterm -geometry 200x50+0+0 -ls -e /bin/bash -c "
|
||||
source /opt/scripts/install_firefox.sh;
|
||||
source /opt/scripts/install_protonup.sh;
|
||||
source /opt/scripts/install_sunshine.sh;
|
||||
source /usr/bin/install_firefox.sh;
|
||||
source /usr/bin/install_protonup.sh;
|
||||
source /usr/bin/install_sunshine.sh;
|
||||
sleep 1;
|
||||
"
|
||||
touch /tmp/.desktop-apps-updated.lock
|
||||
|
||||
Reference in New Issue
Block a user