Commit 5cfb5c2f authored by Raphaël Hertzog's avatar Raphaël Hertzog

Updated Makefile to cope with latest changes

generate-menu-icons.sh duplicates logic already present in the Makefile,
get rid of it.
parent 7f7925c7
SIZES = 16 22 24 32 48 256
NAMES = $(basename $(notdir $(wildcard menu-icons/scalable/apps/*.svg)))
NAMES = $(patsubst menu-icons/scalable/%.svg,%,$(wildcard menu-icons/scalable/*/*.svg))
all:
@$(MAKE) $(TARGETS)
......@@ -10,10 +10,11 @@ clean:
# Add dynamic rules to convert all SVG files into various PNG
define svg_to_png
menu-icons/$(1)x$(1)/apps/$(2).png: menu-icons/scalable/apps/$(2).svg
menu-icons/$(1)x$(1)/$(2).png: menu-icons/scalable/$(2).svg
mkdir -p $(dir menu-icons/$(1)x$(1)/$(2).png)
rsvg-convert -o $$@ -w $(1) -h $(1) $$<
TARGETS += menu-icons/$(1)x$(1)/apps/$(2).png
TARGETS += menu-icons/$(1)x$(1)/$(2).png
endef
......
#!/bin/sh
## Will generate the files in `menu-icons/`
## Check to see if software is installed
if ! $( dpkg -l | grep -q inkscape ); then
sudp apt-update
sudo apt-get -y install inkscape
fi
## Get every SVG
find ./menu-icons/scalable/ -type f -name '*.svg' | while read f; do
## Feedback
echo "[i] ${f}"
## Get filename.ext
fname=$( basename "${f}" )
## Get filename
name=${fname%.*}
## Check to see if its in the /apps/ folder, and add "kali-" for a prefix
[ -z "${f##*/apps/*}" ] \
&& name="kali-${name}"
## For every size
for x in $( ls -1 ./menu-icons/ | grep 'x' | sed 's/[0-9]\+x//' | sort -n ); do
## Convert SVG to PNG
inkscape \
--without-gui \
--export-png ./menu-icons/${x}x${x}/apps/${name}.png \
--export-width="${x}" \
--export-height="${x}" \
--export-background=0 \
--export-background-opacity=0 \
"${f}"
## Make the output cleaner
echo ""
done
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment