-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paththemer
executable file
·133 lines (122 loc) · 4.19 KB
/
themer
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/env bash
#
# rotsix - (c) wtfpl 2017
# simple theme manager
usage () {
echo "$0"
echo "usage: $(basename "$0") <theme>"
}
# suggestions: wallpaper, gtk-theme
files=(termite vim)
set_theme () {
for i in "${files[@]}"; do
case "$i" in
termite)
case "$1" in
light)
sed -Ei -e 's/^background = #[a-fA-F0-9]{6}$/background = #ffffff/g' \
-e 's/^foreground = #[a-fA-F0-9]{6}$/foreground = #24292e/g' \
-e 's/^color0 = #[a-fA-F0-9]{6}$/color0 = #babbbc/g' \
-e 's/^color8 = #[a-fA-F0-9]{6}$/color8 = #76787b/g' \
-e 's/^color1 = #[a-fA-F0-9]{6}$/color1 = #d7a349/g' \
-e 's/^color9 = #[a-fA-F0-9]{6}$/color9 = #b31d28/g' \
-e 's/^color2 = #[a-fA-F0-9]{6}$/color2 = #3ebc5c/g' \
-e 's/^color10 = #[a-fA-F0-9]{6}$/color10 = #22863a/g' \
-e 's/^color3 = #[a-fA-F0-9]{6}$/color3 = #f18338/g' \
-e 's/^color11 = #[a-fA-F0-9]{6}$/color11 = #e36209/g' \
-e 's/^color4 = #[a-fA-F0-9]{6}$/color4 = #005cc5/g' \
-e 's/^color12 = #[a-fA-F0-9]{6}$/color12 = #032f62/g' \
-e 's/^color5 = #[a-fA-F0-9]{6}$/color5 = #6f42c1/g' \
-e 's/^color13 = #[a-fA-F0-9]{6}$/color13 = #45267d/g' \
-e 's/^color6 = #[a-fA-F0-9]{6}$/color6 = #005cc5/g' \
-e 's/^color14 = #[a-fA-F0-9]{6}$/color14 = #032f62/g' \
-e 's/^color7 = #[a-fA-F0-9]{6}$/color7 = #41484f/g' \
-e 's/^color15 = #[a-fA-F0-9]{6}$/color15 = #24292e/g' \
"$HOME/.config/termite/config"
;;
dark)
sed -Ei -e 's/^background = #[a-fA-F0-9]{6}$/background = #000000/g' \
-e 's/^foreground = #[a-fA-F0-9]{6}$/foreground = #f5f5f5/g' \
-e 's/^color0 = #[a-fA-F0-9]{6}$/color0 = #000000/g' \
-e 's/^color8 = #[a-fA-F0-9]{6}$/color8 = #909090/g' \
-e 's/^color1 = #[a-fA-F0-9]{6}$/color1 = #d61d15/g' \
-e 's/^color9 = #[a-fA-F0-9]{6}$/color9 = #f00f05/g' \
-e 's/^color2 = #[a-fA-F0-9]{6}$/color2 = #98971a/g' \
-e 's/^color10 = #[a-fA-F0-9]{6}$/color10 = #b8bb26/g' \
-e 's/^color3 = #[a-fA-F0-9]{6}$/color3 = #d79921/g' \
-e 's/^color11 = #[a-fA-F0-9]{6}$/color11 = #fabd2f/g' \
-e 's/^color4 = #[a-fA-F0-9]{6}$/color4 = #458588/g' \
-e 's/^color12 = #[a-fA-F0-9]{6}$/color12 = #83a598/g' \
-e 's/^color5 = #[a-fA-F0-9]{6}$/color5 = #b16286/g' \
-e 's/^color13 = #[a-fA-F0-9]{6}$/color13 = #d3869b/g' \
-e 's/^color6 = #[a-fA-F0-9]{6}$/color6 = #689d6a/g' \
-e 's/^color14 = #[a-fA-F0-9]{6}$/color14 = #8ec07c/g' \
-e 's/^color7 = #[a-fA-F0-9]{6}$/color7 = #d8d8d8/g' \
-e 's/^color15 = #[a-fA-F0-9]{6}$/color15 = #f9e5d1/g' \
"$HOME/.config/termite/config"
;;
*)
echo "This theme isn't supported, add it in set_theme() for termite"
exit 1
;;
esac
;;
vim)
case "$1" in
light)
sed -Ei -e 's/^colorscheme .*$/colorscheme github/g' \
"$HOME/.config/nvim/init.vim"
;;
dark)
sed -Ei -e 's/^colorscheme .*$/colorscheme newbz/g' \
"$HOME/.config/nvim/init.vim"
;;
*)
echo "This theme isn't supported, add it in set_theme() for '$1'"
exit 1
;;
esac
;;
*)
echo "This application isn't supported, add it in set_theme()"
exit 1
;;
esac
done
}
reload () {
for i in "${files[@]}"; do
case $i in
termite)
pkill -10 termite
;;
vim)
themer.neovim.py
;;
*)
echo "This option isn't supported, add it in reload()"
exit 1
;;
esac
done
}
test -z "$1" && usage && exit 0
case $1 in
help|-h|--help)
usage
exit 0
;;
light)
set_theme light
reload
;;
dark)
set_theme dark
reload
;;
*)
echo "This theme is not set, modify the script to add it."
exit 0
;;
esac
# vim: sw=2: ts=2: