mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	indent with tab only
This commit is contained in:
		
							parent
							
								
									9569c4a3e8
								
							
						
					
					
						commit
						3b0f841f41
					
				
					 1 changed files with 41 additions and 41 deletions
				
			
		
							
								
								
									
										82
									
								
								dh
									
										
									
									
									
								
							
							
						
						
									
										82
									
								
								dh
									
										
									
									
									
								
							|  | @ -28,36 +28,36 @@ if ! command -v yad >/dev/null 2>&1; then | ||||||
| fi | fi | ||||||
| # run TUI instead | # run TUI instead | ||||||
| if [ "$1" = "-t" ] ; then | if [ "$1" = "-t" ] ; then | ||||||
|     printf '%s: v.%s\nquickemu: v.%s\n\n VMs dir: %s\n\n' "$progname" "$version" "$(quickemu --version)" "$(pwd)" | 	printf '%s: v.%s\nquickemu: v.%s\n\n VMs dir: %s\n\n' "$progname" "$version" "$(quickemu --version)" "$(pwd)" | ||||||
|     vms=(*.conf) | 	vms=(*.conf) | ||||||
|     # 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 | ||||||
|     printf ' Prepared VMs:\n-------------\n\n' | 	printf ' Prepared VMs:\n-------------\n\n' | ||||||
|     # Check if there are any VMs | 	# Check if there are any VMs | ||||||
|     if [ ${#vms[@]} -eq 0 ]; then | 	if [ ${#vms[@]} -eq 0 ]; then | ||||||
|         echo "No VMs found." | 		echo "No VMs found." | ||||||
|         exit 1 | 		exit 1 | ||||||
|     fi | 	fi | ||||||
|     # Print the names of the available VMs | 	# Print the names of the available VMs | ||||||
|     printf "%s\n" "${vms[@]%.*}" | 	printf "%s\n" "${vms[@]%.*}" | ||||||
|     echo "-------------" | 	echo "-------------" | ||||||
|     # Action prompt | 	# Action prompt | ||||||
|     printf " Do you want to create a new VM? (c) | 	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 ) | 		c ) | ||||||
|             todo="create" | 			todo="create" | ||||||
|         ;; | 		;; | ||||||
|     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 | ||||||
|  or CTRL-c or ESC to quit') |  or CTRL-c or ESC to quit') | ||||||
|     # If the OS is Windows | 	# If the OS is Windows | ||||||
|     if [ "$os" = windows ]; then | 	if [ "$os" = windows ]; then | ||||||
| 		answer=$(echo "Default English | 		answer=$(echo "Default English | ||||||
| Choose other language" | fzf --cycle) | Choose other language" | fzf --cycle) | ||||||
| 		# If the user wants another windows language | 		# If the user wants another windows language | ||||||
|  | @ -95,21 +95,21 @@ Choose other language" | fzf --cycle) | ||||||
| 		printf '\n Trying to download %s %s %s...\n\n' "$os" "$release" "$edition" | 		printf '\n Trying to download %s %s %s...\n\n' "$os" "$release" "$edition" | ||||||
| 		quickget "$os" "$release" "$edition" | 		quickget "$os" "$release" "$edition" | ||||||
| 	fi | 	fi | ||||||
|     # choose VM to run | 	# choose VM to run | ||||||
|     choosed=$(echo "$(ls ./***.conf 2>/dev/null | sed 's/\.conf$//')" | fzf --cycle --header='Choose VM to run | 	choosed=$(echo "$(ls ./***.conf 2>/dev/null | sed 's/\.conf$//')" | fzf --cycle --header='Choose VM to run | ||||||
|  or CTRL-c or ESC to quit') |  or CTRL-c or ESC to quit') | ||||||
|     # Run choosed VM | 	# Run choosed VM | ||||||
|     printf '\n Starting %s...\n\n' "$choosed" | 	printf '\n Starting %s...\n\n' "$choosed" | ||||||
|     quickemu -vm "$choosed.conf" | 	quickemu -vm "$choosed.conf" | ||||||
| fi | fi | ||||||
| else | else | ||||||
|     # run GUI | 	# run GUI | ||||||
|     key=$((RANDOM % 9000 + 1000)) | 	key=$((RANDOM % 9000 + 1000)) | ||||||
|     GTK_THEME="alt-dialog" | 	GTK_THEME="alt-dialog" | ||||||
|     yad --plug="$key" --tabnum=1 --monitor --icons --listen --read-dir="$CONFIG_DIR"/ready --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 & | 	yad --plug="$key" --tabnum=1 --monitor --icons --listen --read-dir="$CONFIG_DIR"/ready --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 & | ||||||
|     yad --plug="$key" --tabnum=2 --monitor --icons --listen --read-dir="$CONFIG_DIR"/supported --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 & | 	yad --plug="$key" --tabnum=2 --monitor --icons --listen --read-dir="$CONFIG_DIR"/supported --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 & | ||||||
|     yad --plug="$key" --tabnum=3 --monitor --icons --listen --read-dir="$CONFIG_DIR" --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 & | 	yad --plug="$key" --tabnum=3 --monitor --icons --listen --read-dir="$CONFIG_DIR" --sort-by-name --no-buttons --borders=0 --icon-size=48 --item-width=76 & | ||||||
|     yad --dynamic --notebook --key="$key" --monitor --window-icon="$ICON_DIR"/hop.svg --width=900 --height=800 --title="DistroHopper $version" --listen --no-buttons --tab="run VM" --tab="download VM" --tab="settings" | 	yad --dynamic --notebook --key="$key" --monitor --window-icon="$ICON_DIR"/hop.svg --width=900 --height=800 --title="DistroHopper $version" --listen --no-buttons --tab="run VM" --tab="download VM" --tab="settings" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| exit 0 | exit 0 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue