diff --git a/apps/Arduino/description b/apps/Arduino/description index c78b1de..775655d 100644 --- a/apps/Arduino/description +++ b/apps/Arduino/description @@ -1 +1,4 @@ Latest version of Arduino IDE. Not outdated like the repository's Arduino IDE. +Use this to flash your code to Arduino microprocessors. +To run: Menu -> Programming -> Arduino IDE. +To run in a terminal: /home/pi/arduino-1.8.13/arduino diff --git a/apps/Arduino/icon-24.png b/apps/Arduino/icon-24.png index 7b2e7a5..0dbf466 100644 Binary files a/apps/Arduino/icon-24.png and b/apps/Arduino/icon-24.png differ diff --git a/apps/Arduino/icon-64.png b/apps/Arduino/icon-64.png index ee385e3..2774b72 100644 Binary files a/apps/Arduino/icon-64.png and b/apps/Arduino/icon-64.png differ diff --git a/apps/Minecraft (Experimental)/description b/apps/Minecraft (Experimental)/description new file mode 100644 index 0000000..e101786 --- /dev/null +++ b/apps/Minecraft (Experimental)/description @@ -0,0 +1,3 @@ +Minecraft Java edition for the raspberry pi +Run with the menu bar shortcuut or with "java -jar /usr/share/minecraftjava/launcher.jar" +This installs the old Minecraft launcher so that MC can be launched properly with any version and Optifine. diff --git a/apps/Minecraft (Experimental)/icon-24.png b/apps/Minecraft (Experimental)/icon-24.png new file mode 100644 index 0000000..09cd2ed Binary files /dev/null and b/apps/Minecraft (Experimental)/icon-24.png differ diff --git a/apps/Minecraft (Experimental)/icon-64.png b/apps/Minecraft (Experimental)/icon-64.png new file mode 100644 index 0000000..435fe10 Binary files /dev/null and b/apps/Minecraft (Experimental)/icon-64.png differ diff --git a/apps/Minecraft (Experimental)/install b/apps/Minecraft (Experimental)/install new file mode 100755 index 0000000..c4a7836 --- /dev/null +++ b/apps/Minecraft (Experimental)/install @@ -0,0 +1,37 @@ +#!/bin/bash + +DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")" +function error { + echo -e "\e[31m$1\e[39m" + exit 1 +} + +#use the error function often! +#If a certain command is necessary for installation to continue, then add this to the end of it: +# || error 'reason' +#example below: + +#Download java and launcher +mkdir ~/Minecraft && cd ~/Minecraft && wget https://www.dropbox.com/s/2602i5d0h4kteex/setupMC.sh && chmod +x setupMC.sh && ./setupMC.sh || error 'Failed to download launcher!' + +#Move launcher to /usr/share/ +sudo mkdir /usr/share/minecraftjava && sudo mv launcher.jar /usr/share/minecraftjava/launcher.jar + +#Create desktop shortcut +echo "[Desktop Entry] +[Desktop Entry] +Version=1.0 +Type=Application +Name=Minecraft Launcher +Comment=3D block based sandbox game +Icon=/home/pi/pi-apps/apps/Minecraft\ \(Experimental\)/icon-64.png +Exec=java -jar /usr/share/minecraftjava/launcher.jar +Categories=Game;" > ~/.local/share/applications/minecraft.desktop + +sudo chmod +x ~/.local/share/applications/minecraft.desktop + +#Edit launcher profile +echo '' +echo 'This step requires manual work' +echo 'The luancher will now open. Please log in and follow the instructions at https://www.noxxtech.tk/minecraft-install#h.fpnon3xvmuoz' +java -jar /usr/share/minecraftjava/launcher.jar diff --git a/apps/Minecraft (Experimental)/uninstall b/apps/Minecraft (Experimental)/uninstall new file mode 100755 index 0000000..d56e093 --- /dev/null +++ b/apps/Minecraft (Experimental)/uninstall @@ -0,0 +1,16 @@ +#!/bin/bash + +DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")" +function error { + echo -e "\e[31m$1\e[39m" + exit 1 +} + +sudo rm ~/.local/share/applications/minecraft.desktop +sudo rm -r ~/.minecraft +sudo rm -r ~/Minecraft +sudo rm -r ~/lwjgl2arm32 +sudo rm -r ~/lwjgl3arm32 +sudo rm -r ~/lwjgl3arm64 +sudo rm -r ~/lwjgl2arm64 +sudo rm -r /usr/share/minecraftjava/ diff --git a/apps/Minecraft (Experimental)/website b/apps/Minecraft (Experimental)/website new file mode 100644 index 0000000..1bbca7a --- /dev/null +++ b/apps/Minecraft (Experimental)/website @@ -0,0 +1 @@ +https://www.noxxtech.tk/minecraft-install diff --git a/apps/Minecraft/description b/apps/Minecraft/description new file mode 100644 index 0000000..e101786 --- /dev/null +++ b/apps/Minecraft/description @@ -0,0 +1,3 @@ +Minecraft Java edition for the raspberry pi +Run with the menu bar shortcuut or with "java -jar /usr/share/minecraftjava/launcher.jar" +This installs the old Minecraft launcher so that MC can be launched properly with any version and Optifine. diff --git a/apps/Minecraft/icon-24.png b/apps/Minecraft/icon-24.png new file mode 100644 index 0000000..09cd2ed Binary files /dev/null and b/apps/Minecraft/icon-24.png differ diff --git a/apps/Minecraft/icon-64.png b/apps/Minecraft/icon-64.png new file mode 100644 index 0000000..435fe10 Binary files /dev/null and b/apps/Minecraft/icon-64.png differ diff --git a/apps/Minecraft/install b/apps/Minecraft/install new file mode 100755 index 0000000..01fa013 --- /dev/null +++ b/apps/Minecraft/install @@ -0,0 +1,31 @@ +#!/bin/bash + +DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")" +function error { + echo -e "\e[31m$1\e[39m" + exit 1 +} + +#use the error function often! +#If a certain command is necessary for installation to continue, then add this to the end of it: +# || error 'reason' +#example below: + +#Download java and launcher +mkdir ~/Minecraft && cd ~/Minecraft && wget https://www.dropbox.com/s/2602i5d0h4kteex/setupMC.sh && chmod +x setupMC.sh && ./setupMC.sh || error 'Failed to download launcher!' + +#Move launcher to /usr/share/ +sudo mkdir /usr/share/minecraftjava && sudo mv launcher.jar /usr/share/minecraftjava/launcher.jar + +#Create desktop shortcut +cd ~/.local/share/applications/ +wget https://raw.githubusercontent.com/mobilegmYT/pi-apps-resources/main/Minecraft/minecraft.desktop +cd + +sudo chmod +x ~/.local/share/applications/minecraft.desktop + +#Edit launcher profile +echo '' +echo 'This step requires manual work' +echo 'The luancher will now open. Please log in to the launcher with your MC account and follow the instructions at https://www.noxxtech.tk/minecraft-install#h.fpnon3xvmuoz' +java -jar /usr/share/minecraftjava/launcher.jar diff --git a/apps/Minecraft/uninstall b/apps/Minecraft/uninstall new file mode 100755 index 0000000..5413a58 --- /dev/null +++ b/apps/Minecraft/uninstall @@ -0,0 +1,16 @@ +#!/bin/bash + +DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")" +function error { + echo -e "\e[31m$1\e[39m" + exit 1 +} + +sudo rm -f ~/.local/share/applications/minecraft.desktop +sudo rm -rf ~/.minecraft +sudo rm -rf ~/Minecraft +sudo rm -rf ~/lwjgl2arm32 +sudo rm -rf ~/lwjgl3arm32 +sudo rm -rf ~/lwjgl3arm64 +sudo rm -rf ~/lwjgl2arm64 +sudo rm -rf /usr/share/minecraftjava/ diff --git a/apps/Minecraft/website b/apps/Minecraft/website new file mode 100644 index 0000000..1bbca7a --- /dev/null +++ b/apps/Minecraft/website @@ -0,0 +1 @@ +https://www.noxxtech.tk/minecraft-install diff --git a/createapp b/createapp index 1c07462..bdbcbac 100755 --- a/createapp +++ b/createapp @@ -10,7 +10,12 @@ function error { #step=1 #name=myapp -if [ -z "$step" ];then +#you can specify a preexisting app with variable 1 +if [ ! -z "$1" ];then + name="$1" + step=2 +else + name='' step=1 fi @@ -26,15 +31,26 @@ With a few simple steps, your project can take advantage of Pi-Apps"\'" features step=2 ;; 2) + if [ ! -z "$name" ];then namelocked='yes' + echo 'name field is already filled. Making it read-only.' fi + + if [ -f "${DIRECTORY}/apps/$name/icon-64.png" ];then + echo "icon already exists. Making icon field read-only." + iconfield="--field=Icon::RO apps/$name/icon-64.png" + else + echo 'icon does not exist.' + iconfield="--field=Icon::FL $HOME" + fi + output="$(yad --form \ --title="Create App: Step $step" --window-icon="${DIRECTORY}/icons/logo.png" --center --width=310 --height=300 \ --text="Step ${step}: enter some information. The name field is mandatory." \ --field="Name of app:$([ ! -z "$namelocked" ]&&echo ':RO')" "$name" \ --field="Website:" "$(cat "${DIRECTORY}/apps/${name}/website")" \ - --field="Icon:":FL --file-filter "Graphics Files | *.png *.svg *.jpg *.jpeg" "$icon" \ + $iconfield \ --field="Description:":TXT "$(cat "${DIRECTORY}/apps/${name}/description" || echo 'Short description on this first line. This will be the tooltip. Be sure to mention HOW TO RUN this app, both from the menu and from a terminal. Describe how to use this app, and any outstanding features it has. @@ -233,11 +249,12 @@ Here'\''s a preview of the Details window:' \ ;; 7) echo "Done! +You app is located at ${DIRECTORY}/apps/${name} To add your app to the Pi-Apps official repository, just open an issue for Botspot (the developer or Pi-Apps): https://github.com/Botspot/pi-apps/issues/new" | yad --text-info --fontname=12 --wrap --show-uri \ --image="${DIRECTORY}/icons/in-progress.png" --image-on-top \ --title="Create App Wizard" --window-icon="${DIRECTORY}/icons/logo.png" --center --width=310 --height=300 \ - --button=Previous!"${DIRECTORY}/icons/exit.png":0 \ - --button=Close!"${DIRECTORY}/icons/forward.png":1 || exit 0 + --button=Previous!"${DIRECTORY}/icons/back.png":0 \ + --button=Close!"${DIRECTORY}/icons/exit.png":1 || exit 0 step=6 ;; *) diff --git a/gui b/gui index b7a7319..4079673 100755 --- a/gui +++ b/gui @@ -100,7 +100,10 @@ $(echo "$(cat "${DIRECTORY}/apps/${output}/description" || echo "Description una #if already installed then no need to provide install button. And vice versa. whichbutton="$( - if [ -f "${DIRECTORY}/data/status/${output}" ];then + if [ -f "${DIRECTORY}/data/settings/show-edit-button" ];then + echo "--button=Edit!${DIRECTORY}/icons/edit.png:10" + fi + if [ ! -f "${DIRECTORY}/data/status/${output}" ];then #Taking a chance here. If status file is nonexistent, assume uninstalled. echo "--button=Install!${DIRECTORY}/icons/install.png:4" elif [ "$(cat "${DIRECTORY}/data/status/${output}")" == 'installed' ];then @@ -176,7 +179,9 @@ $(echo "$(cat "${DIRECTORY}/apps/${output}/description" || echo "Description una output="$(echo "$lsoutput" | sed -n "${newnumber}p")" echo "Line number was ${number}, but now is ${newnumber}. Name is ${output}." - + elif [ $button == 10 ];then + echo "edit $output" + "${DIRECTORY}/createapp" "$output" else echo 'unknown button. Going back.' #clear output var to prompt main window to open next diff --git a/icons/edit.png b/icons/edit.png new file mode 100644 index 0000000..985497f Binary files /dev/null and b/icons/edit.png differ diff --git a/settings b/settings new file mode 100755 index 0000000..e308747 --- /dev/null +++ b/settings @@ -0,0 +1,69 @@ +#!/bin/bash +DIRECTORY="$(readlink -f "$(dirname "$0")")" + +function error { + echo -e "\e[91m$1\e[39m" + exit 1 +} + +#ensure settings dir exists +mkdir -p "${DIRECTORY}/data/settings" + +settings='show-edit-button +update-always +reinstall-after-update +' + +tooltips='When viewing an App'\''s details, display an Edit button. Beware that updating will revert your edits. +Instead of checking for updates once a day, do an update check every time you launch Pi-Apps. +Before an update, the app will be uninstalled. If the app was installed oiginally, then install the new version automatically. +' +line=1 +for i in $settings +do + if [ -f "${DIRECTORY}/data/settings/${i}" ];then + truefalse='true' + else + truefalse='false' + fi + LIST="${LIST}${truefalse} +$(echo "$settings" | sed -n "${line}p" ) +$(echo "$tooltips" | sed -n "${line}p" ) +" + line=$((line+1)) +done +LIST="${LIST::-1}" +#echo "LIST: ${LIST}EOL" + +output="$(echo -e "$LIST" | yad --center --title='Pi-Apps Settings' --width=310 --height=300 --no-headers \ + --list --checklist --separator='\n' --window-icon="${DIRECTORY}/icons/logo.png" \ + --column=:CHK --column=Name --column=tip:HD --tooltip-column=3 --print-column=2 \ + --button='Create App':"${DIRECTORY}/createapp" \ + --button=Cancel!"${DIRECTORY}/icons/exit.png":1 \ + --button=Save!"${DIRECTORY}/icons/check.png":0 \ + 2>/dev/null)" + +button=$? #get exit code to determine which button was pressed +#exit if save was not clicked +[ $button -ne 0 ]&&exit 0 + +#reformat output var. Only lists items that have been enabled. +output="$(echo "$output" | sed '/^$/d') +" + +echo "Output: ${output}EOO" + +for i in $settings +do + #if output matches current setting + if [ ! -z "$(echo "$output" | grep -x "$i")" ];then + echo "$i is enabled" + #create file + echo '' > "${DIRECTORY}/data/settings/${i}" + else + echo "$i is disabled" + #delete file + rm -f "${DIRECTORY}/data/settings/${i}" + fi +done + diff --git a/update/pi-apps b/update/pi-apps deleted file mode 160000 index 6144ff1..0000000 --- a/update/pi-apps +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6144ff17a9dd1afc4fa8258e8f60df0f61f91d0e