-
Notifications
You must be signed in to change notification settings - Fork 3
/
uui
executable file
·2342 lines (2338 loc) · 68.2 KB
/
uui
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
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
#-------------------------------------------------------------------------------
#Created by helmuthdu mailto: helmuthdu[at]gmail[dot]com
#-------------------------------------------------------------------------------
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program 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 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 <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#VARIABLES {{{
# DESKTOP ENVIRONMENT {{{
E17=0
GNOME=0
KDE=0
LXDE=0
OPENBOX=0
XFCE=0
#}}}
# PACKAGE MANAGER {{{
APTGET=0
APTITUDE=0
#}}}
# MAIN MENU {{{
BASICSETUP=0
DESKTOPENVIRONMENT=0
ACCESSORIES=0
DEVELOPMENT=0
OFFICE=0
SYSTEM=0
GRAPHICS=0
INTERNET=0
AUDIO=0
VIDEO=0
LAMP=0
FONTS=0
FONTSCONFIG=0
CLEANPACKAGES=0
#}}}
# ARCH {{{
ARCHI=`uname -m`
#}}}
# PROMPT {{{
prompt1="Enter your option: "
prompt2="Enter n° of options (ex: 1 2 3 or 1-3): "
#}}}
# COLORS {{{
# Regular Colors
Black='\e[0;30m' # Black
Blue='\e[0;34m' # Blue
Cyan='\e[0;36m' # Cyan
Green='\e[0;32m' # Green
Purple='\e[0;35m' # Purple
Red='\e[0;31m' # Red
White='\e[0;37m' # White
Yellow='\e[0;33m' # Yellow
# Bold
BBlack='\e[1;30m' # Black
BBlue='\e[1;34m' # Blue
BCyan='\e[1;36m' # Cyan
BGreen='\e[1;32m' # Green
BPurple='\e[1;35m' # Purple
BRed='\e[1;31m' # Red
BWhite='\e[1;37m' # White
BYellow='\e[1;33m' # Yellow
#}}}
AUTOMATIC_MODE=0
#}}}
#SUPPORT FUNCTIONS {{{
function read_input(){ #{{{
if [[ $AUTOMATIC_MODE -eq 1 ]]; then
OPTION=$1
else
read -p "$prompt1" OPTION
fi
} #}}}
function read_input_text(){ #{{{
if [[ $AUTOMATIC_MODE -eq 1 ]]; then
OPTION=$2
else
read -p "$1 [y/N]: " OPTION
echo ""
fi
OPTION=`echo "$OPTION" | tr '[:upper:]' '[:lower:]'`
} #}}}
function read_input_options(){ #{{{
local line
local packages
if [[ $AUTOMATIC_MODE -eq 1 ]]; then
array=("$1")
else
read -p "$prompt2" OPTION
array=("$OPTION")
fi
for line in ${array[@]/,/ }; do
if [[ ${line/-/} != $line ]]; then
for ((i=${line%-*}; i<=${line#*-}; i++)); do
packages+=($i);
done
else
packages+=($line)
fi
done
OPTIONS=("${packages[@]}")
} #}}}
function print_line(){ #{{{
printf "%$(tput cols)s\n"|tr ' ' '-'
} #}}}
function print_title (){ #{{{
clear
print_line
echo -e "# ${BWhite}$1${White}"
print_line
echo ""
} #}}}
function print_info (){ #{{{
T_COLS=`tput cols`
echo -e "${BWhite}$1${White}\n" | fold -sw $(( $T_COLS - 18 )) | sed 's/^/\t/'
} #}}}
function print_warning (){ #{{{
echo -e "${BRed}$1${White}\n"
} #}}}
function check_package(){ #{{{
for PACKAGE in $1; do
dpkg -l $PACKAGE &> /dev/null && return 0;
ls /usr/share/applications/ | grep $PACKAGE &> /dev/null && return 0;
done
return 1
} #}}}
function checkbox(){ #{{{
[[ $1 -eq 1 ]] && echo -e "${BBlue}[${BWhite}X${BBlue}]${White}" || echo -e "${BBlue}[${White} ${BBlue}]${White}";
} #}}}
function checkbox_package(){ #{{{
check_package "$1" && checkbox 1 || checkbox 0
} #}}}
function check_repository(){ #{{{
REPONAME=`echo "$1" | sed 's/.*\://' | sed 's/\//-/'`
if ls /etc/apt/sources.list.d/ | grep $REPONAME &>/dev/null; then
echo -e "\nWARNING: $REPONAME repository already configured"
else
add-apt-repository -y $1
apt-get update
echo -e "\n$REPONAME repository added into sources.list.d direcotry"
pause_function
fi
} #}}}
function package_install(){ #{{{
for PACKAGE in $1; do
if ! check_package "$PACKAGE" ; then
if [[ $APTITUDE -eq 1 ]]; then
su -l $USERNAME --command="sudo aptitude install -y $PACKAGE"
else
su -l $USERNAME --command="sudo apt-get install -y $PACKAGE"
fi
else
echo -e "Warning: $PACKAGE is up to date --skipping"
fi
done
} #}}}
function download_package(){ #{{{
PACKAGE_NAME=`echo "$1" | sed 's/.*\///'`
[[ ! -d downloaded_packages ]] && sudo -u $USERNAME mkdir downloaded_packages;
cd downloaded_packages
[[ ! -f $PACKAGE_NAME ]] && wget $1;
case "$PACKAGE_NAME" in
*.deb)
dpkg -i $PACKAGE_NAME
apt-get install -fy
;;
*.zip)
unzip $PACKAGE_NAME -d $2
chmod -R 755 $2/$PACKAGE_NAME
;;
*.tar.gz)
tar zxvf $PACKAGE_NAME -C $2
chmod -R 755 $2/$PACKAGE_NAME
;;
esac
} #}}}
function package_remove(){ #{{{
if [[ $AUTOMATIC_MODE -eq 1 ]]; then
apt-get remove --purge -y $1
else
apt-get remove --purge $1
fi
} #}}}
function contains_element(){ #{{{
for e in "${@:2}"; do [[ $e == $1 ]] && break; done;
} #}}}
function invalid_option(){ #{{{
print_line
echo "Invalid option. Try another one."
pause_function
} #}}}
function pause_function(){ #{{{
print_line
if [[ $AUTOMATIC_MODE -ne 1 ]]; then
read -e -sn 1 -p "Press any key to continue..."
fi
} #}}}
function sumary(){ #{{{
case $CURRENT_STATUS in
1)
print_line
echo "$1 successful"
;;
*)
print_line
echo "$1 not successful (Canceled)"
;;
esac
} #}}}
function menu_item(){ #{{{
[[ $# -lt 2 ]] && PACKAGE_NAME="$1" || PACKAGE_NAME="$2";
CHARS_TO_REMOVE=("Ttf-" "-bzr" "-hg" "-svn" "-git" "-bin" "-stable" "Gnome-shell-theme-" "Gnome-shell-extensions-");
for CHARS in ${CHARS_TO_REMOVE[@]}; do PACKAGE_NAME=`echo ${PACKAGE_NAME^} | sed 's/'$CHARS'//'`; done
echo -e "$(checkbox_package "$1") ${BWhite}$PACKAGE_NAME${White}"
} #}}}
function mainmenu_item(){ #{{{
echo -e "$(checkbox "$1") ${BWhite}$2${White}"
} #}}}
function elihw() { #{{{
[[ $OPT == b || $OPT == d ]] && break;
} #}}}
#}}}
#WELCOME {{{
function welcome(){
clear
echo -e "${BWhite}Welcome to the Ubuntu Ultimate install script by helmuthdu${White}"
print_line
echo "Requirements:"
echo "-> Ubuntu Distro"
echo "-> Run script as root user"
echo "-> Working internet connection"
print_line
echo "Script can be cancelled at any time with CTRL+C"
print_line
echo "This version is still in ALPHA. Send bugreports to: "
echo "http://www.github.com/helmuthdu/uui"
pause_function
}
#}}}
#CHECK ROOT {{{
function check_root() {
CURRENTUSER="$(whoami)"
if [[ $CURRENTUSER != root ]]; then
echo "Current user is NOT 'root'. EXIT now"
pause_function
exit 1
fi
}
#}}}
#LANGUAGE SELECTOR {{{
function language_selector(){
#DETECTS THE SYSTEM LANGUAGE {{{
#automatically detects the system language based on your rc.conf
LANGUAGE=`locale | sed '1!d' | sed 's/LANG=//' | cut -c1-5`
#KDE #{{{
if [ $LANGUAGE = "pt_BR" ]; then
LANGUAGE_KDE="ptbr"
elif [ $LANGUAGE = "en_GB" ] || [ $LANGUAGE = "en_US" ]; then
LANGUAGE_KDE="engb"
else
LANGUAGE_KDE=`echo $LANGUAGE | cut -d\_ -f1`
fi
#}}}
#FIREFOX #{{{
LANGUAGE_FF=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
#HUNSPELL #{{{
LANGUAGE_HS=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
#ASPELL #{{{
LANGUAGE_AS=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
#LIBREOFFICE #{{{
LANGUAGE_LO=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
#}}}
print_title "LANGUAGE"
read_input_text "Default system language: \"$LANGUAGE\"" $LANGSELECT
case "$OPTION" in
"n")
read -p "New system language [ex: en_US]: " LANGUAGE
#KDE #{{{
if [ $LANGUAGE = "pt_BR" ]; then
LANGUAGE_KDE="ptbr"
elif [ $LANGUAGE = "en_GB" ] || [ $LANGUAGE = "en_US" ]; then
LANGUAGE_KDE="engb"
else
LANGUAGE_KDE=`echo $LANGUAGE | cut -d\_ -f1`
fi
#}}}
#FIREFOX #{{{
LANGUAGE_FF=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
#HUNSPELL #{{{
LANGUAGE_HS=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
#ASPELL #{{{
LANGUAGE_AS=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
#LIBREOFFICE #{{{
LANGUAGE_LO=`echo $LANGUAGE | cut -d\_ -f1`
#}}}
;;
*)
;;
esac
pause_function
}
#}}}
#PACKAGE MANAGER {{{
function select_pkgmanager(){
print_title "PACKAGE MANAGER"
aurhelper=("apt-get" "aptitude")
PS3="$prompt1"
echo -e "Choose your default package manager\n"
select OPT in "${aurhelper[@]}"; do
case "$REPLY" in
1)
APTGET=1
CURRENT_STATUS=1
break
;;
2)
apt-get install aptitude
CURRENT_STATUS=1
APTITUDE=1
break
;;
*)
invalid_option
;;
esac
done
sumary "AUR Helper installation"
pause_function
}
#}}}
#CUSTOM REPOSITORIES {{{
function custom_repositories(){
print_title "CUSTOM REPOSITORIES"
read_input_text "Add custom repositories" $CUSTOMREPO
case "$OPTION" in
"y")
#CUSTOM REPOSITORIES {{{
while [ 1 ]
do
print_title "CUSTOM REPOSITORIES"
echo " 1) Elementary"
echo " 2) Globus Preview"
echo " 3) GNOME 3"
echo " 4) Jdownloader"
echo " 5) Medibuntu"
echo " 6) Themes/Icons"
echo " 7) Ubuntu-tweak"
echo " 8) Webupd8"
echo ""
echo " a) \"Add Custom\""
echo ""
echo " d) DONE"
echo ""
CUSTOMREPO+=" d"
read_input_options "$CUSTOMREPO"
for OPT in ${OPTIONS[@]}; do
case $OPT in
1)
check_repository "ppa:elementary-os/daily"
check_repository "ppa:nemequ/sqlheavy"
;;
2)
check_repository "ppa:gloobus-dev/gloobus-preview"
;;
3)
check_repository "ppa:webupd8team/gnome3"
;;
4)
check_repository "ppa:jd-team/jdownloader"
;;
5)
if ls /etc/apt/sources.list.d/ | grep "medibuntu" &> /dev/null; then
echo -e "\nWARNING: medibuntu repository already configured"
else
wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list
apt-get update
apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring
apt-get update
fi
pause_function
;;
6)
check_repository "ppa:tiheum/equinox"
check_repository "ppa:webupd8team/themes"
;;
7)
check_repository "ppa:ubuntu-tweak-testing/ppa"
;;
8)
check_repository "ppa:nilarimogard/webupd8"
;;
"a")
read -p "Repository Name [ex: elementary-os/daily]: " REPONAME
check_repository "ppa:$REPONAME"
;;
"d")
break
;;
*)
invalid_option
;;
esac
done
elihw
done
CURRENT_STATUS=1
;;
#}}}
*)
CURRENT_STATUS=0
;;
esac
sumary "Custom repositories configuration"
pause_function
}
#}}}
#SYSTEM UPDATE {{{
function system_upgrade(){
print_title "UPDATING YOUR SYSTEM"
read -p "Update your system [y/N]: " OPTION
if [ $OPTION = "y" ]; then
apt-get update
apt-get upgrade
fi
}
#}}}
#SELECT/CREATE USER {{{
function select_user(){
#CREATE NEW USER {{{
function create_new_user(){
read -p "Username: " USERNAME
useradd -m -g users -G adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare -s /bin/bash $USERNAME
passwd $USERNAME
configure_user_account
} #}}}
#CONFIGURE USER ACCOUNT {{{
configure_user_account(){
#BASHRC {{{
print_title "BASHRC - https://wiki.archlinux.org/index.php/Bashrc"
BASHRC=("Default" "Vanilla" "Get from github");
PS3="$prompt1"
echo -e "Choose your .bashrc\n"
select OPT in "${BASHRC[@]}"; do
case "$REPLY" in
1)
package_install "git"
git clone https://github.com/helmuthdu/dotfiles
cp dotfiles/.bashrc dotfiles/.dircolors dotfiles/.dircolors_256 dotfiles/.nanorc ~/
cp dotfiles/.bashrc dotfiles/.dircolors dotfiles/.dircolors_256 dotfiles/.nanorc /home/$USERNAME/
mkdir -p /home/$USERNAME/.config/fontconfig
cp -i dotfiles/fonts.conf /home/$USERNAME/.config/fontconfig
rm -fr dotfiles
break
;;
2)
cp /etc/skel/.bashrc ~/home/$USERNAME
break
;;
3)
package_install "git"
read -p "Enter your github username [ex: helmuthdu]: " GITHUB_USER
read -p "Enter your github repository [ex: aui]: " GITHUB_REPO
git clone https://github.com/$GITHUB_USER/$GITHUB_REPO
cp -R $GITHUB_REPO/.* /home/$USERNAME/
rm -fr $GITHUB_REPO
break
;;
*)
invalid_option
;;
esac
done
#}}}
#EDITOR {{{
print_title "DEFAULT EDITOR"
editors_list=("emacs" "joe" "nano" "vi" "vim" "zile");
PS3="$prompt1"
echo -e "Select editor\n"
select EDITOR in "${editors_list[@]}"; do
if contains_element "$EDITOR" "${editors_list[@]}"; then
if [[ $EDITOR == joe ]]; then
!check_package "joe" && aui_download_packages "joe"
elif [[ $EDITOR == vim ]]; then
package_install "vim exuberant-ctags"
#VIMRC {{{
vimrc_list=("Default" "Vanilla" "Get from github");
PS3="$prompt1"
echo -e "Choose your .vimrc\n"
select OPT in "${vimrc_list[@]}"; do
case "$REPLY" in
1)
package_install "git"
git clone https://github.com/helmuthdu/vim
mv vim /home/$USERNAME/.vim
ln -sf /home/$USERNAME/.vim/vimrc /home/$USERNAME/.vimrc
break
;;
2)
break
;;
3)
package_install "git"
read -p "Enter your github username [ex: helmuthdu]: " GITHUB_USER
read -p "Enter your github repository [ex: vim]: " GITHUB_REPO
git clone https://github.com/$GITHUB_USER/$GITHUB_REPO
cp -R $GITHUB_REPO/.vim /home/$USERNAME/
if [[ -f $GITHUB_REPO/.vimrc ]]; then
cp $GITHUB_REPO/.vimrc /home/$USERNAME/
else
ln -sf /home/$USERNAME/.vim/vimrc /home/$USERNAME/.vimrc
fi
rm -fr $GITHUB_REPO
break
;;
*)
invalid_option
;;
esac
done
#}}}
else
package_install "$EDITOR"
fi
break
else
invalid_option
fi
done
echo "EDITOR=\"$EDITOR\"" >> /home/$USERNAME/.bashrc
#}}}
chown -R $USERNAME:users /home/$USERNAME
}
#}}}
print_title "SELECT USER ACCOUNT"
users=(`cat /etc/passwd | ls "/home" | sed 's/\///' | cut -d: -f1`);
PS3="$prompt1"
echo "Avaliable Users:"
if [ $(( ${#users[@]} )) -gt 0 ]; then
echo -e "WARNING: THE SELECTED USER MUST HAVE SUDO PRIVILEGES\n"
else
echo ""
fi
select OPT in "${users[@]}" "Create new user"; do
if [ "$OPT" == "Create new user" ]; then
create_new_user
break
elif contains_element "$OPT" "${users[@]}"; then
USERNAME=$OPT
break
else
invalid_option
fi
done
[[ ! -f /home/$USERNAME/.bashrc ]] && configure_user_account;
}
#}}}
#AUTOMATIC MODE{{{
function automatic_mode(){
print_title "AUTOMATIC MODE"
print_info "Create a custom install with all options pre-selected.\nUse this option with care."
print_warning "\tUse this mode only if you already know all the option.\n\tYou won't be able to select anything later."
read_input_text "Enable Automatic Mode"
if [[ $OPTION == y ]]; then
if $EDITOR &> /dev/null; then
nano auiscript
else
$EDITOR auiscript
fi
echo -e "The installation will start now."
pause_function
AUTOMATIC_MODE=1
fi
source uuiscript
}
#}}}
#BASIC SETUP{{{
function install_basic_setup(){
print_title "(UN)COMPRESS TOOLS"
package_install "zip unzip unrar p7zip"
print_title "SSH"
print_info "Secure Shell (SSH) is a network protocol that allows data to be exchanged over a secure channel between two computers."
package_install "openssh-server"
print_title "Preload"
print_info "Preload is a program which runs as a daemon and records statistics about usage of programs using Markov chains; files of more frequently-used programs are, during a computer's spare time, loaded into memory. This results in faster startup times as less data needs to be fetched from disk. preload is often paired with prelink."
package_install "preload"
print_title "ZRam"
print_info "Zram creates a device in RAM and compresses it. If you use for swap means that part of the RAM can hold much more information but uses more CPU. Still, it is much quicker than swapping to a hard drive. If a system often falls back to swap, this could improve responsiveness. Zram is in mainline staging (therefore its not stable yet, use with caution)."
package_install "zram-config"
print_title "Apport"
print_info ""
package_remove "apport apport-symptoms"
}
#}}}
#VIDEO CARDS {{{
function install_video_cards(){
print_title "VIDEO CARD"
echo "Select your GPU:"
echo " 1) ATI"
echo " 2) nVidia"
echo " 2) Virtualbox"
echo ""
echo " s) SKIP"
echo ""
read_input $VIDEOCARD
case "$OPTION" in
1)
package_install "fglrx"
CURRENT_STATUS=1
sumary "ATI GPU driver installation"
;;
2)
package_install "nvidia-current"
CURRENT_STATUS=1
sumary "nVidia GPU driver installation"
;;
3)
package_install "virtualbox-guest-additions"
gpasswd -a $USERNAME vboxsf
CURRENT_STATUS=1
sumary "Virtualbox guest additions (incl. video drivers) installation"
;;
*)
CURRENT_STATUS=0
sumary "GPU drivers installation"
;;
esac
pause_function
}
#}}}
#GIT ACCESS THRU A FIREWALL {{{
function install_git_tor(){
print_title "GIT-TOR"
read_input_text "Ensuring access to GIT through a firewall (bypass college firewall)" $GITTOR
case "$OPTION" in
"y")
package_install "netcat-openbsd vidalia privoxy git"
if [ ! -f /usr/bin/proxy-wrapper ]; then
echo 'forward-socks5 / 127.0.0.1:9050 .' >> /etc/privoxy/config
echo -e '#!/bin/bash\nnc -xlocalhost:9050 -X5 $*' > /usr/bin/proxy-wrapper
chmod +x /usr/bin/proxy-wrapper
echo -e '\nexport GIT_PROXY_COMMAND="/usr/bin/proxy-wrapper"' >> /etc/bash.bashrc
export GIT_PROXY_COMMAND="/usr/bin/proxy-wrapper"
su -l $USERNAME --command="export GIT_PROXY_COMMAND=\"/usr/bin/proxy-wrapper\""
fi
CURRENT_STATUS=1
;;
*)
CURRENT_STATUS=0
;;
esac
sumary "GIT-TOR installation"
pause_function
}
#}}}
#DESKTOP ENVIRONMENT {{{
function install_desktop_environment(){
function install_icons() { #{{{
check_repository "ppa:tiheum/equinox"
check_repository "ppa:webupd8team/themes"
while [[ 1 ]]
do
print_title "GNOME ICONS"
echo " 1) $(menu_item "faenza-icon-theme" "Faenza")"
echo " 2) $(menu_item "faenza-cupertino" "Faenza-Cupertino")"
echo " 3) $(menu_item "faience-icon-theme" "Faience")"
echo " 4) $(menu_item "elementary-icon-theme" "Elementary")"
echo ""
echo " b) BACK"
echo ""
GNOME_ICONS+=" b"
read_input_options "$GNOME_ICONS"
for OPT in ${OPTIONS[@]}; do
case "$OPT" in
1)
package_install "faenza-icon-theme"
;;
2)
package_install "faenza-cupertino"
;;
3)
package_install "faience-icon-theme"
;;
4)
package_install "elementary-icon-theme"
;;
"b")
break
;;
*)
invalid_option
;;
esac
done
elihw
done
} #}}}
function install_themes() { #{{{
check_repository "ppa:webupd8team/themes"
check_repository "ppa:elementary-os/daily"
check_repository "ppa:tiheum/equinox"
while [[ 1 ]]
do
print_title "GTK2/GTK3 THEMES"
echo " 1) $(menu_item "shimmer-themes" "Greybird")"
echo " 2) $(menu_item "elementary-theme" "eGTK")"
echo " 3) $(menu_item "faience-theme" "Faience")"
echo " 4) $(menu_item "adwaita-x-dark-theme" "Adwaita-X Dark")"
echo " 5) $(menu_item "adwaita-x-light-theme" "Adwaita-X Light")"
echo ""
echo " b) BACK"
echo ""
GTK_THEMES+=" b"
read_input_options "$GTK_THEMES"
for OPT in ${OPTIONS[@]}; do
case "$OPT" in
1)
package_install "shimmer-themes"
;;
2)
package_install "elementary-theme"
;;
3)
package_install "faience-theme"
;;
4)
package_install "adwaita-x-dark-theme"
;;
5)
package_install "adwaita-x-light-theme"
;;
"b")
break
;;
*)
invalid_option
;;
esac
done
elihw
done
} #}}}
print_title "DESKTOP ENVIRONMENT"
print_info "Desktop environments provide a complete graphical user interface (GUI) for a system by bundling together a variety of X clients written using a common widget toolkit and set of libraries."
echo -e "Choose your desktop-environment:\n"
echo " 1) Pantheon"
echo " 2) Gnome Shell"
echo " 3) KDE"
echo " 4) Unity"
echo ""
echo " b) BACK"
read_input $DESKTOPENV
case "$OPTION" in
1)
#PANTHEON {{{
check_repository "ppa:elementary-os/stable"
check_repository "ppa:elementary-os/testing"
check_repository "ppa:elementary-os/daily"
check_repository "ppa:audience-members/ppa"
check_repository "ppa:vala-team/ppa"
print_title "PANTHEON"
package_install "elementary-desktop audience"
CURRENT_STATUS=1
GNOME=1
;;
#}}}
2)
#GNOME {{{
check_repository "ppa:webupd8team/gnome3"
check_repository "ppa:gnome3-team/gnome3"
print_title "GNOME"
package_install "gnome-shell gedit-plugins gnome-tweak-tool"
package_install "nautilus-image-converter nautilus-open-terminal nautilus-wallpaper"
#GNOME CUSTOMIZATION {{{
while [[ 1 ]]
do
print_title "GNOME CUSTOMIZATION"
echo " 1) $(menu_item "faenza-icon-theme faenza-cupertino faience-icon-theme elementary-icon-theme" "GNOME Icons")"
echo " 2) $(menu_item "shimmer-themes elementary-theme faience-theme adwaita-x-dark-theme adwaita-x-light-theme" "GNOME Themes")"
echo " 3) $(menu_item "ubuntu-tweak")"
echo ""
echo " d) DONE"
echo ""
GNOME_OPTIONS+=" d"
read_input_options "$GNOME_OPTIONS"
for OPT in ${OPTIONS[@]}; do
case "$OPT" in
1)
install_icons
OPT=1
;;
2)
install_themes
OPT=2
;;
3)
check_repository "ppa:tualatrix/ppa"
package_install "ubuntu-tweak"
;;
"d")
break
;;
*)
invalid_option
;;
esac
done
elihw
done
#}}}
CURRENT_STATUS=1
GNOME=1
;;
#}}}
3)
#KDE {{{
print_title "KDE"
print_info "KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems. It is known for its Plasma Desktop, a desktop environment provided as the default working environment on many Linux distributions."
package_install "kubuntu-desktop"
#QTCURVE THEMES #{{{
wget http://kde-look.org/CONTENT/content-files/144205-Sweet.tar.gz
wget http://kde-look.org/CONTENT/content-files/141920-Kawai.tar.gz
tar zxvf 144205-Sweet.tar.gz
tar zxvf 141920-Kawai.tar.gz
rm 144205-Sweet.tar.gz
rm 141920-Kawai.tar.gz
mkdir -p /home/$USERNAME/.kde4/share/apps/color-schemes
mkdir -p /home/$USERNAME/.kde4/share/apps/QtCurve
mv Sweet/Sweet.colors /home/$USERNAME/.kde4/share/apps/color-schemes
mv Sweet/Sweet.qtcurve /home/$USERNAME/.kde4/share/apps/QtCurve
mv Kawai/Kawai.colors /home/$USERNAME/.kde4/share/apps/color-schemes
mv Kawai/Kawai.qtcurve /home/$USERNAME/.kde4/share/apps/QtCurve
chown -R $USERNAME:users /home/$USERNAME/.kde4
rm -fr Kawai Sweet
#}}}
#KDE CUSTOMIZATION {{{
while [[ 1 ]]
do
print_title "KDE CUSTOMIZATION"
echo " 1) $(menu_item "apper")"
echo " 2) $(menu_item "bangarang")"
echo " 3) $(menu_item "choqok")"
echo " 4) $(menu_item "digikam")"
echo " 5) $(menu_item "k3b")"
echo " 6) $(menu_item "rosa-icons")"
echo " 7) $(menu_item "caledonia-bundle plasma-theme-produkt" "Plasma Themes")"
echo " 8) $(menu_item "yakuake")"
echo ""
echo " d) DONE"
echo ""
KDE_OPTIONS+=" d"
read_input_options "$KDE_OPTIONS"
for OPT in ${OPTIONS[@]}; do
case "$OPT" in
1)
package_install "apper"
;;
2)
package_install "bangarang"
;;
3)
package_install "choqok"
;;
4)
package_install "digikam"
;;
5)
package_install "k3b dvd+rw-tools"
;;
6)
download_package "https://abf.rosalinux.ru/import/rosa-icons/raw/rosa2012lts/rosa-1.0.27.tar.gz" "/usr/share/icons/"
;;
7)
package_install "caledonia-bundle plasma-theme-rosa plasma-theme-produkt ronak-plasmatheme"
;;
8)
package_install "yakuake"
package_install "yakuake-skin-plasma-oxygen-panel"
;;
"d")
break
;;
*)
invalid_option
;;
esac
done
elihw
done
#}}}
CURRENT_STATUS=1
KDE=1
;;
#}}}
4)
#UNITY {{{
print_title "UNITY"
apt-get install -y gedit-plugins
package_install "nautilus-image-converter nautilus-open-terminal nautilus-wallpaper"
package_remove "unity-lens-shopping"
#UNITY CUSTOMIZATION {{{
while [[ 1 ]]
do
print_title "UNITY CUSTOMIZATION"
echo " 1) $(menu_item "faenza-icon-theme faenza-cupertino faience-icon-theme elementary-icon-theme" "GNOME Icons")"
echo " 2) $(menu_item "shimmer-themes elementary-theme faience-theme adwaita-x-dark-theme adwaita-x-light-theme" "GNOME Themes")"
echo " 3) $(menu_item "ubuntu-tweak")"
echo " 4) $(menu_item "unity-lens-* unity-scope-*" "Unity Lens")"
echo ""
echo " d) DONE"
echo ""
UNITY_OPTIONS+=" d"
read_input_options "$UNITY_OPTIONS"
for OPT in ${OPTIONS[@]}; do
case "$OPT" in
1)
install_icons
OPT=1
;;
2)
install_themes
OPT=2
;;
3)
check_repository "ppa:tualatrix/ppa"
package_install "ubuntu-tweak"
;;
4)
#UNITY LENS {{{
check_repository "ppa:nilarimogard/webupd8"
check_repository "ppa:scopes-packagers/ppa"
while [[ 1 ]]
do
print_title "UNITY LENS"
echo " 1) $(menu_item "bookmarks-lens" "unity-lens-bookmarks")"
echo " 2) $(menu_item "unity-lens-photo")"
echo " 3) $(menu_item "unity-lens-askubuntu")"
echo " 4) $(menu_item "unity-lens-cooking")"
echo " 5) $(menu_item "unity-lens-graphicdesign")"
echo " 6) $(menu_item "unity-lens-news")"
echo " 7) $(menu_item "unity-lens-torrents")"
echo " 8) $(menu_item "unity-lens-wikipedia")"
echo " 9) $(menu_item "unity-scope-calculator")"
echo "10) $(menu_item "unity-scope-cities")"
echo "11) $(menu_item "unity-scope-colourlovers")"
echo "12) $(menu_item "unity-scope-deviantart")"
echo "13) $(menu_item "unity-scope-grooveshark")"
echo "14) $(menu_item "unity-scope-rottentomatoes") (movie review)"
echo ""
echo " b) BACK"
echo ""
UNITY_LENS+=" b"
read_input_options "$UNITY_LENS"
for OPT in ${OPTIONS[@]}; do
case "$OPT" in
1)
package_install "bookmarks-lens"
;;
2)
package_install "unity-lens-photo unity-scope-flickr unity-scope-shotwell"
;;
3)
package_install "unity-lens-askubuntu"
;;
4)
package_install "unity-lens-cooking"
;;
5)
package_install "unity-lens-graphicdesign"
;;
6)
package_install "unity-lens-news"
;;
7)
package_install "unity-lens-torrents unity-scope-piratebay"
;;
8)
package_install "unity-lens-wikipedia"
;;
9)
package_install "unity-scope-calculator"
;;