-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfedora-postinstall
553 lines (450 loc) · 13.4 KB
/
fedora-postinstall
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
#!/usr/bin/env bash
#
# Post installation script for Fedora 19
#
# Syntax: sudo ./fedora-postinstall
#
# Boubakr NOUR <[email protected]>
# Distributed under the GPL version 3 license
VERSION='0.19';
isRoot() {
# Check if the current user is root or not !
if [ $EUID -ne 0 ]; then
return 0
else
return 1
fi
}
checkInternet() {
# Check the internet connectivity !
wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ]; then
return 0
else
return 1
fi
}
is64() {
# Check the architecture and return true if it's 64-bit
arch=$(uname -m)
if [ "$arch" == 'x86_64' ]; then
return 1
else
return 0
fi
}
installArabicKeyboard() {
echo "[!] Installing Arabic Keyboard..."
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'ara')]"
gsettings set org.gnome.settings-daemon.peripherals.keyboard input-sources-switcher 'alt-shift'
}
geditEncoding() {
echo "[!] Setting gedit encoding..."
gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-8', 'CURRENT', 'UTF-16', 'WINDOWS-1256']"
gsettings set org.gnome.gedit.preferences.encodings shown-in-menu "['UTF-8', 'WINDOWS-1256']"
}
totemEncoding() {
echo "[!] Setting Totem encoding..."
gsettings set org.gnome.totem autoload-subtitles true
gsettings set org.gnome.totem repeat true
gsettings set org.gnome.totem subtitle-encoding 'WINDOWS-1256'
gsettings set org.gnome.totem subtitle-font 'Sans Bold 14'
}
comonProblems() {
echo "[!] Solving some problemes..."
yum install -y gtk2-immodule-xim gtk3-immodule-xim
gsettings set org.gnome.desktop.interface gtk-im-module 'xim'
gsettings set org.gnome.desktop.interface document-font-name 'Sans 11'
gsettings set org.gnome.desktop.interface clock-format '12h'
gsettings set org.gnome.desktop.interface font-name 'Sans 11'
gsettings set org.gnome.desktop.interface monospace-font-name 'Monospace 11'
gsettings set org.gnome.desktop.interface buttons-have-icons true
gsettings set org.gnome.desktop.interface menus-have-icons true
cat <<EOF >>/etc/X11/xinit/xinitrc.d/xim4arabic.sh
export GTK_IM_MODULE="xim"
export QT_IM_MODULE="xim"
EOF
}
disableSelinux() {
echo "[!] Disabling selinux..."
sed -i '/^\s*SELINUX/ s/=.*/=disabled/' /etc/selinux/config
}
saveYumPackages() {
echo "[!] Setting yum to save packages when updating..."
sed -i '/^keepcache/ s/=.*/=1/' /etc/yum.conf
}
enableAutomaticLogin() {
echo "[!] Enabling automatic Login..."
egrep -q AutomaticLoginEnable /etc/gdm/custom.conf || \
sed -i '/^\[daemon\]/ aAutomaticLoginEnable=true\nAutomaticLogin=`whoami`' /etc/gdm/custom.conf
}
enableNumLock() {
echo "[!] Enabling NumLock..."
yum install -y numlockx
egrep -q numlockx /etc/gdm/Init/Default || \
sed -i '/exit 0/ i[ -x /usr/bin/numlockx ] && /usr/bin/numlockx on' /etc/gdm/Init/Default
}
installYumPlugins() {
echo "[!] Installing yum plugins..."
yum install -y yum-plugin-fastestmirror
}
installDevTools() {
echo "[!] Installing Development tools..."
yum groupinstall -y "Development tools"
}
installRPMFusion() {
echo "[!] Installing RPMFusion..."
yum localinstall -y --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-18.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-18.noarch.rpm
yum install -y --nogpg rpmfusion*
}
installLibreOffice() {
echo "[!] Installing LibreOffice Suite..."
yum install -y libreoffice-writer libreoffice-calc libreoffice-impress libreoffice-draw
}
installArabicFonts() {
echo "[!] Installing Arabic support for LibbreOffice and Arabic fonts..."
yum install -y --nogpg http://ojuba.org/downloads/releases/16/Everything/i386/os/Packages/amiri-fonts-0.100-2.oj16.fc16.noarch.rpm http://ojuba.org/downloads/releases/16/Everything/i386/os/Packages/arabeyes-core-fonts-2.0.1-4.oj5.noarch.rpm http://ojuba.org/downloads/releases/16/Everything/i386/os/Packages/arabeyes-decorative-fonts-2.0.1-4.oj5.noarch.rpm http://ojuba.org/downloads/releases/16/Everything/i386/os/Packages/kacst-fonts-2.01-3.oj5.noarch.rpm http://ojuba.org/downloads/releases/16/Everything/i386/os/Packages/kfgqpc-fonts-0.08-1.oj4.noarch.rpm http://ojuba.org/downloads/releases/16/Everything/i386/os/Packages/msttcore-fonts-2.0-3.noarch.rpm
yum groupinstall -y "arabic support" -x kacst*
}
installProprietaryCodecs() {
echo "[!] Installing Proprietary Codecs..."
yum install -y gstreamer-* gstreamer1-* ffmpeg x264 unzip unrar p7zip --exclude=*devel,*doc*
# If you want to play DVDs ^_^
yum install -y libdvdread libdvdnav lsdvd libdvdcss
}
installVLC() {
echo "[!] Installing VLC Media Player..."
yum install -y vlc
}
installClementine() {
echo "[!] Installing Clementine..."
yum install -y qtwebkit clementine
}
installOpenShot() {
echo "[!] Installing OpenShot..."
yum install -y qtwebkit openshot
}
installFlashPlayer() {
echo "[!] Installing Adobe Flash Player..."
yum install -y --nogpg http://linuxdownload.adobe.com/adobe-release/adobe-release-$(uname -m)-1.0-1.noarch.rpm
yum install -y flash-plugin
}
installOpenJDK() {
echo "[!] Installing OpenJDK Java Runtime Environment..."
yum install -y java-*-openjdk java-*-openjdk-plugin
}
installChrome() {
echo "[!] Installing Google Chrome..."
cat <<EOF >> /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pu
EOF
yum install -y google-chrome-stable
}
installMidori() {
echo "[!] Installing Midori Web Browser..."
yum install -y midori
}
installThunderbird() {
echo "[!] Installing Thunderbird..."
yum install -y thunderbird
}
installDropbox() {
echo "[!] Installing Dropbox..."
cat <<EOF >> /etc/yum.repos.d/dropbox.repo
[Dropbox]
name=Dropbox Repository
baseurl=http://linux.dropbox.com/fedora/$releasever/
gpgkey=http://linux.dropbox.com/fedora/rpm-public-key.asc
EOF
yum install -y nautilus-dropbox
}
installWine() {
echo "[!] Installing Wine..."
yum install -y wine
}
installGimp() {
echo "[!] Installing Gimp..."
yum install -y gimp
}
installGimpExtraPackage() {
echo "[!] Installing Extra Package..."
yum install -y gimp-ufraw
}
installInkscape() {
echo "[!] Installing Inkscape..."
yum install -y inkscape
}
installBlender() {
echo "[!] Installing Blender..."
yum install -y blender
}
installQbittorrent() {
echo "[!] Installing Qbittorrent..."
yum install -y qbittorrent
}
installFilezilla() {
echo "[!] Installing Filezilla..."
yum install -y filezilla
}
installGwibber() {
echo "[!] Installing Gwibber..."
yum install -y gwibber
}
installSkype() {
echo "[!] Installing Skype..."
if [ is64 ]; then
yum install -y alsa-lib.i686 fontconfig.i686 freetype.i686 glib2.i686 libSM.i686 libXScrnSaver.i686 libXi.i686 libXrandr.i686 libXrender.i686 libXv.i686 libstdc++.i686 pulseaudio-libs.i686 qt.i686 qt-x11.i686 zlib.i686 qtwebkit.i686
fi
cd /tmp
wget --trust-server-names http://www.skype.com/go/getskype-linux-dynamic
mkdir /opt/skype
tar xvf skype-4.1* -C /opt/skype --strip-components=1
ln -s /opt/skype/skype.desktop /usr/share/applications/skype.desktop
ln -s /opt/skype/icons/SkypeBlue_48x48.png /usr/share/icons/skype.png
ln -s /opt/skype/icons/SkypeBlue_48x48.png /usr/share/pixmaps/skype.png
touch /usr/bin/skype
chmod 755 /usr/bin/skype
cat <<EOF >>/usr/bin/skype
#!/bin/sh
export SKYPE_HOME="/opt/skype"
$SKYPE_HOME/skype --resources=$SKYPE_HOME $*
EOF
}
installGnomeClassicMode() {
echo "[!] Installing Gnome Classic Mode..."
yum install -y gnome-classic-session
}
installGeneralUtilities() {
echo "[!] Installing General Utilities..."
yum install -y yumex cups-pdf terminator nautilus-open-terminal vim-enhanced gnome-tweak-tool
}
installKDEDesktop() {
echo "[!] Installing KDE Desktop..."
yum groupinstall -y @kde-desktop
}
installCinnamonDesktop() {
echo "[!] Installing Cinnamon Desktop..."
yum groupinstall -y "Cinnamon Desktop"
}
installMateDesktop() {
echo "[!] Installing Mate Desktop..."
yum groupinstall -y "Mate Desktop"
}
#
# Here we go !
#
echo "Post installation script for Fedora 18 Sperical Cow"
if [ checkInternet = 0 ]; then
echo "[x] There is no Internet connection..."
exit 1
fi
if [ isRoot ]; then
clear
read -p "Do you want to solve some problems ? (y/N) " answer
if [ "$answer" = 'y' ]; then
comonProblems
fi
read -p "[-] Do you want disable selinux ? (y/N) " answer
if [ "$answer" = 'y' ]; then
disableSelinux
fi
clear
read -p "[-] Do you want set yum to save packages when updating ? (y/N) " answer
if [ "$answer" = 'y' ]; then
saveYumPackages
fi
clear
read -p "[-] Do you want to enable Automatic Login ? (y/N) " answer
if [ "$answer" = 'y' ]; then
enableAutomaticLogin
fi
clear
read -p "[-] Do you want to install yum plugins ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installYumPlugins
fi
clear
read -p "[-] Do you want to enable NumLock ? (y/N) " answer
if [ "$answer" = 'y' ]; then
enableNumLock
fi
clear
echo "[!] Updating the system..."
yum update -y
clear
read -p "[-] Do you want to install Development tools ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installDevTools
fi
clear
read -p "[-] Do you want to install RPMFusion ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installRPMFusion
fi
clear
read -p "[-] Do you want to install Proprietary Codecs ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installProprietaryCodecs
fi
clear
read -p "[-] Do you want to install VLC Media Player ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installVLC
fi
clear
read -p "[-] Do you want to install Clementine Media Player ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installClementine
fi
clear
read -p "[-] Do you want to install OpenShot Video Editor ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installOpenShot
fi
clear
read -p "[-] Do you want to install LibreOffice Suite ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installLibreOffice
fi
clear
read -p "[-] Do you want to install Arabic fonts ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installArabicFonts
fi
clear
read -p "[-] Do you want to install Adobe Flash Player ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installFlashPlayer
fi
clear
read -p "[-] Do you want to install OpenJDK Java Runtime Environment ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installOpenJDK
fi
clear
read -p "[-] Do you want to install Google Chrome ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installChrome
fi
clear
read -p "[-] Do you want to install Midori Web Browser ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installMidori
fi
clear
read -p "[-] Do you want to install Thunderbird ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installThunderbird
fi
clear
read -p "[-] Do you want to install Qbittorrent ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installQbittorrent
fi
clear
read -p "[-] Do you want to install Filezilla ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installFilezilla
fi
clear
read -p "[-] Do you want to install Gwibber ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installGwibber
fi
clear
read -p "[-] Do you want to install Dropbox ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installDropbox
read -p "[-] You need to activate the dropbox program to complete the installation and configure a user account..."
fi
clear
read -p "[-] Do you want to install Skype ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installSkype
fi
clear
read -p "[-] Do you want to install Wine ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installWine
fi
clear
read -p "[-] Do you want to install Gimp ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installGimp
fi
clear
read -p "[-] Do you want to install Gimp Extra Package ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installGimpExtraPackage
fi
clear
read -p "[-] Do you want to install Inkscape ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installInkscape
fi
clear
read -p "[-] Do you want to install Blender ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installBlender
fi
clear
read -p "[-] Do you want to install Gnome Classic Mode ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installGnomeClassicMode
fi
clear
read -p "[-] Do you want to install General Utilities ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installGeneralUtilities
fi
clear
read -p "[-] Do you want to install Cinnamon Desktop ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installCinnamonDesktop
fi
clear
read -p "[-] Do you want to install KDE Desktop ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installKDEDesktop
fi
clear
read -p "[-] Do you want to install Mate Desktop ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installMateDesktop
fi
else
echo "This script must be run as root..." 1>&2
clear
read -p "Do you want to install Arabic Keyboard ? (y/N) " answer
if [ "$answer" = 'y' ]; then
installArabicKeyboard
fi
clear
read -p "Do you want to set gedit encoding ? (y/N) " answer
if [ "$answer" = 'y' ]; then
geditEncoding
fi
clear
read -p "Do you want to set totem encoding ? (y/N) " answer
if [ "$answer" = 'y' ]; then
totemEncoding
fi
clear
read -p "Do you want to solve some problems ? (y/N) " answer
if [ "$answer" = 'y' ]; then
comonProblems
fi
exit 1
fi
echo "Installation Complete !"