now using terminal-run script

pull/101/head
Botspot 4 years ago
parent d2a3b157ce
commit 7d37454bf1

@ -262,10 +262,10 @@ Or do you want one combined install script?" | yad --text-info --fontname=12 --w
--text="Now it"\'"s time to make your install-32 and install-64 scripts.
One of these scripts will be executed when somebody clicks you app"\'"s Install button.
Two text editors should have openened and you can create your scripts." \
--field="Run install-32 script":FBTN "x-terminal-emulator --title="\""Running install-32 script of $name"\"" -e "\""cd $HOME;$'${DIRECTORY}/apps/${name}/install-32';echo 'Closing in 10 seconds.';sleep 10"\" \
--field="Shellcheck install-32"!!'Having problems? This utility helps you locate syntax errors.':FBTN "x-terminal-emulator --title="\""Shellcheck"\"" -e "\""shellcheck $'${DIRECTORY}/apps/${name}/install-32';echo 'Press Enter to exit.';read enter"\" \
--field="Run install-64 script":FBTN "x-terminal-emulator --title="\""Running install-64 script of $name"\"" -e "\""cd $HOME;$'${DIRECTORY}/apps/${name}/install-64';echo 'Closing in 10 seconds.';sleep 10"\" \
--field="Shellcheck install-64"!!'Having problems? This utility helps you locate syntax errors.':FBTN "x-terminal-emulator --title="\""Shellcheck"\"" -e "\""shellcheck $'${DIRECTORY}/apps/${name}/install-64';echo 'Press Enter to exit.';read enter"\" \
--field="Run install-32 script":FBTN "${DIRECTORY}/etc/terminal-run "\""cd $HOME;$'${DIRECTORY}/apps/${name}/install-32';echo 'Closing in 10 seconds.';sleep 10"\"" "\""Running install-32 script of $name"\""" \
--field="Shellcheck install-32"!!'Having problems? This utility helps you locate syntax errors.':FBTN "${DIRECTORY}/etc/terminal-run "\""shellcheck $'${DIRECTORY}/apps/${name}/install-32';echo 'Press Enter to exit.';read enter"\"" "\""Shellcheck"\""" \
--field="Run install-64 script":FBTN "${DIRECTORY}/etc/terminal-run "\""cd $HOME;$'${DIRECTORY}/apps/${name}/install-64';echo 'Closing in 10 seconds.';sleep 10"\"" "\""Running install-64 script of $name"\""" \
--field="Shellcheck install-64"!!'Having problems? This utility helps you locate syntax errors.':FBTN "${DIRECTORY}/etc/terminal-run "\""shellcheck $'${DIRECTORY}/apps/${name}/install-64';echo 'Press Enter to exit.';read enter"\"" "\""Shellcheck"\""" \
--button=Previous!"${DIRECTORY}/icons/back.png":2 \
--button=Next!"${DIRECTORY}/icons/forward.png":0 \
2>/dev/null)"

@ -0,0 +1,19 @@
#!/bin/bash
#$1 is the command to be run.
#$2 is the title.
if [ -f /usr/bin/lxterminal ];then
lxterminal --title="$2" -e bash -c "$1"
elif [ -f /usr/bin/xfce4-terminal ];then
xfce4-terminal --title="$2" -e bash -c "$1"
elif [ -f /usr/bin/mate-terminal ];then
mate-terminal --title="$2" -e bash -c "$1"
elif [ -f /usr/bin/xterm ];then
xterm -title="$2" -e bash -c "$1"
elif [ -f /usr/bin/x-terminal-emulator ];then
$(readlink -f /usr/bin/x-terminal-emulator) -e bash -c "$1"
else
echo "Failed to locate any terminal emulators!!!"
exit 1
fi

28
gui

@ -22,7 +22,7 @@ hidelist="$(cat "${DIRECTORY}/data/hidelist" | sort | uniq | sed '/^[[:space:]]*
echo "$hidelist" > "${DIRECTORY}/data/hidelist"
) &
(if cat '~/.config/autostart/pi-apps-updater.desktop' | grep -q installedonly ;then
(if cat ~/.config/autostart/pi-apps-updater.desktop | grep -q installedonly ;then
"${DIRECTORY}/install"
fi) &
@ -31,15 +31,13 @@ install() {
#terminal title text
linecount="$(echo "$app" | wc -l)"
if [ $linecount -eq 1 ];then
title="$app"
title="Installing $app"
elif [ $linecount -le 4 ];then
title="$(echo "$app" | tr '\n' '|' | sed -i 's/|/, /g')"
title="Installing $(echo "$app" | tr '\n' '|' | sed -i 's/|/, /g')"
else
title="several apps"
title="Installing several apps"
fi
x-terminal-emulator --title="Installing $title" -e '
bash -c '\''
PATH="'"$PATH"'"
"${DIRECTORY}/etc/terminal-run" '
if "'"${DIRECTORY}/manage"'" multi-install "'"$app"'" ; then
echo -e "\nClosing in 30 seconds."
sleep 30
@ -47,8 +45,7 @@ install() {
echo -e "\nClose this window to exit."
read enter #technically you could press Enter to exit.
fi
'\''
'
' "$title"
sleep 1
while ps -C manage &>/dev/null;do sleep 0.1; done
}
@ -58,15 +55,13 @@ uninstall() {
#terminal title text
linecount="$(echo "$app" | wc -l)"
if [ $linecount -eq 1 ];then
title="$app"
title="Uninstalling $app"
elif [ $linecount -le 4 ];then
title="$(echo "$app" | tr '\n' '|' | sed -i 's/|/, /g')"
title="Uninstalling $(echo "$app" | tr '\n' '|' | sed -i 's/|/, /g')"
else
title="several apps"
title="Uninstalling several apps"
fi
x-terminal-emulator --title="Uninstalling $title" -e '
bash -c '\''
PATH="'"$PATH"'"
"${DIRECTORY}/etc/terminal-run" '
if "'"${DIRECTORY}/manage"'" multi-uninstall "'"$app"'" ; then
echo -e "\nClosing in 30 seconds."
sleep 30
@ -74,8 +69,7 @@ uninstall() {
echo -e "\nClose this window to exit."
read enter #technically you could press Enter to exit.
fi
'\''
'
' "$title"
sleep 1
while ps -C manage &>/dev/null;do sleep 0.1; done
}

@ -176,22 +176,20 @@ do
done
IFS="$PREIFS"
if [ ! -z "$updatable" ];then
x-terminal-emulator --title='Updating apps...' -e '
bash -c '\''
DIRECTORY="'"$DIRECTORY"'"
updatable="'"$updatable"'"
trap "sleep 10" EXIT
PREIFS="$IFS"
IFS="|"
for i in $updatable
do
"${DIRECTORY}/manage" update "$i" nofetch
echo -e "\e[92m${i} was updated successfully.\e[39m"
done
IFS="$PREIFS"
echo -e "\e[92mAll updates complete. Closing in 10 seconds.\e[39m"
'\''
'
"${DIRECTORY}/etc/terminal-run" '
DIRECTORY="'"$DIRECTORY"'"
updatable="'"$updatable"'"
trap "sleep 10" EXIT
PREIFS="$IFS"
IFS="|"
for i in $updatable
do
"${DIRECTORY}/manage" update "$i" nofetch
echo -e "\e[92m${i} was updated successfully.\e[39m"
done
IFS="$PREIFS"
echo -e "\e[92mAll updates complete. Closing in 10 seconds.\e[39m"
' 'Updating apps...'
fi
#.git folder
#move old .git folder to trash

Loading…
Cancel
Save