23 lines
		
	
	
		
			502 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			502 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
if [ "$#" -ne 5 ]; then
 | 
						|
  echo "Usage: $0 <source> <target> <new_bg> <new_fg> <new_shadow>"
 | 
						|
  echo "Example: $0 wall.svg wall.repainted.svg 073642 B58900 586E75"
 | 
						|
  exit 1
 | 
						|
fi
 | 
						|
 | 
						|
sourceFile=$1
 | 
						|
targetFile=$2
 | 
						|
new_bg=$3
 | 
						|
new_fg=$4
 | 
						|
new_shadow=$5
 | 
						|
 | 
						|
cp $sourceFile $targetFile
 | 
						|
 | 
						|
sed -i "s/#222222/#$new_bg/g" "$targetFile"
 | 
						|
sed -i "s/#444444/#$new_fg/g" "$targetFile"
 | 
						|
sed -i "s/#262626/#$new_shadow/g" "$targetFile"
 | 
						|
 | 
						|
echo "Colors replaced"
 | 
						|
echo "$targetFile: bg=$new_bg, fg=$new_fg, shadow=$new_shadow"
 |