Pi-Apps install: check apt update, arm processor, chromeOS

pull/899/head
Botspot 4 years ago
parent 67c8bd7188
commit e08d786a5b

@ -11,53 +11,33 @@ if [[ "$(id -u)" == 0 ]]; then
error "Pi-Apps is not designed to be installed as root! Please try again as a regular user." error "Pi-Apps is not designed to be installed as root! Please try again as a regular user."
fi fi
DIRECTORY="$(readlink -f "$(dirname "$0")")" command -v apt >/dev/null || error "apt: command not found. Most likely this system is not running Debian."
#Ensure running arm processor
if uname -m | grep -q 'x86' ;then
error "Pi-Apps is not not supported on x86 processors."
fi
sudo apt update || error "The command 'sudo apt update' failed. Before Pi-Apps will work, you must fix your apt package-management system."
#install yad automatically #install yad automatically
if ! command -v yad >/dev/null;then if ! command -v yad >/dev/null;then
sudo apt install -y yad || error "Failed to install yad."
if [ -f /usr/bin/apt ];then
sudo apt update
sudo apt install -y yad || error "Failed to install yad."
updated=1
else
error "Failed to find any package manager to install yad."
fi
fi fi
#remove annoying YAD icon browser launcher #remove annoying YAD icon browser launcher
sudo rm -f /usr/share/applications/yad-icon-browser.desktop sudo rm -f /usr/share/applications/yad-icon-browser.desktop
#install git #install git
if ! command -v git >/dev/null;then if ! command -v git >/dev/null;then
sudo apt install -y git || error "Failed to install git."
if [ -f /usr/bin/apt ];then
#only run sudo apt update if not already run
if [ -z "$updated" ];then
sudo apt update
updated=1
fi
sudo apt install -y git || error "Failed to install git."
else
error "Failed to find any package manager to install git."
fi
fi fi
#install curl #install curl
if ! command -v curl >/dev/null;then if ! command -v curl >/dev/null;then
if [ -f /usr/bin/apt ];then sudo apt install -y curl || error "Failed to install curl."
#only run sudo apt update if not already run
if [ -z "$updated" ];then
sudo apt update
updated=1
fi
sudo apt install -y curl || error "Failed to install curl."
else
error "Failed to find any package manager to install curl."
fi
fi fi
#download pi-apps if folder missing #download pi-apps if folder missing
DIRECTORY="$(readlink -f "$(dirname "$0")")"
if [ -z "$DIRECTORY" ] || [ "$DIRECTORY" == "$HOME" ] || [ "$DIRECTORY" == bash ];then if [ -z "$DIRECTORY" ] || [ "$DIRECTORY" == "$HOME" ] || [ "$DIRECTORY" == bash ];then
DIRECTORY="$HOME/pi-apps" DIRECTORY="$HOME/pi-apps"
@ -69,8 +49,15 @@ if [ -z "$DIRECTORY" ] || [ "$DIRECTORY" == "$HOME" ] || [ "$DIRECTORY" == bash
error "Pi-Apps download failed!\ngit clone output was: $output" error "Pi-Apps download failed!\ngit clone output was: $output"
fi fi
fi fi
fi #Past this point, DIRECTORY variable populated with valid pi-apps directory
#if chromeOS, install lxterminal
if command -v garcon-terminal-handler >/dev/null ;then
echo "In order to install apps on chromeOS, a working terminal emulator is required.
Installing lxterminal in 10 seconds... (press Ctrl+C to cancel)"
sleep 10
sudo apt install -yf lxterminal || error "Failed to install lxterminal on chromeOS!"
fi fi
#from this point in, DIRECTORY variable populated with valid pi-apps directory
#menu button #menu button
if [ ! -f ~/.local/share/applications/pi-apps.desktop ];then if [ ! -f ~/.local/share/applications/pi-apps.desktop ];then
@ -87,12 +74,6 @@ Type=Application
Categories=Utility; Categories=Utility;
StartupNotify=true" > ~/.local/share/applications/pi-apps.desktop StartupNotify=true" > ~/.local/share/applications/pi-apps.desktop
if [ ! -f ~/Desktop/pi-apps.desktop ];then
echo "Adding Desktop shortcut..."
fi
cp -f ~/.local/share/applications/pi-apps.desktop ~/Desktop/pi-apps.desktop
chmod +x ~/Desktop/pi-apps.desktop
if [ ! -f ~/.local/share/applications/pi-apps-settings.desktop ];then if [ ! -f ~/.local/share/applications/pi-apps-settings.desktop ];then
echo "Creating Settings menu button..." echo "Creating Settings menu button..."
fi fi
@ -124,14 +105,12 @@ mkdir -p "${DIRECTORY}/data" && cd "${DIRECTORY}/data" || error "Failed to make
mkdir -p installed-packages preload settings status update-status categories mkdir -p installed-packages preload settings status update-status categories
cd $HOME cd $HOME
#hide template file by default #hide template app by default
"${DIRECTORY}/etc/categoryedit" "template" 'hidden' >/dev/null "${DIRECTORY}/etc/categoryedit" "template" 'hidden' >/dev/null
#hide duplicates if running in twisteros #hide duplicates if running in twisteros
if [ -f /usr/local/bin/twistver ] && [[ $(twistver) == "Twister OS version"* ]]; then if [ -f /usr/local/bin/twistver ] && [[ $(twistver) == "Twister OS version"* ]]; then
#twisteros full #twisteros full
PREIFS="$IFS"
IFS=$'\n'
apps="CommanderPi apps="CommanderPi
Box86 Box86
Discord Discord
@ -144,14 +123,12 @@ Chromium Widevine
Lightpad Lightpad
Wine (x86) Wine (x86)
Mac OS Theme" Mac OS Theme"
PREIFS="$IFS"
IFS=$'\n'
for app in $apps ;do for app in $apps ;do
"${DIRECTORY}/etc/categoryedit" "$app" 'hidden' >/dev/null "${DIRECTORY}/etc/categoryedit" "$app" 'hidden' >/dev/null
done done
IFS="$PREIFS"
#unhide chromiumv78 on twisteros
"${DIRECTORY}/etc/categoryedit" 'Back to Chromium v78' >/dev/null
echo "Finished hiding apps on TwisterOS."
elif [ -f /usr/local/bin/twistver ] && [[ $(twistver) != "Twister OS version"* ]]; then elif [ -f /usr/local/bin/twistver ] && [[ $(twistver) != "Twister OS version"* ]]; then
#twisteros lite #twisteros lite
@ -176,8 +153,6 @@ Mac OS Theme"
"${DIRECTORY}/etc/categoryedit" Scrcpy --delete >/dev/null "${DIRECTORY}/etc/categoryedit" Scrcpy --delete >/dev/null
"${DIRECTORY}/etc/categoryedit" Steam --delete >/dev/null "${DIRECTORY}/etc/categoryedit" Steam --delete >/dev/null
"${DIRECTORY}/etc/categoryedit" 'Chromium Widevine' --delete >/dev/null "${DIRECTORY}/etc/categoryedit" 'Chromium Widevine' --delete >/dev/null
"${DIRECTORY}/etc/categoryedit" 'Back to Chromium v78' --delete >/dev/null
echo "Finished hiding apps on TwisterOS." echo "Finished hiding apps on TwisterOS."
fi fi

Loading…
Cancel
Save