-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert_solarized.sh
executable file
·59 lines (50 loc) · 1.28 KB
/
convert_solarized.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash -e
#
# Convert original solarized themes to YAML-based themes.
#
# Usage:
#
# convert_solarized.sh [colors-dir [dest-prefix]]
#
# Default "colors-dir" is "gnome-terminal-colors-solarized/colors"
#
# Copyright (c) 2014-2017 Steven Bakker; All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself. See "perldoc perlartistic".
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
topdir=gnome-terminal-colors-solarized/colors
destprefix=solarized-
usage() {
cat <<EOF >&2
Usage: $0 [colors-dir [dest-prefix]]
default colors-dir is $topdir
default dest-prefix is \"$destprefix\"
YAML files are left in "color/\${destprefix}PROFILE/colors.yaml"
EOF
exit 1
}
case $# in
0) ;;
1) topdir=$1
;;
2) topdir=$1
destprefix=$2
;;
*) usage
;;
esac
currdir=$(pwd)
cd $topdir
for dir in *
do
if [[ -d $dir && -f $dir/palette ]]; then
dest=$currdir/colors/$destprefix$dir
mkdir -p $dest
echo "converting $topdir/$dir"
$currdir/src/theme_to_yaml.pl $dir > $dest/colors.yaml
fi
done