forked from gmate/gmate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·172 lines (158 loc) · 5.86 KB
/
install.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
163
164
165
166
167
168
169
170
171
172
#!/bin/sh
# Kill all runing instances if exists
# killall gedit
version3="`gedit --version | grep '\s3\.'`"
if [ $(id -u) = "0" ]; then
sudo="yes"
else
sudo="no"
fi
# Copy gedit facilities
if [ $sudo = "yes" ]; then
if [ ! -d $HOME/.gnome2/gedit ]; then
mkdir -p ~/.gnome2/gedit
fi
fi
# Copy language definitions
if [ "$(echo $version3)" ]; then
gtksourceview="gtksourceview-3.0"
else
gtksourceview="gtksourceview-2.0"
fi
if [ $sudo = "yes" ]; then
sudo cp lang-specs/*.lang /usr/share/$gtksourceview/language-specs/
else
mkdir -p ~/.local/share/$gtksourceview/language-specs
cp lang-specs/* ~/.local/share/$gtksourceview/language-specs/
fi
# Copy Styles
if [ $sudo = "yes" ]; then
sudo cp styles/* /usr/share/$gtksourceview/styles/
else
if [ "$(echo $version3)" ]; then
if [ ! -d $HOME/.local/share/$gtksourceview/styles ]; then
mkdir -p ~/.local/share/$gtksourceview/styles
fi
cp styles/* ~/.local/share/$gtksourceview/styles
else
if [ ! -d $HOME/.gnome2/gedit/styles ]; then
mkdir -p ~/.gnome2/gedit/styles
fi
cp styles/* ~/.gnome2/gedit/styles
fi
fi
# Register MIME-types
if [ $sudo = "yes" ]; then
sudo cp mime/*.xml /usr/share/mime/packages
sudo update-mime-database /usr/share/mime
else
mkdir -p ~/.local/share/mime/packages
cp mime/*.xml ~/.local/share/mime/packages
update-mime-database ~/.local/share/mime
fi
if [ "$(echo $version3)" ]; then
geditdir="gedit"
else
geditdir="gedit-2"
fi
# Copy Gmate executable
if [ $sudo = "yes" ]; then
sudo mkdir -p /usr/share/$geditdir/gmate
sudo cp gmate.py /usr/share/$geditdir/gmate/gmate.py
else
mkdir -p ~/gmate
cp gmate.py ~/gmate
fi
# Copy Tags
if [ $sudo = "yes" ]; then
sudo mkdir -p /usr/share/$geditdir/plugins/taglist/
sudo cp tags/*.tags.gz /usr/share/$geditdir/plugins/taglist/
else
mkdir -p ~/.gnome2/gedit/taglist/
cp tags/*.tags.gz ~/.gnome2/gedit/taglist/
fi
# Copy Snippets
if [ $sudo = "yes" ]; then
sudo cp snippets/* /usr/share/$geditdir/plugins/snippets/
else
if [ ! -d $HOME/.gnome2/gedit/snippets ]; then
mkdir -p ~/.gnome2/gedit/snippets
fi
cp snippets/* ~/.gnome2/gedit/snippets/
fi
# Copy plugins
if [ "$(echo $version3)" ]; then
if [ $sudo = "yes" ]; then
for plugin in plugins/gedit3/*; do
sudo cp -R $plugin /usr/lib/gedit/plugins/
done
else
if [ ! -d $HOME/.local/share/gedit/plugins ]; then
mkdir -p ~/.local/share/gedit/plugins
fi
for plugin in plugins/gedit3/*; do
if [ $plugin = "plugins/gedit3/restoretabs" ]; then
echo "You need install gmate with sudo, to install Restore Tabs plugin"
else
cp -R $plugin ~/.local/share/gedit/plugins
fi
done
fi
else
if [ $sudo = "yes" ]; then
for plugin in plugins/gedit2/*; do
sudo cp -R $plugin/* /usr/lib/gedit-2/plugins/
done
else
if [ ! -d $HOME/.gnome2/gedit/plugins ]; then
mkdir -p ~/.gnome2/gedit/plugins
fi
for plugin in plugins/gedit2/*; do
cp -R $plugin/* ~/.gnome2/gedit/plugins
done
fi
fi
if [ !"$(echo $version3)" ]; then
# Ask for Python-Webkit package
if [ -f /etc/debian_version ]; then
if [ $sudo = "yes" ]; then
sudo apt-get install python-webkit
else
dpkg --list python-webkit > /dev/null 2>&1 || echo "Please install python-webkit (sudo apt-get install python-webkit)"
fi
fi
# Execute debian postins script
if [ $sudo = "yes" ]; then
`sudo sh ./debian/postinst`
else
# Fix for the RestoreTabs plugin
if [ ! -d $HOME~/.local/share/glib-2.0/schemas/ ]; then
mkdir -p ~/.local/share/glib-2.0/schemas/
fi
mv ~/.local/share/gedit/plugins/restoretabs/org.gnome.gedit.plugins.restoretabs.gschema.xml ~/.local/share/glib-2.0/schemas/
glib-compile-schemas ~/.local/share/glib-2.0/schemas/
fi
echo -n "Do you want to activate default plugin and configuration set? [y,N]:"
read answer
case "$answer" in
[yY])
gconftool-2 --set /apps/gedit-2/plugins/active-plugins -t list --list-type=str [rails_extract_partial,rubyonrailsloader,align-columns,smart_indent,text_tools,completion,quickhighlightmode,gemini,trailsave,rails_hotkeys,fuzzyopen,filebrowser,snippets,modelines,smartspaces,docinfo,time,spell,terminal,drawspaces,codecomment,colorpicker,indent,encodingpy,FindInProject]
gconftool-2 --set /apps/gedit-2/preferences/editor/auto_indent/auto_indent -t bool true
gconftool-2 --set /apps/gedit-2/preferences/editor/bracket_matching/bracket_matching -t bool true
gconftool-2 --set /apps/gedit-2/preferences/editor/current_line/highlight_current_line -t bool true
gconftool-2 --set /apps/gedit-2/preferences/editor/cursor_position/restore_cursor_position -t bool true
gconftool-2 --set /apps/gedit-2/preferences/editor/line_numbers/display_line_numbers -t bool true
gconftool-2 --set /apps/gedit-2/preferences/editor/right_margin/display_right_margin -t bool true
gconftool-2 --set /apps/gedit-2/preferences/editor/right_margin/right_margin_position -t int 80
gconftool-2 --set /apps/gedit-2/preferences/editor/colors/scheme -t str twilight
gconftool-2 --set /apps/gedit-2/preferences/editor/tabs/insert_spaces -t bool true
gconftool-2 --set /apps/gedit-2/preferences/editor/tabs/tabs_size -t int 4
gconftool-2 --set /apps/gedit-2/preferences/editor/wrap_mode/wrap_mode -t str GTK_WRAP_NONE
gconftool-2 --set /apps/gedit-2/preferences/editor/save/create_backup_copy -t bool false
echo "Configuration set."
;;
*)
echo "No config performed."
;;
esac
fi