Line 0
Link Here
|
0 |
- |
1 |
#!/bin/sh -x |
|
|
2 |
|
3 |
# DESCRIPTION |
4 |
# |
5 |
# Setup fontconfig |
6 |
|
7 |
|
8 |
# REQUIRES |
9 |
# |
10 |
# Nothing |
11 |
|
12 |
NAME="50-fontconfig" |
13 |
|
14 |
verbose() { |
15 |
if [ -n "$GLOBAL_VERBOSE" ]; then |
16 |
echo "HOOK: $NAME: $@" |
17 |
fi |
18 |
} |
19 |
|
20 |
verbose "has started" |
21 |
|
22 |
DEST_DIR= |
23 |
CONF_DIR="/etc/fonts/conf.d" |
24 |
AVAIL_DIR="/etc/fonts/conf.avail" |
25 |
|
26 |
list() { ls "$DEST_DIR$1"/??-"$2".conf 2>/dev/null; } |
27 |
|
28 |
enable() { |
29 |
for i in "$@"; do |
30 |
if list "$CONF_DIR" "$i"; then |
31 |
AVAIL="$(list "$AVAIL_DIR" "$i" | head -1)" |
32 |
if [ -n "$AVAIL" ]; then |
33 |
CONF_ADD="$(basename "$AVAIL")" |
34 |
ln -s "$AVAIL_DIR/$CONF_ADD" \ |
35 |
"$DEST_DIR$CONF_DIR/$CONF_ADD" |
36 |
fi |
37 |
fi |
38 |
done |
39 |
} |
40 |
|
41 |
disable() { |
42 |
for i in "$@"; do |
43 |
$(list "$CONF_DIR" "$i") | xargs -r rm -f -- |
44 |
done |
45 |
} |
46 |
|
47 |
disable $GLOBAL_FONT_FEATURES_DISABLE |
48 |
enable $GLOBAL_FONT_FEATURES_ENABLE |
49 |
|
50 |
: |