|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# --------------------------------------------------------------- |
| 4 | +# Script Name: SVG to ICO Converter |
| 5 | +# Description: This bash script automates the process of converting |
| 6 | +# an SVG (Scalable Vector Graphics) file to an ICO |
| 7 | +# (Icon) file. It uses the tools Inkscape and ImageMagick. |
| 8 | +# The script takes an SVG file 'logo.svg', scales it to a |
| 9 | +# 128x128 PNG image using Inkscape, then converts the PNG |
| 10 | +# image to an ICO file using ImageMagick, and finally removes |
| 11 | +# the temporary PNG file. |
| 12 | +# |
| 13 | +# Prerequisites: Please ensure Inkscape and ImageMagick are installed |
| 14 | +# on your system. For Arch Linux and its derivatives, you |
| 15 | +# can use the following command: |
| 16 | +# sudo pacman -S inkscape imagemagick |
| 17 | +# |
| 18 | +# Usage: To run the script, navigate to the directory containing the script |
| 19 | +# and the 'logo.svg' file, then execute the script. In a terminal, |
| 20 | +# you can do this by typing: |
| 21 | +# sh ./generate-favicon.sh |
| 22 | +# --------------------------------------------------------------- |
| 23 | + |
| 24 | +# Export the SVG image to a temporary PNG image with Inkscape |
| 25 | +inkscape -w 128 -h 128 -o temp.png logo.svg |
| 26 | + |
| 27 | +# Convert the PNG image to ICO with ImageMagick |
| 28 | +convert temp.png favicon.ico |
| 29 | + |
| 30 | +# Remove the temporary PNG image |
| 31 | +rm temp.png |
0 commit comments