-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/bash | ||
|
||
# Title: quickfzf | ||
# Author: zenobit | ||
# Description: Uses fzf to provide a simple GUI for quickemu and quickget | ||
# script must be in same directory as quickget and quickemu! | ||
# License MIT | ||
# | ||
|
||
# required | ||
if [ ! -f /usr/bin/fzf ]; then | ||
echo "You are missing fzf..." | ||
exit 255 | ||
fi | ||
|
||
echo "Press ctrl + c anytime for killing script..." | ||
|
||
progname="${progname:="${0##*/}"}" | ||
|
||
todo=$(echo "Run created VM | ||
Create new VM" | fzf) | ||
|
||
if [ "$todo" = "Create new VM" ]; then | ||
#os=$(cat quickget | grep 'PRETTY' | cut -d')' -f1 | sed 1d | cut -d'*' -f1 | cut -d'"' -f3 | grep -o '[^ ]*' | fzf) | ||
os=$(quickget | sed 1d | cut -d':' -f2 | grep -o '[^ ]*' | fzf) | ||
if [ "$os" = windows ]; then | ||
answer=$(echo "Default English | ||
Choose other language" | fzf) | ||
if [ "$answer" = "Choose other language" ]; then | ||
release=$(echo "8 | ||
10 | ||
11" | fzf) | ||
wlstart=$(cat quickget | grep -n '(A' | cut -d':' -f1) | ||
wlend=$(($(cat quickget | sed '/Arabic/,$!d' | grep -n '}' | cut -d':' -f1 | head -n 1) - 1)) | ||
wlang=$(cat quickget | sed '/Arabic/,$!d' | head -n $wlend | cut -d'=' -f2 | tail -c +2 | head -c -2 | sed 's/^[ \t]*//' | fzf) | ||
quickget "windows" "$release" "$wlang" | ||
fi | ||
fi | ||
|
||
choices=$(quickget "$os" | sed 1d) | ||
if [ $(echo "$choices" | wc -l) = 1 ]; then | ||
release=$(echo "$choices" | grep 'Releases' | cut -d':' -f2 | grep -o '[^ ]*' | fzf) | ||
quickget "$os" "$release" | ||
else | ||
release=$(echo "$choices" | grep 'Releases' | cut -d':' -f2 | grep -o '[^ ]*' | fzf) | ||
edition=$(echo "$choices" | grep 'Editions' | cut -d':' -f2 | grep -o '[^ ]*' | fzf) | ||
quickget "$os" "$release" "$edition" | ||
fi | ||
|
||
else | ||
choosed=$(echo "$(ls *.conf)" | fzf) | ||
quickemu -vm "$choosed" | ||
fi | ||
|
||
exit 0 |