You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
		
		
			
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
| 
								 
											5 years ago
										 
									 | 
							
								#!/bin/bash
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function error {
							 | 
						||
| 
								 | 
							
								  echo -e "\\e[91m$1\\e[39m"
							 | 
						||
| 
								 | 
							
								  exit 1
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								"${DIRECTORY}/pkg-install" "libsdl2-mixer-2.0 libsdl2-ttf-2.0" "$(dirname "$0")" || exit 1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								mkdir ~/.fheroes2
							 | 
						||
| 
								 | 
							
								cd ~/.fheroes2
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# rename existing files to lower case
							 | 
						||
| 
								 | 
							
								for i in $( ls | grep [A-Z] ); do mv -f $i `echo $i | tr 'A-Z' 'a-z'`; done
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if [ ! -e data ]; then
							 | 
						||
| 
								 | 
							
								    echo No game content detected, downloading shareware version
							 | 
						||
| 
								 | 
							
								    wget -q --show-progress https://archive.org/download/HeroesofMightandMagicIITheSuccessionWars_1020/h2demo.zip
							 | 
						||
| 
								 | 
							
								    unzip h2demo.zip
							 | 
						||
| 
								 | 
							
								    rm h2demo.zip
							 | 
						||
| 
								 | 
							
								fi
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								wget -N -q --show-progress https://github.com/dimag0g/fheroes2/releases/download/0.9.1-switch/fheroes2-rpi # || error "failed to download the executable!"
							 | 
						||
| 
								 | 
							
								chmod a+x fheroes2-rpi
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								echo "[Desktop Entry]
							 | 
						||
| 
								 | 
							
								Name=Free Heroes 2
							 | 
						||
| 
								 | 
							
								Comment=Fheroes2 source port of Heroes of Might and Magic II
							 | 
						||
| 
								 | 
							
								Exec=$HOME/.fheroes2/fheroes2-rpi
							 | 
						||
| 
								 | 
							
								Icon=$(dirname "$0")/icon-64.png
							 | 
						||
| 
								 | 
							
								Terminal=true
							 | 
						||
| 
								 | 
							
								Type=Application
							 | 
						||
| 
								 | 
							
								Categories=Game;
							 | 
						||
| 
								 | 
							
								StartupNotify=false
							 | 
						||
| 
								 | 
							
								" > ~/.local/share/applications/fheroes2.desktop || error "Failed to create menu entry!"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								exit 0
							 |