now using terminal-run script

pull/101/head
Botspot 5 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. --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. 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." \ 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="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 "x-terminal-emulator --title="\""Shellcheck"\"" -e "\""shellcheck $'${DIRECTORY}/apps/${name}/install-32';echo 'Press Enter to exit.';read enter"\" \ --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 "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="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 "x-terminal-emulator --title="\""Shellcheck"\"" -e "\""shellcheck $'${DIRECTORY}/apps/${name}/install-64';echo 'Press Enter to exit.';read enter"\" \ --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=Previous!"${DIRECTORY}/icons/back.png":2 \
--button=Next!"${DIRECTORY}/icons/forward.png":0 \ --button=Next!"${DIRECTORY}/icons/forward.png":0 \
2>/dev/null)" 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" 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" "${DIRECTORY}/install"
fi) & fi) &
@ -31,15 +31,13 @@ install() {
#terminal title text #terminal title text
linecount="$(echo "$app" | wc -l)" linecount="$(echo "$app" | wc -l)"
if [ $linecount -eq 1 ];then if [ $linecount -eq 1 ];then
title="$app" title="Installing $app"
elif [ $linecount -le 4 ];then 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 else
title="several apps" title="Installing several apps"
fi fi
x-terminal-emulator --title="Installing $title" -e ' "${DIRECTORY}/etc/terminal-run" '
bash -c '\''
PATH="'"$PATH"'"
if "'"${DIRECTORY}/manage"'" multi-install "'"$app"'" ; then if "'"${DIRECTORY}/manage"'" multi-install "'"$app"'" ; then
echo -e "\nClosing in 30 seconds." echo -e "\nClosing in 30 seconds."
sleep 30 sleep 30
@ -47,8 +45,7 @@ install() {
echo -e "\nClose this window to exit." echo -e "\nClose this window to exit."
read enter #technically you could press Enter to exit. read enter #technically you could press Enter to exit.
fi fi
'\'' ' "$title"
'
sleep 1 sleep 1
while ps -C manage &>/dev/null;do sleep 0.1; done while ps -C manage &>/dev/null;do sleep 0.1; done
} }
@ -58,15 +55,13 @@ uninstall() {
#terminal title text #terminal title text
linecount="$(echo "$app" | wc -l)" linecount="$(echo "$app" | wc -l)"
if [ $linecount -eq 1 ];then if [ $linecount -eq 1 ];then
title="$app" title="Uninstalling $app"
elif [ $linecount -le 4 ];then 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 else
title="several apps" title="Uninstalling several apps"
fi fi
x-terminal-emulator --title="Uninstalling $title" -e ' "${DIRECTORY}/etc/terminal-run" '
bash -c '\''
PATH="'"$PATH"'"
if "'"${DIRECTORY}/manage"'" multi-uninstall "'"$app"'" ; then if "'"${DIRECTORY}/manage"'" multi-uninstall "'"$app"'" ; then
echo -e "\nClosing in 30 seconds." echo -e "\nClosing in 30 seconds."
sleep 30 sleep 30
@ -74,8 +69,7 @@ uninstall() {
echo -e "\nClose this window to exit." echo -e "\nClose this window to exit."
read enter #technically you could press Enter to exit. read enter #technically you could press Enter to exit.
fi fi
'\'' ' "$title"
'
sleep 1 sleep 1
while ps -C manage &>/dev/null;do sleep 0.1; done while ps -C manage &>/dev/null;do sleep 0.1; done
} }

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

Loading…
Cancel
Save