gui: fix terminal title when installing 2-3 apps

pull/651/head
Botspot 5 years ago
parent edc867ba7e
commit 7de90b3b30

12
gui

@ -120,13 +120,14 @@ runonce "
source "${DIRECTORY}/api" source "${DIRECTORY}/api"
install() { install() {
app="$1" app="$1" #one app name per line
#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="Installing $app" title="Installing $app"
elif [ $linecount -le 4 ];then elif [ $linecount -lt 4 ];then
title="Installing $(echo "$app" | tr '\n' '|' | sed -i 's/|/, /g')" title="Installing $(echo -n "$app" | tr '\n' '|' | sed 's/|/, /g')"
else else
title="Installing several apps" title="Installing several apps"
fi fi
@ -147,13 +148,14 @@ install() {
} }
uninstall() { uninstall() {
app="$1" app="$1" #one app name per line
#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="Uninstalling $app" title="Uninstalling $app"
elif [ $linecount -le 4 ];then elif [ $linecount -le 4 ];then
title="Uninstalling $(echo "$app" | tr '\n' '|' | sed -i 's/|/, /g')" title="Uninstalling $(echo -n "$app" | tr '\n' '|' | sed 's/|/, /g')"
else else
title="Uninstalling several apps" title="Uninstalling several apps"
fi fi

Loading…
Cancel
Save