-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsolarized-mate.sh
executable file
·66 lines (53 loc) · 2.37 KB
/
solarized-mate.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
#!/bin/bash
set -e
which dconf 1>&2 > /dev/null || { echo "Please install dconf-cli"; exit 1; }
if [[ $1 == "--reset" ]]; then
dconf reset -f /org/mate/terminal/global/profile-list
dconf reset -f /org/mate/terminal/profiles
exit 0
fi
# read profiles as string
PROFILES=`dconf read /org/mate/terminal/global/profile-list`
# add new profiles
if [ -z "${PROFILES}" ]; then
PROFILES="['default','solarized-dark', 'solarized-light']"
elif [[ ${PROFILES} =~ 'solarized-dark' || ${PROFILES} =~ 'solarized-light' ]]; then
echo "Found solarized in your themes, refusing to run twice"
echo "You can reset these setting with"
echo `basename "$0"` "--reset"
exit 1
else
echo ${PROFILES}
M="'solarized-dark', 'solarized-light']"
PROFILES=${PROFILES/]/, $M}
fi
dconf write /org/mate/terminal/global/profile-list "${PROFILES}"
COLORS=`cat colors/palette`
BGCOLOR=`cat colors/base03`
BOLDCOLOR=`cat colors/base1`
FGCOLOR=`cat colors/base0`
PROFILE="solarized-dark"
# Do not use theme color
dconf write /org/mate/terminal/profiles/${PROFILE}/use-theme-colors false
# set palette
dconf write /org/mate/terminal/profiles/${PROFILE}/palette \"$COLORS\"
# set highlighted color to be different from foreground-color
dconf write /org/mate/terminal/profiles/${PROFILE}/bold-color-same-as-fg false
dconf write /org/mate/terminal/profiles/${PROFILE}/background-color \"$BGCOLOR\"
dconf write /org/mate/terminal/profiles/${PROFILE}/foreground-color \"$FGCOLOR\"
dconf write /org/mate/terminal/profiles/${PROFILE}/bold-color \"$BOLDCOLOR\"
dconf write /org/mate/terminal/profiles/${PROFILE}/visible-name \"solarized-dark\"
BGCOLOR=`cat colors/base3`
FGCOLOR=`cat colors/base00`
PROFILE="solarized-light"
# Do not use theme color
dconf write /org/mate/terminal/profiles/${PROFILE}/use-theme-colors false
# set palette
dconf write /org/mate/terminal/profiles/${PROFILE}/palette \"$COLORS\"
# set highlighted color to be different from foreground-color
dconf write /org/mate/terminal/profiles/${PROFILE}/bold-color-same-as-fg false
dconf write /org/mate/terminal/profiles/${PROFILE}/background-color \"$BGCOLOR\"
dconf write /org/mate/terminal/profiles/${PROFILE}/foreground-color \"$FGCOLOR\"
dconf write /org/mate/terminal/profiles/${PROFILE}/bold-color \"$BOLDCOLOR\"
dconf write /org/mate/terminal/profiles/${PROFILE}/visible-name \"solarized-light\"
echo -e "\e[37;41mTerminal must be restarted\e[0m"