-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebianWizard.sh
More file actions
executable file
·77 lines (60 loc) · 2.26 KB
/
debianWizard.sh
File metadata and controls
executable file
·77 lines (60 loc) · 2.26 KB
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
#!/usr/bin/env bash
source ./src/common.sh
root_test(){
if [ "$EUID" -ne 0 ]; then
printf '%s\n' "If you're NOT sudo/root user, you couldn't run this script properly."
printf '%s\n' "Run usermod -aG sudo $ USER to add your user to sudoers group."
dots "Rerunning script with sudo privileges"
sudo "$0" "$@"
exit $?
fi
}
source ./src/deb/welcome.sh
set_timezone(){
dots "Setting timezone to America/Mexico_City"
sudo timedatectl set-timezone America/Mexico_City
sudo timedatectl set-local-rtc 0 --adjust-system-clock
sudo timedatectl set-ntp true
print_success "Timezone set to America/Mexico_City"
printf "Your current time is: %s\n" "$(timedatectl | grep 'Local time' | xargs)"
return 0
}
removing_libreoffice(){
dots "Removing apt LibreOffice version (Is outdated most of the times)"
sudo apt purge --autoremove 'libreoffice*'
sudo apt purge --autoremove 'libreoffice*' 'uno*' 'ure*'
sudo apt remove libreoffice-common libreoffice-core libreoffice-gnome libreoffice-gtk3 libreoffice-help-common libreoffice-help-en-us libreoffice-style-colibre libreoffice-style-elementary
sudo apt autoremove --purge
sudo apt clean
dpkg -l | awk '/^rc/ && $2 ~ /libreoffice|uno|ure/ {print $2}' | xargs -r sudo dpkg -P
dots "Removing old LibreOffice user configuration files"
rm -rf ~/.config/libreoffice ~/.cache/libreoffice ~/.local/share/libreoffice
print_success "Old LibreOffice removed from the system"
print_warning "If you need LibreOffice, consider installing from Flathub repository for a more updated version"
return 0
}
setting_vim(){
dots "Setting numbers to vim display"
printf '%s\n' "set nu" > ~/.vimrc
print_success "Vim configured to show line numbers"
return 0
}
activate_bluetooth(){
dots "Installing Realtek firmware and Blueman for Bluetooth support"
sudo apt install firmware-realtek && sudo apt install blueman
print_success "Bluetooth support activated"
return 0
}
main() {
root_test
welcome
set_timezone
removing_libreoffice
setting_vim
activate_bluetooth
print_success "Configuration completed!"
printf '%s\n' "Debian basic configuration by debianWizard.sh"
return 0
}
# Run main
main