-
Notifications
You must be signed in to change notification settings - Fork 17
/
install-gtk-azure-theme.sh
executable file
·162 lines (147 loc) · 4.04 KB
/
install-gtk-azure-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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/bin/bash
# -*- Mode: sh; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Authors:
# Sam Hewitt <[email protected]>
# Peter Cornelis <[email protected]>
#
# Description:
# An installation bash script for EvoPop GTK Theme
#
# Legal Stuff:
#
# This file is part of the EvoPop GTK Theme and is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; version 3.
#
# This file is part of the EvoPop GTK Theme and 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. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, see <https://www.gnu.org/licenses/lgpl-3.0.txt>
clear
echo '#-----------------------------------------#'
echo '# EvoPop GTK Theme Install Script #'
echo '#-----------------------------------------#'
show_question() {
echo -e "\033[1;34m$@\033[0m"
}
show_dir() {
echo -e "\033[1;32m$@\033[0m"
}
show_error() {
echo -e "\033[1;31m$@\033[0m"
}
function continue {
echo
show_question '\tDo you want to continue? (Y)es, (N)o : '
echo
read INPUT
case $INPUT in
[Yy]* ) main;;
[Nn]* ) exit 99;;
* ) echo; echo "Sorry, try again."; continue;;
esac
}
function main {
if [ "$UID" -eq "$ROOT_UID" ]; then
if [ -d /usr/share/themes/EvoPop-Azure ]; then
echo
show_question '\tFound an existing installation. Replace it? (Y)es, (N)o : '
echo
read INPUT
case $INPUT in
[Yy]* ) rm -Rf /usr/share/themes/EvoPop-Azure 2>/dev/null;;
[Nn]* );;
* ) clear; show_error '\tSorry, try again.'; main;;
esac
fi
echo "Installing..."
cp -R ./EvoPop-Azure/ /usr/share/themes/
chmod -R 755 /usr/share/themes/EvoPop-Azure
echo "Installation complete!"
echo "You will have to set your theme manually."
end
elif [ "$UID" -ne "$ROOT_UID" ]; then
if [ -d $HOME/.local/share/themes/EvoPop-Azure ]; then
echo
show_question '\tFound an existing installation. Replace it? (Y)es, (N)o : '
echo
read INPUT
case $INPUT in
[Yy]* ) rm -Rf "$HOME/.local/share/themes/EvoPop-Azure" 2>/dev/null;;
[Nn]* );;
* ) clear; show_error '\tSorry, try again.'; main;;
esac
fi
echo "Installing..."
# .local/share/themes
install -d $HOME/.local/share/themes
cp -R ./EvoPop-Azure/ $HOME/.local/share/themes/
# .themes
install -d $HOME/.themes
cp -R ./EvoPop-Azure/ $HOME/.themes/
echo "Installation complete!"
set
fi
}
function set {
echo
show_question '\tDo you want to set EvoPop-Azure as desktop theme? (Y)es, (N)o : '
echo
read INPUT
case $INPUT in
[Yy]* ) settheme;;
[Nn]* ) end;;
* ) echo; show_error "\aUh oh, invalid response. Please retry."; set;;
esac
}
function settheme {
echo "Setting EvoPop-Azure as desktop GTK theme..."
gsettings reset org.gnome.desktop.interface gtk-theme
gsettings reset org.gnome.desktop.wm.preferences theme
gsettings set org.gnome.desktop.interface gtk-theme "EvoPop-Azure"
gsettings set org.gnome.desktop.wm.preferences theme "EvoPop-Azure"
echo "Done."
setthemegnome
}
function setthemegnome {
if [ -d /usr/share/gnome-shell/extensions/[email protected]/ ]; then
echo
show_question '\tWould you like to use EvoPop-Azure as your GNOME Shell theme? (Y)es, (N)o : '
echo
read INPUT
case $INPUT in
[Yy]* ) gsettings set org.gnome.shell.extensions.user-theme name "EvoPop-Azure";;
[Nn]* ) end;;
* ) echo; show_error "\aUh oh, invalid response. Please retry."; set;;
esac
end
else
end
fi
}
function end {
echo "Exiting"
exit 0
}
ROOT_UID=0
if [ "$UID" -ne "$ROOT_UID" ]; then
echo
echo "EvoPop-Azure GTK Theme will be installed in:"
echo
show_dir '\t$HOME/.local/share/themes'
echo
echo "To make them available to all users, run this script as root."
continue
else
echo
echo "EvoPop-Azure GTK Theme will be installed in:"
echo
show_dir '\t/usr/share/themes'
echo
echo "It will be available to all users."
continue
fi