This repository has been archived by the owner on Dec 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstaller
executable file
·75 lines (66 loc) · 1.45 KB
/
installer
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
#!/bin/bash
# shows usage instructions
usage()
{
cat << EOF
usage: $0 [options]
This script installs the Solarized styles for gedit 3 or pluma (MATE)
OPTIONS:
-h Shows this message
gedit3 (GNOME):
-a Install for all users
-l Install only for you
pluma (MATE):
-A Install for all users
-L Install only for you
EOF
}
chkdir()
{
if [ ! -d "$INSTALLPATH" ]; then
if [ "$NEEDSUDO" == true ]; then
sudo mkdir -p "$INSTALLPATH"
else
mkdir -p "$INSTALLPATH"
fi
fi
}
# path to install to
INSTALLPATH=$HOME/.local/share/gedit/styles
# will need to use sudo to install for all users
NEEDSUDO=false
# loop through passed arguments
while getopts "halAL" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
a)
INSTALLPATH=/usr/share/gtksourceview-3.0/styles
NEEDSUDO=true
;;
A)
INSTALLPATH=/usr/share/gtksourceview-2.0/styles
NEEDSUDO=true
;;
l)
INSTALLPATH=$HOME/.local/share/gedit/styles
;;
L)
INSTALLPATH=$HOME/.config/pluma/styles
;;
?)
INSTALLPATH=$HOME/.local/share/gedit/styles
;;
esac # is ridiculous
done
# install for all users when sudo set to true
if [ "$NEEDSUDO" == true ]; then
chkdir
sudo cp solarized-*.xml "$INSTALLPATH"
else
chkdir
cp solarized-*.xml "$INSTALLPATH"
fi