From 1f7d0de1034970e530dcb4ea996903d5cae299db Mon Sep 17 00:00:00 2001 From: Botspot Date: Tue, 10 Aug 2021 23:13:17 -0500 Subject: [PATCH] Add bash-based pi-apps terminal client and rename existing one to python --- apps/Pi-Apps Terminal Plugin (bash)/credits | 1 + .../description | 17 ++++++++++ .../icon-24.png | Bin 0 -> 1085 bytes .../icon-64.png | Bin apps/Pi-Apps Terminal Plugin (bash)/install | 30 ++++++++++++++++++ apps/Pi-Apps Terminal Plugin (bash)/uninstall | 17 ++++++++++ .../credits | 0 .../description | 0 .../icon-24.png | Bin .../icon-64.png | Bin 0 -> 1444 bytes .../install | 0 .../uninstall | 0 .../website | 0 gui | 23 +++++++++++--- 14 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 apps/Pi-Apps Terminal Plugin (bash)/credits create mode 100644 apps/Pi-Apps Terminal Plugin (bash)/description create mode 100644 apps/Pi-Apps Terminal Plugin (bash)/icon-24.png rename apps/{Pi-Apps Terminal Plugin => Pi-Apps Terminal Plugin (bash)}/icon-64.png (100%) create mode 100755 apps/Pi-Apps Terminal Plugin (bash)/install create mode 100755 apps/Pi-Apps Terminal Plugin (bash)/uninstall rename apps/{Pi-Apps Terminal Plugin => Pi-Apps Terminal Plugin (python)}/credits (100%) rename apps/{Pi-Apps Terminal Plugin => Pi-Apps Terminal Plugin (python)}/description (100%) rename apps/{Pi-Apps Terminal Plugin => Pi-Apps Terminal Plugin (python)}/icon-24.png (100%) create mode 100644 apps/Pi-Apps Terminal Plugin (python)/icon-64.png rename apps/{Pi-Apps Terminal Plugin => Pi-Apps Terminal Plugin (python)}/install (100%) rename apps/{Pi-Apps Terminal Plugin => Pi-Apps Terminal Plugin (python)}/uninstall (100%) rename apps/{Pi-Apps Terminal Plugin => Pi-Apps Terminal Plugin (python)}/website (100%) diff --git a/apps/Pi-Apps Terminal Plugin (bash)/credits b/apps/Pi-Apps Terminal Plugin (bash)/credits new file mode 100644 index 0000000..4797bdf --- /dev/null +++ b/apps/Pi-Apps Terminal Plugin (bash)/credits @@ -0,0 +1 @@ +Created and added to pi-apps by Itai-Nelken diff --git a/apps/Pi-Apps Terminal Plugin (bash)/description b/apps/Pi-Apps Terminal Plugin (bash)/description new file mode 100644 index 0000000..3aa3de6 --- /dev/null +++ b/apps/Pi-Apps Terminal Plugin (bash)/description @@ -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'). diff --git a/apps/Pi-Apps Terminal Plugin (bash)/icon-24.png b/apps/Pi-Apps Terminal Plugin (bash)/icon-24.png new file mode 100644 index 0000000000000000000000000000000000000000..9bf164fe3812dabe9e4f2c5bc39673baf532e8c9 GIT binary patch literal 1085 zcmV-D1j74?P)05UK#F)c7NEif`vFgH3hHaasoD=;-W zFfh|U7H0qe03~!qSaf7zbY(hiZ)9m^c>ppnGBGVMGc7POR4_L>G&VXjFe@-MIxsLd z`s)Y)00WIlL_t(YiM5u`YhzUu$3O2!(!9ROYts&vPK^?~7+RgtAtklciX) zLSYtxZVJ+ZqR@7sAZQ^}nU&xabR{lj7UHid#R`g8L4*NECPvd~J57^@=H=zMxUWfG zOs9x?;2Z9{-*fNzanC(B01ogvkOkyFLe}52OY;Y>02U`nXaKsN10$xsy*=2!4sI5- zFhnnd^)R4;RH5_@ls3yydlTUHJ-yLwA@QM*tO-f+Q4A_q92{hFa*{+MK`0brZf=fTF6V0=XRDpme4NB7*B0~nJo$W{ ziHQkPsTA>eob~l}ip8SZ+_?;qhg6o1QQCw%?}OP7&a9%_eB{#lI=K7&8rg351j^b5GZL*+Iceg~y*Vf#JU z{}k{7IS|{nWo>OuL`2HvvZT}Lri#)83?Evs(#*3$=Ov*tDOeW;!)fN#ARG?M{QSHW z3I(ZDDw4@$Bo>REeyKV~g!Ajdqj?{H3WJ{r;dsM9BodK@g#{@Vi{iSjtgNhv<2a{p z4#NF!3nLP|2T4yjdqn^-0fvW%NvG3vbaar(WLR2SqEILRFg7;E^z<|$!AjCJjoH~* z;7pqe(!uDee~DojGBYzH%gf6WjYb0=PEAdT>$+_L2m@E!L?A-n%fT}+3`0Vp&_8c% z=iUe!7!e`q3cW8jQUu_69-im53HKD){Q#^XurA_X0yy|WHA8=)@` zUS@;YqjbcB>K%|Hz;6|3VTesa^eO6nr~Cu#tbunItP9Zl5*R&xxVx}(4az@)(G9)R zjR?ep;+L@ZF-XNX5PcdRco)oA!z-yOFL$m%{2g$f2?o@832siR&EqSh9g5 literal 0 HcmV?d00001 diff --git a/apps/Pi-Apps Terminal Plugin/icon-64.png b/apps/Pi-Apps Terminal Plugin (bash)/icon-64.png similarity index 100% rename from apps/Pi-Apps Terminal Plugin/icon-64.png rename to apps/Pi-Apps Terminal Plugin (bash)/icon-64.png diff --git a/apps/Pi-Apps Terminal Plugin (bash)/install b/apps/Pi-Apps Terminal Plugin (bash)/install new file mode 100755 index 0000000..67c3d70 --- /dev/null +++ b/apps/Pi-Apps Terminal Plugin (bash)/install @@ -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" diff --git a/apps/Pi-Apps Terminal Plugin (bash)/uninstall b/apps/Pi-Apps Terminal Plugin (bash)/uninstall new file mode 100755 index 0000000..2efc4f9 --- /dev/null +++ b/apps/Pi-Apps Terminal Plugin (bash)/uninstall @@ -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" diff --git a/apps/Pi-Apps Terminal Plugin/credits b/apps/Pi-Apps Terminal Plugin (python)/credits similarity index 100% rename from apps/Pi-Apps Terminal Plugin/credits rename to apps/Pi-Apps Terminal Plugin (python)/credits diff --git a/apps/Pi-Apps Terminal Plugin/description b/apps/Pi-Apps Terminal Plugin (python)/description similarity index 100% rename from apps/Pi-Apps Terminal Plugin/description rename to apps/Pi-Apps Terminal Plugin (python)/description diff --git a/apps/Pi-Apps Terminal Plugin/icon-24.png b/apps/Pi-Apps Terminal Plugin (python)/icon-24.png similarity index 100% rename from apps/Pi-Apps Terminal Plugin/icon-24.png rename to apps/Pi-Apps Terminal Plugin (python)/icon-24.png diff --git a/apps/Pi-Apps Terminal Plugin (python)/icon-64.png b/apps/Pi-Apps Terminal Plugin (python)/icon-64.png new file mode 100644 index 0000000000000000000000000000000000000000..d32160082fe1b9d2ba9299cb7cea6b94f14d993a GIT binary patch literal 1444 zcmb_ado?_b~jJT%x>gT|x*(D3(T zg)4Bw->XVi-0F78lme8Kd^kS9*<$sNu@nV2iSrBR06A8GxB!?}NaE+frvxx50Ng8p zWx{VSg?Rv^i=jbWw!-lL49yuv6|lbt<4Vw6pdALY)3E*-%zP;8KsOmKa_H`Y(Gd`@ zK=**AAG89&6obrwRVS>kf~*M=6-snamP5q=Iy^f&JF!?iJUlFy%Ow&?VPPSZ^*~`l zCt50%g0{M(qyz?17!<+gdRbW+NEFyygH0dQ*TLysRaF(p8ZfPcX#>dGU`lFhYe6*y zBLWOAs20!)0$HoRzP_=sF*i3CloinMfhH?EI~(TBaCj^diJ)o&#|h{k5(~CDX|Oz z8neV_X(82;6?*q@PU(iDlHS8R)RqU*zfjfF(QVC|>XdD7mGP$r1~gqV_ar5p<7Gd( z=yxnP^GcTMke2CcX5uZCo@DwOZ6i)>gsar;)-Pk>HPxG?3m@kfkm(?Pw@`PsW6883 zFVMo!wrt?e*c;W9;kojJ`seZ6$}PrUb1OqOGUczEbSRC@p(l9lmJTLG%?Fvv0#IH)v{ZOm*P$vGeLNjdk*=ku{L&)>3wl-djGgl1p~> ztWRiGzgyX%&e$`=O2m?{^#Mq|jphJ@; z+FJ71nvdqb#rGM1LMYGZ+&9(BH9j`gi^6Rn#ocHT2cGY-|EUr4I zw?y1BNv}G=bmw)2aX#y?8Z>AYKbw6ZvB+xf~>r#vf&GwKtXi zk(K2zemApEnLq#Clyq;|zPEGQ7bdS+`n;=asI=MFoE5dL#>TOIQ0rvxfBTi*k~D z9o{F!YNjgcY$;+#iQ;2L3GQ*b6BGbv!r94zaB(1b34JZuZ0)cY+x5)=T/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