-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-install.sh
153 lines (120 loc) · 5.32 KB
/
post-install.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
#! /bin/bash
# Arch Linux Installation Package.
echo "Arch Configurator"
# Disk variable
disk=vda
# Set date time
ln -sf /usr/share/zoneinfo/Asia/Dubai /etc/localtime
hwclock --systohc
# Set locale to en_US.UTF-8 UTF-8
sed -i '/en_US.UTF-8 UTF-8/s/^#//g' /etc/locale.gen
sed -i '/en_GB.UTF-8 UTF-8/s/^#//g' /etc/locale.gen
locale-gen
echo "LANG=en_GB.UTF-8" >> /etc/locale.conf
# Set hostname
echo "archlinux" >> /etc/hostname
echo "127.0.1.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 archlinux.localdomain archlinux" >> /etc/hosts
# Generate initramfs
mkinitcpio -P
# Set root password
passwd
# Create new user
useradd -m -g users -G wheel,power,input,storage,network -s /bin/bash juan
sed --in-place 's/^#\s*\(%wheel\s\+ALL=(ALL)\s\+NOPASSWD:\s\+ALL\)/\1/' /etc/sudoers
echo "Set password for new user juan"
passwd juan
# Install bootloader
pacman -S grub efibootmgr --noconfirm
mkdir /boot/efi
mount /dev/${disk}1 /boot/efi
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --removable
sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g' /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
# Install bluetooth
# pacman -S pulseaudio-bluetooth bluez bluez-libs bluez-utils blueberry --noconfirm
# systemctl enable bluetooth.service && systemctl start bluetooth.service && sed -i 's/'#AutoEnable=false'/'AutoEnable=true'/g' /etc/bluetooth/main.conf
# Install laptop support
# pacman -S tlp --noconfirm
# systemctl enable tlp.service
# Install sound
pacman -S pulseaudio pulseaudio-alsa pavucontrol alsa-firmware alsa-lib alsa-plugins alsa-utils gstreamer gst-plugins-good \
gst-plugins-bad gst-plugins-base gst-plugins-ugly playerctl volumeicon --noconfirm
# Install system support
pacman -S networkmanager network-manager-applet nvidia xf86-video-amdgpu wget curl git gvfs gvfs-smb sshfs \
smbclient gparted openssh screenfetch variety wireguard-tools vsftpd zip --noconfirm
# Install vm support
pacman -S qemu-guest-agent virtualbox-guest-utils --noconfirm
# Install printer support
pacman -S system-config-printer cups-pdf cups-pk-helper print-manager --noconfirm
# Install office
pacman -S libreoffice-fresh libreoffice-fresh-en-gb libreoffice-fresh-es libmythes mythes-en mythes-es hunspell \
hunspell-en_GB hunspell-es_co thunderbird kate gnome-calculator --noconfirm
# Install fonts
# pacman -S awesome-terminal-fonts adobe-source-sans-pro-fonts cantarell-fonts noto-fonts ttf-bitstream-vera ttf-dejavu \
# ttf-droid ttf-hack ttf-inconsolata ttf-liberation ttf-roboto ttf-ubuntu-font-family tamsyn-font --noconfirm
# Install media
pacman -S gwenview vlc gimp --noconfirm
# Remove libreoffice logo
sed -i 's/Logo=1/Logo=0/g' /etc/libreoffice/sofficerc
# Activate ftp server upload/download
sed -i 's/#write_enable=YES/write_enable=YES/g' /etc/vsftpd.conf
sed -i 's/#local_enable=YES/local_enable=YES/g' /etc/vsftpd.conf
sudo systemctl enable vsftpd.service
# Auto-start screenfetch in terminal
echo 'screenfetch' >> /home/juan/.bashrc
# Uncoment to mount unraid share
# echo 'documents /home/juan/Documents 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0' >> /etc/fstab
# Install swap file - https://wiki.archlinux.org/index.php/swap
dd if=/dev/zero of=/swapfile bs=1M count=1024 status=progress
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap defaults 0 0' >> /etc/fstab
# Enable services
systemctl enable NetworkManager.service
systemctl enable sshd.service
systemctl enable cups.service
# Install yay & pamac
cd /home/juan
git clone https://aur.archlinux.org/yay.git && chmod -R 777 yay && cd yay
# makepkg -si --noconfirm && yay -S pamac-aur --noconfirm
# Install icons - https://github.com/erikdubois/ArchXfce4
# cd /home/juan
# git clone https://github.com/erikdubois/ArchXfce4.git
# cd /home/juan/ArchXfce4/installation
# ./300-install-themes-icons-cursors-conky-v1.sh
echo "-[Desktop environment]---------------------"
echo "1: KDE"
echo "2: XFCE"
# echo "3: GNOME"
# echo "4: CINNAMON"
# echo "5: MATE"
# echo "6: "
echo "n: don't install any desktop environment"
while true; do
read -p "Do you wish to install a Desktop environment? [1,n] : " ans
case $ans in
[1]* ) pacman -S xorg xorg-xinit xorg-server plasma-meta kde-applications sddm --noconfirm
echo "export DESKTOP_SESSION=plasma" >> ~/.xinitrc
echo "exec startplasma-x11" >> ~/.xinitrc
systemctl enable sddm; break;;
[2]* ) pacman -S xfce4 xfce4-goodies xfce4-taskmanager xfce4-whiskermenu-plugin lightdm lightdm-gtk-greeter \
lightdm-gtk-greeter-settings xorg xorg-xinit xorg-server archlinux-wallpaper breeze-gtk conky --noconfirm
echo "exec startxfce4" > ~/.xinitrc
systemctl enable lightdm; break;;
# [3]* ) pacman -S plasma-meta lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings breeze-gtk kde-gtk-config \
# xorg xorg-xinit xorg-server archlinux-wallpaper dolphin konsole spectacle yakuake plasma-browser-integration \
# kwalletmanager qt5-xmlpatterns --noconfirm
# # echo "exec startkde" > ~/.xinitrc
# echo "export DESKTOP_SESSION=plasma" >> ~/.xinitrc
# echo "exec startplasma-x11" >> ~/.xinitrc
# systemctl enable lightdm; break;;
# [3]* ) /scripts/de-gnome.sh; break;;
[Nn]* ) exit;;
esac
done
echo "------------------------------------------------"
echo "type 'reboot' to restart your system"
exit