Add bash-based pi-apps terminal client and rename existing one to python

pull/884/head
Botspot 3 years ago
parent 4b8f88b4c6
commit 1f7d0de103

@ -0,0 +1 @@
Created and added to pi-apps by Itai-Nelken

@ -0,0 +1,17 @@
Pi-apps terminal is a script that lets you use pi-apps from the terminal, its written in bash.
It has all the commands you will ever need:
'install' - install a app available in pi-apps.
'remove' - uninstall a app installed by pi-apps (uninstall also works).
'multi-install' - install multiple apps.
'multi-remove' - uninstall multiple apps (multi-uninstall also works).
'list-all' - list all the apps in pi-apps (note that this will also list apps that are not available for your OS).
'list-installed' - list all the apps installed by pi-apps.
'list-uninstalled' - list all the uninstalled apps.
'list-corrupted' - list all the corrupted apps.
'search' - usage: search "search-term". search a app available in pi-apps (note that this will show results from the description of the 'apps as well as their name).
'website' - usage: website "app-name". print the website of a app available in pi-apps.
'update' - update all pi-apps components.
'update-apps' - update all pi-apps apps only.
'gui' - launch pi-apps regularly.
and it makes life easier by eliminating the use of quotes for apps with a space in their name (unless you are using 'multi-install' or 'multi-uninstall').

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,30 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
red="\e[31m"
normal="\e[0m"
function error() {
echo -e "${red}$1${normal}"
exit 1
}
#Removing existing /usr/local/bin/pi-apps and script
echo -n "removing existing version of the script..."
sudo rm -f /usr/local/bin/pi-apps
rm -f "${DIRECTORY}/pi-apps-terminal-bash-edition.sh"
echo "done"
#Download script
echo -n "Downloading script..."
wget https://raw.githubusercontent.com/Itai-Nelken/PiApps-terminal_bash-edition/main/pi-apps-terminal-bash-edition.sh -O "${DIRECTORY}/pi-apps-terminal-bash-edition.sh" || error "Failed to download pi-apps terminal bash edition script!"
echo "done"
chmod u+x "${DIRECTORY}/pi-apps-terminal-bash-edition.sh" || error "Failed to mark ${DIRECTORY}/pi-apps-terminal-bash-edition.sh as executable!"
#create launcher script
echo -n "creating launcher script..."
echo '#!/bin/bash
'"${DIRECTORY}"'/pi-apps-terminal-bash-edition.sh "$@"' | sudo tee /usr/local/bin/pi-apps >/dev/null || error "Failed to create pi-apps command in '/usr/local/bin/'!"
sudo chmod +x /usr/local/bin/pi-apps || error "Failed to make launcher script executable!"
echo "done"

@ -0,0 +1,17 @@
#!/bin/bash
#shellcheck disable=SC2145
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
red="\e[31m"
normal="\e[0m"
function error() {
echo -e "${red}$1${normal}"
exit 1
}
echo -n "removing the terminal command and the script..."
sudo rm -f /usr/local/bin/pi-apps || error "Failed to remove /usr/local/bin/pi-apps"
rm -f "$HOME/pi-apps/pi-apps-terminal-bash-edition.sh"
echo "done"

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

23
gui

@ -66,17 +66,25 @@ EOF
#remove old apps and migrate chromium downgrading apps to the new "Chromium Downgrade" app
runonce <<"EOF"
#rewrk chromium downgrading apps to one single new app: 'Downgrade Chromium'
rm -rf "${DIRECTORY}/apps/Back to Chromium v86"
rm -rf "${DIRECTORY}/apps/Back to Chromium v78"
if [ "$(cat "${DIRECTORY}/data/status/Back to Chromium v78" 2>/dev/null)" == installed ] || [ "$(cat "${DIRECTORY}/data/status/Back to Chromium v86" 2>/dev/null)" == installed ];then
echo "installed" > "${DIRECTORY}/data/status/Downgrade Chromium"
fi
rm -rf "${DIRECTORY}/apps/FreeCAD (precompiled)"
rm -rf "${DIRECTORY}/apps/Chromium Media Edition"
rm -rf "${DIRECTORY}/apps/Cordless"
rm -rf "${DIRECTORY}/apps/Retropie"
#rename 'Turbo Scratch' app to 'Turbowarp'
rm -rf "${DIRECTORY}/apps/Turbo Scratch"
mv -f "${DIRECTORY}/data/status/Turbo Scratch" "${DIRECTORY}/data/status/Turbowarp"
if [ "$(cat "${DIRECTORY}/data/status/Back to Chromium v78" 2>/dev/null)" == installed ] || [ "$(cat "${DIRECTORY}/data/status/Back to Chromium v86" 2>/dev/null)" == installed ];then
echo "installed" > "${DIRECTORY}/data/status/Downgrade Chromium"
fi
#rename 'Pi-Apps Terminal Plugin' app to 'Pi-Apps Terminal Plugin (python)'
mv -f "${DIRECTORY}/data/status/Pi-Apps Terminal Plugin" "${DIRECTORY}/data/status/Pi-Apps Terminal Plugin (python)"
EOF
#rename xlunch setting to xlunch-dark
@ -100,12 +108,18 @@ runonce <<"EOF"
fi
EOF
#ensure curl is installed
runonce <<"EOF"
if ! command -v curl >/dev/null ;then
sudo apt install -y curl
fi
EOF
#ensure curl is installed
runonce <<"EOF"
EOF
install() {
app="$1" #one app name per line
@ -183,7 +197,8 @@ while true;do
if [ "$guimode" == yad ];then
if [ -z "$prefix" ];then
buttons=("--button=!${DIRECTORY}/icons/install.png!Install:4" \
buttons=("--button=Search:4" \
"--button=!${DIRECTORY}/icons/install.png!Install:4" \
"--button=!${DIRECTORY}/icons/uninstall.png!Uninstall:2" \
"--button=!${DIRECTORY}/icons/info.png!View more about the selected software:0" )
else

Loading…
Cancel
Save