-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchange_theme.sh
executable file
·112 lines (96 loc) · 2.9 KB
/
change_theme.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
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
#!/bin/sh
I3_THEME_DIR="$HOME/myConfigs/i3/colors"
I3_THEME_FILE="$HOME/.i3/config.colors"
VIM_THEME_DIR="$HOME/myConfigs/vim/themes"
VIM_THEME_FILE="$HOME/.vim/vimrc.colortheme"
X11_THEME_DIR="$HOME/myConfigs/X11/themes/color-schemes"
X11_THEME_FILE="$HOME/.Xresources.theme"
BASE16_THEME_SHELL="$HOME/.base16rc"
MUTT_THEME_DIR="$HOME/myConfigs/mail/mutt/themes"
MUTT_THEME_FILE="$HOME/.mutt/theme.muttrc"
GREP="grep -q"
change_theme()
{
if [ "$(uname)" = 'Linux' ]; then
if [ ! -e "$HOME"/.Xresources.font ]; then
"$HOME"/myConfigs/change_font.sh
fi
echo "Setting theme to '$1'..."
if [ -e "$VIM_THEME_DIR"/vimrc.theme."$1" ]; then
ln -sfnv "$VIM_THEME_DIR"/vimrc.theme."$1" "$VIM_THEME_FILE"
fi
if [ -e "$I3_THEME_DIR"/_config."$1" ]; then
ln -sfnv "$I3_THEME_DIR"/_config."$1" "$I3_THEME_FILE"
i3bang
fi
BASE16=
if echo "$1" | $GREP "^base16"; then
ln -sfnv "$X11_THEME_DIR"/"$1".dark.256.xresources "$X11_THEME_FILE"
ln -sfnv "$X11_THEME_DIR"/"$1".dark.sh "$BASE16_THEME_SHELL"
BASE16=".dark.256"
else
ln -sfnv "$X11_THEME_DIR"/"$1".xresources "$X11_THEME_FILE"
rm -f "$BASE16_THEME_SHELL"
fi
if [ "$DISTRO" = 'Ubuntu' ]; then
# Check if mutt is installed or not
PACKAGE=$(dpkg -l | grep mutt)
if [ -n "$PACKAGE" ]; then
ln -sfnv "$MUTT_THEME_DIR"/"$1"$BASE16.muttrc "$MUTT_THEME_FILE"
fi
fi
echo "Reloading xresources..."
xrdb -load ~/.Xresources
else
echo 'Only Linux is supported.'
fi
}
echo "[1] Gruvbox"
echo "[2] Jellybeans"
echo "[3] Sourcerer"
echo "[4] Base16-Default"
echo "[5] Base16-Atelier Seaside"
echo "[6] Base16-Atelier Sulphurpool"
echo "[7] Base16-Bespin"
echo "[8] Base16-Solarized Dark"
echo "[9] Base16-Tomorrow"
echo "[0] Base16-Twilight"
echo "[a] Dracula"
echo "[b] Manjaro-i3"
echo "[c] Solarized-Dark"
printf "Choose theme[3]: "
read -r number
if [ -z "$number" ]; then
number='3'
fi
if echo "$number" | grep -iq "^1"; then
change_theme gruvbox
elif echo "$number" | grep -iq "^2"; then
change_theme jellybeans
elif echo "$number" | grep -iq "^3"; then
change_theme sourcerer
elif echo "$number" | grep -iq "^4"; then
change_theme base16-default
elif echo "$number" | grep -iq "^5"; then
change_theme base16-atelierseaside
elif echo "$number" | grep -iq "^6"; then
change_theme base16-ateliersulphurpool
elif echo "$number" | grep -iq "^7"; then
change_theme base16-bespin
elif echo "$number" | grep -iq "^8"; then
change_theme base16-solarized
elif echo "$number" | grep -iq "^9"; then
change_theme base16-tomorrow
elif echo "$number" | grep -iq "^0"; then
change_theme base16-twilight
elif echo "$number" | grep -iq "^[a|A]$"; then
change_theme dracula
elif echo "$number" | grep -iq "^[b|B]$"; then
change_theme manjaro-i3
elif echo "$number" | grep -iq "^[c|C]$"; then
change_theme solarized
else
echo "Nahh!"
exit
fi
echo "Done."