Edit: Non functional changes. Lookafeel…
Color Your Mabox 3D Logo!
Only for entertainment purposes — just a playful way to experiment with recoloring the Mabox 3D logo.
@napcok is cooking up something more advanced and polished — but in the meantime, this little script was made just for fun. It offers a simple, visual way to tweak the colors of the SVG-based 3D Mabox logo using yad, ImageMagick.
About the SVG
This is a static SVG file containing a 3D-style version of the Mabox logo. Since SVG files can have wildly different internal structures, the script is written specifically for this version — no guarantees it’ll work with others.
Make sure to save the SVG file as:
~/.icons/mb-logo-3d.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1350"
height="1404.5"
version="1.1"
viewBox="0 0 1350 1404.5"
id="svg154"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs154" />
<style
id="style1">.measure-arrow
{
}
.measure-label
{
}
.measure-line
{
}</style>
<g
transform="translate(7.4904,11.012)"
id="g4">
<path
d="m 42.16,247.16 71.719,726.26 551.61,364.66 554.16,-367.41 65.029,-726.18 -616.27,-204.02 z"
fill="#EEDADA"
id="path3" />
<path
d="M 113.61,974.19 C 96.839,818.54 94.397,795.35 41.584,246.13 l 626.71,-206.28 623.29,202.78 -69.336,733.18 -557.89,368.76 z M 640.57,536.98 C 637.3278,534.2132 57.87,269.13 57.19,270.1 c 0,0 43.103,463.12 65.154,694.62 175.89,115.17 351.35,231.05 526.95,346.68 z m -174.46,613.76 c 0,0 -12.32,-302.85 -17.326,-453.86 l -39.155,-17.644 13.867,443.04 c -1.8417,-0.5414 -123.63,-79.894 -123.63,-79.894 l -28.113,-427.64 -31.494,-14.84 23.964,415.01 c 0.13363,2.314 -112.08,-69.499 -112.15,-70.137 l -58.895,-604.94 503.76,235.5 c 0,0 4.7585,663.97 4.0552,663.58 z m 742.27,-183.77 64.614,-691.09 c 0,-0.0294 -588.8,263.04 -588.8,263.04 0,0 -2.2797,771.42 0.44375,772.48 z M 732.03,575.54 1234.89,343.17 c 0,0 -33.266,401.95 -51.188,602.78 -39.452,21.937 -116.5,70.803 -116.5,70.803 l 24.7,-426.73 -33.281,17.21 c 0,0 -18.494,291.63 -28.557,437.36 l -125.27,76.008 14.896,-440.77 -38.658,20.077 -17.691,451.68 -140.31,87.831 c -1.6774,-139.65 9.0024,-663.87 9.0024,-663.87 z M 1252.59,243.62 667.56,51.89 86.47,240.92 659.92,501.22 Z m -828.32,124.89 29.515,-183.46 426.42,8.9635 18.257,174.98 z m 440.8,-163.92 -399.2,-7.1312 -22.951,159.87 438.91,0.55908 z m -249.67,140.79 4.2318,-99.35 -30.318,0.23782 -9.1938,99.296 -113.02,0.0377 19.851,-136.87 358.64,4.8382 13.082,132.39 -105.23,-0.0569 -3.7982,-99.655 -31.414,-0.43053 2.5359,99.586 z"
fill="#162704"
image-rendering="optimizeQuality"
stroke-width="5.5469"
id="path4" />
<rect
x="-7.4903998"
y="-11.012"
width="1350"
height="1404.5"
fill="none"
id="rect4" />
</g>
<path
class="path35 path-effect52 measure-helper-line measure-line"
d="M 7.4904,11.012"
display="none"
marker-end="url(#ArrowDIN-end)"
marker-start="url(#ArrowDIN-start)"
stroke="#000000"
stroke-width="0.94488"
id="path5" />
<path
class="path35 path-effect52 measure-helper-line measure-line"
d="M 7.4904,11.012"
display="none"
marker-end="url(#ArrowDIN-end)"
marker-start="url(#ArrowDIN-start)"
stroke="#000000"
stroke-width="0.94488"
id="path153" />
<path
class="path35 path-effect52 measure-DIM-line measure-line"
d="M 7.4904,11.012"
display="none"
marker-end="url(#ArrowDIN-end)"
marker-start="url(#ArrowDIN-start)"
stroke="#000000"
stroke-width="0.94488"
id="path154" />
</svg>
Give name to script and save to ~/bin.
#!/bin/bash
# Set the path to yad, a graphical dialog library for GTK+
YAD_PATH=yad
# Check if yad is installed
if ! command -v "$YAD_PATH" &> /dev/null; then
echo "Error: yad is not installed."
exit 1
fi
# Set the SVG icon path
SVG_ICON=$HOME/.icons/mb-logo-3d.svg
# Function to edit the SVG colors
edit_svg_colors() {
while true
do
# Huidige waarden ophalen
current_bg=$(grep -m1 'fill=' "$SVG_ICON" | grep -o 'fill="#[A-Fa-f0-9]\{6\}"' | cut -d'"' -f2)
current_bg_opacity=$(grep -m1 'fill-opacity=' "$SVG_ICON" | grep -o 'fill-opacity="[^"]*"' | cut -d'"' -f2)
current_fg=$(grep -m2 'fill=' "$SVG_ICON" | tail -n1 | grep -o 'fill="#[A-Fa-f0-9]\{6\}"' | cut -d'"' -f2)
current_fg_opacity=$(grep -m2 'fill-opacity=' "$SVG_ICON" | tail -n1 | grep -o 'fill-opacity="[^"]*"' | cut -d'"' -f2)
# YAD formulier tonen
response=$(yad --form \
--window-icon="$SVG_ICON" \
--title="Edit Mabox 3D-Logo Colors" \
--center \
--width=400 \
--field="Background color:CLR" "$current_bg" \
--field="Opacity:CLR|TXT" "$current_bg_opacity" \
--field="Foreground color:CLR" "$current_fg" \
--field="Opacity:CLR|TXT" "$current_fg_opacity" \
--separator="|")
# Annuleren of sluiten
if [ $? -ne 0 || -z "$response" ]; then
break
fi
# Nieuwe waarden uit response halen
IFS="|" read -r new_bg new_bg_opacity new_fg new_fg_opacity <<< "$response"
# Backup (alleen eerste keer nodig, maar mag hier blijven)
cp "$SVG_ICON" "${SVG_ICON}.bak"
# Validate the new colors and opacity
if [[ ! "$new_bg" =~ ^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$ ]]; then
echo "Error: Invalid background color."
break
fi
if [[ ! "$new_fg" =~ ^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$ ]]; then
echo "Error: Invalid foreground color."
break
fi
if [[ ! "$new_bg_opacity" =~ ^[0-9.]+(.[0-9]+)?$ ]] || (( $(echo "$new_bg_opacity < 0 || $new_bg_opacity > 1" | bc -l) )); then
echo "Error: Invalid background opacity."
break
fi
if [[ ! "$new_fg_opacity" =~ ^[0-9.]+(.[0-9]+)?$ ]] || (( $(echo "$new_fg_opacity < 0 || $new_fg_opacity > 1" | bc -l) )); then
echo "Error: Invalid foreground opacity."
break
fi
# Pas SVG aan met nieuwe waarden
awk -v bg="$new_bg" -v bgo="$new_bg_opacity" \
-v fg="$new_fg" -v fgo="$new_fg_opacity" \
'BEGIN{bgdone=0;fgdone=0}
/<path /{
if (!bgdone) {
sub(/fill="#[A-Fa-f0-9]+"/, "fill=\""bg"\"")
sub(/fill-opacity="[0-9.]+"/, "fill-opacity=\""bgo"\"")
bgdone=1
} else if (!fgdone) {
sub(/fill="#[A-Fa-f0-9]+"/, "fill=\""fg"\"")
sub(/fill-opacity="[0-9.]+"/, "fill-opacity=\""fgo"\"")
fgdone=1
}
}
{print}' "$SVG_ICON" > "$SVG_ICON".tmp
mv "$SVG_ICON".tmp "$SVG_ICON"
# Bevestiging
yad --info --text="SVG updated successfully!\n\nYou can now change more values or press Cancel to exit." \
--timeout=3 --center
done
}
# Call the function
edit_svg_colors
Have fun…
![]()









