-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·102 lines (92 loc) · 2.17 KB
/
setup.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
#!/bin/bash
# -*- Mode: sh; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Authors:
# Sam Hewitt <sam@snwh.org>
# Mark Padgham <mark.padgham@email.com>
# Andreas Petutschnig <andreas@petutschnig.de>
#
# Description:
# A post-installation bash script for Manjaro Linux. Any new scripts must be
# made executable with >chmod u+x
#
# Legal Preamble:
#
# This script 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; version >=3.
#
# This script 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: <https://www.gnu.org/licenses/gpl-3.0.txt>
#
# tab width
tabs 4
clear
# set -xv # for debugging
#----- Fancy Messages -----#
show_error(){
echo -e "\033[1;31m$@\033[m" 1>&2
}
show_info(){
echo -e "\033[1;32m$@\033[0m"
}
show_info_red(){
echo -e "\033[1;31m$@\033[0m"
}
show_warning(){
echo -e "\033[1;33m$@\033[0m"
}
show_question(){
echo -e "\033[1;34m$@\033[0m"
}
show_success(){
echo -e "\033[1;35m$@\033[0m"
}
show_header(){
echo -e "\033[1;36m$@\033[0m"
}
show_listitem(){
echo -e "\033[0;37m$@\033[0m"
}
#----- Import Functions -----#
DIR="$(dirname "$0")"
. $DIR/functions/variables
. $DIR/functions/configure
. $DIR/functions/doall
. $DIR/functions/packages
. $DIR/functions/aur
. $DIR/functions/r-packages
# Main
function main {
MAIN=$(whiptail \
--notags \
--title "Manjaro System Setup" \
--menu "\nWhat would you like to do?" \
--cancel-button "Quit" \
$LINES $COLUMNS $(( $LINES - 12 )) \
doall '1. Do all (non-interactive)' \
packages '2. Install pacman packages' \
aurpackages '3. Install AUR packages' \
rpackages '4. Install R packages' \
configure '5. Configure system' \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
$MAIN
else
quit
fi
}
# Quit
function quit {
exit 99
}
#RUN
check_dependencies
while :
do
main
done
#END OF SCRIPT