forked from leinardi/JDInstaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jdi_xenial.sh
executable file
·293 lines (252 loc) · 9.86 KB
/
jdi_xenial.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
#!/bin/bash
# JDInstall
CODENAME="xenial"
RELEASE="16.04"
VERSION="JDInstall $CODENAME"
PINGSITE="www.google.com"
APP_OFFICIAL_REPOS="alacarte autofs build-essential bwm-ng calibre cmatrix compizconfig-settings-manager conky-all curl dconf-tools default-jdk dkms exfat-fuse exfat-utils faenza-icon-theme filezilla finch flashplugin-installer gdebi gimp git gnome-backgrounds gnome-commander gnome-gmail gnome-mplayer gnome-search-tool gnome-system-tools gnome-themes-standard gnome-tweak-tool gparted gthumb gtk-recordmydesktop gwakeonlan hardinfo hddtemp htop icedtea-plugin indicator-multiload inkscape inxi iotop jstest-gtk k3b libreoffice libsoil1 lm-sensors linux-headers-generic mc meld mercurial mplayer mumble nautilus-actions nautilus-dropbox nautilus-image-converter ncdu nfs-common nfs-kernel-server openjdk-8-jdk p7zip p7zip-full p7zip-rar pidgin powertop pavucontrol ppa-purge python-pip python-dev pwgen rar saidar silversearcher-ag sloccount skype smartmontools soundconverter sox subtitleeditor subversion synaptic synapse tagtool tig tofrodos tree ttf-mscorefonts-installer ubuntu-restricted-extras unity-tweak-tool unshield vdpau-va-driver vim vim-gtk vlc wakeonlan zlib1g-dev" #g15daemon tvtime me-tv eclipse texmaker texlive" #myunity ffmpeg synapse
APP_OTHER_REPOS="libdvdcss2 google-chrome-beta" # google-musicmanager-beta google-talkplugin indicator-sensors jdownloader my-weather-indicator
#if [[ `uname -m` == 'amd64' || `uname -m` == 'x86_64' ]]
#then
#APP_OTHER_REPOS=$APP_OTHER_REPOS" g++-multilib"
#fi
APPZ="$APP_OFFICIAL_REPOS $APP_OTHER_REPOS"
AUTOYES="--assume-yes"
case $TMPDIR in
'')
tmp_dir="/tmp"
;;
*)
tmp_dir=$TMPDIR
;;
esac
while getopts :ahvy PARAMETER
do
case $PARAMETER in
a)
echo "List of the packages to install:"
echo $APPZ
exit 0
;;
h)
echo "Uso: $0 [PARAMETER]"
echo "If no parameter is specified, the script start the installation"
echo " -a List of the packages to install"
echo " -h Show this help text"
echo " -v Show the version"
echo ""
echo "Issue tracker: https://github.com/leinardi/JDInstaller/issues"
exit 0
;;
v)
echo $VERSION
exit 0
;;
*)
echo "Invalid parameter."
echo ""
$0 -h
exit 1
;;
esac
done
lsb_release -c | grep -q $CODENAME
if [[ $? -ne 0 ]]
then
echo "This script can be used only with Ubuntu $RELEASE ($CODENAME)"
echo ""
echo "Distribution-specific information of your current installation:"
lsb_release -d -c
exit 1
fi
if [[ $EUID -ne 0 ]]
then
echo "This script require root permission." 1>&2
chmod 755 ./`basename $0`
sudo ./`basename $0`
exit 0
fi
function add_repo {
echo -n "Repository $1: "
if cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -q "$2"
then
echo "Already added"
else
echo "$2" >> /etc/apt/sources.list.d/$1.list
# echo "$2 #$1" >> /etc/apt/sources.list
chmod 644 /etc/apt/sources.list.d/$1.list
echo "Added"
if [[ $# -gt 2 ]]
then
echo -n "Adding trusted key for $1: "
wget -q -O - $3 | apt-key add -
sleep 2
fi
fi
}
function enable_repo {
if cat /etc/apt/sources.list | grep -q "# $2"
then
echo -n "Enabling repository $1: "
if eval $3
then
echo "OK"
else
echo "FAIL!"
fi
else
echo -n "Repository $1: "
if cat /etc/apt/sources.list | grep -q "$2"
then
echo "Already enabled"
else
echo "$2 #$1" >> /etc/apt/sources.list
echo "Enabled"
fi
fi
}
PARTNER="deb http://archive.canonical.com/ubuntu $CODENAME partner"
PARTNER_SRC="deb-src http://archive.canonical.com/ubuntu $CODENAME partner"
PARTNER_SED='sed -i -e "s/# deb http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/deb http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/g" /etc/apt/sources.list'
PARTNER_SRC_SED='sed -i -e "s/# deb-src http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/deb-src http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/g" /etc/apt/sources.list'
BACKPORTS="deb http://it.archive.ubuntu.com/ubuntu/ $CODENAME-backports main restricted universe multiverse"
BACKPORTS_SRC="deb-src http://it.archive.ubuntu.com/ubuntu/ $CODENAME-backports main restricted universe multiverse"
BACKPORTS_SED='sed -i -e "s/# deb http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/deb http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/g" /etc/apt/sources.list'
BACKPORTS_SRC_SED='sed -i -e "s/# deb-src http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/deb-src http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/g" /etc/apt/sources.list'
VIDEOLAN="deb http://download.videolan.org/pub/debian/stable/ /"
VIDEOLAN_KEY="http://download.videolan.org/pub/debian/videolan-apt.asc"
SKYPE="deb http://download.skype.com/linux/repos/debian stable non-free"
DROPBOX="deb http://linux.dropbox.com/ubuntu $CODENAME main"
DROPBOX_SRC="deb-src http://linux.dropbox.com/ubuntu $CODENAME main"
VIRTUALBOX="deb http://download.virtualbox.org/virtualbox/debian $CODENAME contrib"
VIRTUALBOX_KEY="http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc"
#VBOX_USB="none /proc/bus/usb usbfs devgid=125,devmode=664 0 0"
GOOGLE_CHROME="deb http://dl.google.com/linux/chrome/deb/ stable main"
GOOGLE_MUSIC_MANAGER="deb http://dl.google.com/linux/musicmanager/deb/ stable main"
GOOGLE_TALKPLUGIN="deb http://dl.google.com/linux/talkplugin/deb/ stable main"
GOOGLE_KEY="https://dl-ssl.google.com/linux/linux_signing_key.pub"
GETDEB="deb http://archive.getdeb.net/ubuntu $CODENAME-getdeb apps"
GETDEB_KEY="http://archive.getdeb.net/getdeb-archive.key"
echo "List of packages to be installed:"
echo "$APPZ"
echo
read -p "Continuae [Y/n]? " yn
if [[ $yn != 'y' ]] && [[ $yn != 'Y' ]] && [[ $yn != '' ]]
then
echo "Installation canceled"
exit 1
fi
echo
echo -n "Checking internet connection: "
ping -c1 $PINGSITE > /dev/null
if [ "$?" -ne 0 ]
then
echo "FAIL"
echo "Unable to ping $PINGSITE."
echo "Check your internet connection and try again."
exit 1
fi
echo "OK"
echo
echo "=== Updating package indexes ==="
echo
sleep 1
apt-get update
echo
echo "=== Updating installed packages ==="
echo
sleep 1
apt-get upgrade $AUTOYES
echo
echo "=== Adding repositories ==="
sleep 1
echo -n "Backup original source.list: "
if cp /etc/apt/sources.list /etc/apt/sources.list.`date +%Y%m%d-%H%M%S`
then
echo "OK"
fi
echo
enable_repo "Ubuntu Partner" "$PARTNER" "$PARTNER_SED"
enable_repo "Ubuntu Partner (Sources)" "$PARTNER_SRC" "$PARTNER_SRC_SED"
enable_repo "Ubuntu $CODENAME-Backports" "$BACKPORTS" "$BACKPORTS_SED"
enable_repo "Ubuntu $CODENAME-Backports (Sources)" "$BACKPORTS_SRC" "$BACKPORTS_SRC_SED"
#add-apt-repository -y ppa:tualatrix/ppa #Ubuntu-Tweak
#add-apt-repository -y ppa:jd-team/jdownloader #JDownloader
#add-apt-repository -y ppa:tiheum/equinox #Faenza
#add-apt-repository -y ppa:ubuntu-x-swat/x-updates #X-Updates
#add-apt-repository -y ppa:xorg-edgers/ppa #xorg-edgers
add-apt-repository -y ppa:graphics-drivers/ppa #Proprietary GPU Drivers
#add-apt-repository -y ppa:berfenger/roccat
#add-apt-repository -y ppa:mumble/release #Mumble
#add-apt-repository -y ppa:synapse-core/testing #Synapse Bleeding edge
#add-apt-repository -y ppa:uck-team/uck-stable #UCK
#add-apt-repository -y ppa:subdownloader-developers/ppa #SubDownloader
#add-apt-repository -y ppa:pkg-games/ppa #pkg-games
#add-apt-repository -y ppa:indicator-multiload/stable-daily
#add-apt-repository -y ppa:alexmurray/indicator-sensors
#add-apt-repository -y ppa:atareao/atareao
add_repo "google-chrome-beta" "$GOOGLE_CHROME" "$GOOGLE_KEY"
#add_repo "google-musicmanager" "$GOOGLE_MUSIC_MANAGER" "$GOOGLE_KEY"
#add_repo "google-talkplugin" "$GOOGLE_TALKPLUGIN" "$GOOGLE_KEY"
#add_repo "videolan" "$VIDEOLAN" "$VIDEOLAN_KEY"
#add_repo "virtualbox" "$VIRTUALBOX" "$VIRTUALBOX_KEY"
#add_repo "dropbox" "$DROPBOX"
#add_repo "getdeb" "$GETDEB" "$GETDEB_KEY"
#add_repo "skype" "$SKYPE"
echo "=== Repositories added ==="
echo
sleep 2
echo
echo "=== Updating package indexes ==="
echo
sleep 1
apt-get update
echo
echo "=== Updating installed packages ==="
echo
sleep 1
apt-get upgrade $AUTOYES
echo
echo "=== Installing new packages ==="
echo
sleep 1
apt-get install $AUTOYES $APPZ
apt-get remove $AUTOYES postfix indicator-appmenu
#pip install Glances
echo
echo "=== Disabling mouse acceleration ==="
echo
FILE="/usr/share/X11/xorg.conf.d/50-mouse-acceleration.conf"
/bin/cat <<EOM >$FILE
Section "InputClass"
Identifier "My Mouse"
MatchIsPointer "yes"
Option "AccelerationProfile" "-1"
Option "AccelerationScheme" "none"
Option "AccelSpeed" "-1"
EndSection
EOM
# unity preferences
gsettings set com.canonical.Unity.Lenses disabled-scopes \
"['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope',
'more_suggestions-populartracks.scope', 'music-musicstore.scope',
'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope',
'more_suggestions-skimlinks.scope']"
gsettings set com.canonical.unity.webapps integration-allowed false
gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-minimize-window true
gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ show-launcher '<Alt><Super>'
gsettings get org.compiz.integrated show-hud ['<Primary><Alt><Mod2>Super_L']
# indicator preferences
gsettings set com.canonical.indicator.session show-real-name-on-panel true
gsettings set com.canonical.indicator.datetime show-day true
gsettings set com.canonical.indicator.datetime show-date true
# gnome preferences
gsettings set org.gnome.desktop.interface menus-have-icons true
gsettings set org.gnome.desktop.interface buttons-have-icons true
# gedit preferences
gsettings set org.gnome.gedit.preferences.editor bracket-matching true
gsettings set org.gnome.gedit.preferences.editor display-line-numbers true
gsettings set org.gnome.gedit.preferences.editor highlight-current-line true
# nautilus
gsettings set org.gnome.nautilus.preferences executable-text-activation 'ask'
exit 0