Skip to content

Commit c7a9e69

Browse files
authored
xfwm4: restore xfwm rendering scripts (#18)
1 parent 5409a25 commit c7a9e69

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/bash
2+
3+
INKSCAPE="inkscape"
4+
OPTIPNG="optipng"
5+
6+
SRC_FILE="assets.svg"
7+
ASSETS_DIR="."
8+
9+
INDEX="assets.txt"
10+
11+
# check command avalibility
12+
has_command() {
13+
"$1" -v $1 > /dev/null 2>&1
14+
}
15+
16+
mkdir -p $ASSETS_DIR
17+
18+
for i in `cat $INDEX`
19+
do
20+
if ! [ -f $ASSETS_DIR/$i.png ]; then
21+
echo Rendering $ASSETS_DIR/$i.png
22+
23+
$INKSCAPE --export-id=$i \
24+
--export-id-only \
25+
--export-filename=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null
26+
$OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
27+
fi
28+
done
29+
exit 0

src/Mint-Y/xfwm4/render-assets.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/bash
2+
3+
INKSCAPE="inkscape"
4+
OPTIPNG="optipng"
5+
6+
SRC_FILE="assets.svg"
7+
ASSETS_DIR="."
8+
9+
INDEX="assets.txt"
10+
11+
# check command avalibility
12+
has_command() {
13+
"$1" -v $1 > /dev/null 2>&1
14+
}
15+
16+
mkdir -p $ASSETS_DIR
17+
18+
for i in `cat $INDEX`
19+
do
20+
if ! [ -f $ASSETS_DIR/$i.png ]; then
21+
echo Rendering $ASSETS_DIR/$i.png
22+
23+
$INKSCAPE --export-id=$i \
24+
--export-id-only \
25+
--export-filename=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null
26+
$OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
27+
fi
28+
done
29+
exit 0

0 commit comments

Comments
 (0)