Compare commits

..

2 Commits

Author SHA1 Message Date
He4eT
7ea5f53bc5 Update README.md 2025-03-28 16:29:09 +01:00
He4eT
97af5c061f replace_colors: add target 2025-03-28 16:28:39 +01:00
2 changed files with 16 additions and 15 deletions

View File

@ -6,10 +6,8 @@ Customisable SVG wallpaper with Decentrala logo.
You could replace all the colors with `replace_colors.sh`. You could replace all the colors with `replace_colors.sh`.
Initial colors are hardcoded, so it's one time trick.
For the second attempt do not forget to revert initial colors:
``` ```
git restore wall.svg ./replace_colors.sh wall.svg wall.repainted.svg 073642 B58900 586E75"
``` ```
## Initial colors ## Initial colors

View File

@ -1,19 +1,22 @@
#!/bin/bash #!/bin/bash
if [ "$#" -ne 4 ]; then if [ "$#" -ne 5 ]; then
echo "Usage: $0 <filename> <new_bg> <new_fg> <new_shadow>" echo "Usage: $0 <source> <target> <new_bg> <new_fg> <new_shadow>"
echo "" echo "Example: $0 wall.svg wall.repainted.svg 073642 B58900 586E75"
echo "Example: $0 wall.svg 073642 B58900 586E75"
exit 1 exit 1
fi fi
filename=$1 sourceFile=$1
new_bg=$2 targetFile=$2
new_fg=$3 new_bg=$3
new_shadow=$4 new_fg=$4
new_shadow=$5
sed -i "s/#222222/#$new_bg/g" "$filename" cp $sourceFile $targetFile
sed -i "s/#444444/#$new_fg/g" "$filename"
sed -i "s/#262626/#$new_shadow/g" "$filename"
echo "Colors replaced in $filename: bg=$new_bg, fg=$new_fg, shadow=$new_shadow" 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"