mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
update get windows function
removed option to choose language quickemu 4.8
This commit is contained in:
parent
b8bf944f2e
commit
9d0bf661c5
1 changed files with 28 additions and 45 deletions
73
quickfzf
73
quickfzf
|
@ -16,11 +16,11 @@ trap "exit" EXIT
|
||||||
|
|
||||||
# Dependency check: check if fzf is installed and can be executed
|
# Dependency check: check if fzf is installed and can be executed
|
||||||
if ! command -v fzf >/dev/null 2>&1; then
|
if ! command -v fzf >/dev/null 2>&1; then
|
||||||
echo "You are missing fzf..." && exit 255
|
echo "You are missing fzf..." && exit 255
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v quickemu >/dev/null 2>&1; then
|
if ! command -v quickemu >/dev/null 2>&1; then
|
||||||
echo "You are missing quickemu..." && exit 255
|
echo "You are missing quickemu..." && exit 255
|
||||||
fi
|
fi
|
||||||
|
|
||||||
QUICKGET=$(command -v quickget) || exit 255
|
QUICKGET=$(command -v quickget) || exit 255
|
||||||
|
@ -29,9 +29,9 @@ QUICKGET=$(command -v quickget) || exit 255
|
||||||
printf '%s: v.%s\nquickemu: v.%s\n' "$progname" "$version" "$(quickemu --version)"
|
printf '%s: v.%s\nquickemu: v.%s\n' "$progname" "$version" "$(quickemu --version)"
|
||||||
if [ -z "$EDITOR" ]
|
if [ -z "$EDITOR" ]
|
||||||
then
|
then
|
||||||
echo "editor: Not set! edit configs will not work!"
|
echo "editor: Not set! edit configs will not work!"
|
||||||
else
|
else
|
||||||
echo "editor: $EDITOR"
|
echo "editor: $EDITOR"
|
||||||
fi
|
fi
|
||||||
printf '\n Workdir: %s\n\n Prepared VMs:\n-------------\n' "$(pwd)"
|
printf '\n Workdir: %s\n\n Prepared VMs:\n-------------\n' "$(pwd)"
|
||||||
|
|
||||||
|
@ -53,51 +53,34 @@ printf " Do you want to create a new VM? (c)
|
||||||
or run an existing one? (press anything)\n"
|
or run an existing one? (press anything)\n"
|
||||||
read -rn 1 -s start
|
read -rn 1 -s start
|
||||||
case $start in
|
case $start in
|
||||||
c ) todo="create";;
|
c ) todo="create";;
|
||||||
e ) todo="edit";;
|
e ) todo="edit";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If the user chose to create a new VM
|
# If the user chose to create a new VM
|
||||||
if [ "$todo" = "create" ]; then
|
if [ "$todo" = "create" ]; then
|
||||||
os=$(quickget | sed 1d | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose OS to download')
|
os=$(quickget | sed 1d | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose OS to download')
|
||||||
# If the OS is Windows
|
fi
|
||||||
if [ "$os" = windows ]; then
|
|
||||||
answer=$(echo "Default English
|
# Get the release and edition to download, if necessary
|
||||||
Choose other language" | fzf --cycle)
|
choices=$(quickget "$os" | sed 1d)
|
||||||
# If the user wants another windows language
|
if [ "$todo" = "edit" ]; then
|
||||||
if [ "$answer" = "Choose other language" ]; then
|
editconfig=$(ls | grep '.conf' | fzf --cycle --header='Choose config to edit')
|
||||||
wrelease=$(echo "8
|
"$EDITOR" "$editconfig"
|
||||||
10
|
elif [ "$(echo "$choices" | wc -l)" = 1 ]; then
|
||||||
11" | fzf --cycle)
|
# get release
|
||||||
# get window language list
|
release=$(echo "$choices" | grep 'Releases' | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose Release')
|
||||||
wlend=$(($(cat $QUICKGET | sed '/Arabic/,$!d' | grep -n '}' | cut -d':' -f1 | head -n 1) - 1))
|
# downloading
|
||||||
# get windows language
|
printf '\n Trying to download %s %s...\n\n' "$os" "$release"
|
||||||
wlang=$(cat $QUICKGET | sed '/Arabic/,$!d' | head -n $wlend | cut -d'=' -f2 | tail -c +2 | head -c -2 | sed 's/^[ \t]*//' | fzf --cycle --header='Choose Language')
|
quickget "$os" "$release"
|
||||||
# downloading windows
|
else
|
||||||
printf '\n Trying to download Windows %s %s...\n\n' "$wrelease" "$wlang"
|
# get release
|
||||||
quickget "windows" "$wrelease" "$wlang"
|
release=$(echo "$choices" | grep 'Releases' | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose Release')
|
||||||
fi
|
# get edition
|
||||||
fi
|
edition=$(echo "$choices" | grep 'Editions' | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose Edition')
|
||||||
# Get the release and edition to download, if necessary
|
# downloading
|
||||||
choices=$(quickget "$os" | sed 1d)
|
printf '\n Trying to download %s %s %s...\n\n' "$os" "$release" "$edition"
|
||||||
if [ "$(echo "$choices" | wc -l)" = 1 ]; then
|
quickget "$os" "$release" "$edition"
|
||||||
# get release
|
|
||||||
release=$(echo "$choices" | grep 'Releases' | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose Release')
|
|
||||||
# downloading
|
|
||||||
printf '\n Trying to download %s %s...\n\n' "$os" "$release"
|
|
||||||
quickget "$os" "$release"
|
|
||||||
else
|
|
||||||
# get release
|
|
||||||
release=$(echo "$choices" | grep 'Releases' | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose Release')
|
|
||||||
# get edition
|
|
||||||
edition=$(echo "$choices" | grep 'Editions' | cut -d':' -f2 | grep -o '[^ ]*' | fzf --cycle --header='Choose Edition')
|
|
||||||
# downloading
|
|
||||||
printf '\n Trying to download %s %s %s...\n\n' "$os" "$release" "$edition"
|
|
||||||
quickget "$os" "$release" "$edition"
|
|
||||||
fi
|
|
||||||
elif [ "$todo" = "edit" ]; then
|
|
||||||
editconfig=$(ls | grep '.conf' | fzf --cycle --header='Choose config to edit')
|
|
||||||
"$EDITOR" "$editconfig"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# choose VM to run
|
# choose VM to run
|
||||||
|
|
Loading…
Reference in a new issue