-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstep4.sh
More file actions
89 lines (72 loc) · 2.76 KB
/
step4.sh
File metadata and controls
89 lines (72 loc) · 2.76 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
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
#Set timezone
clear
ls /usr/share/zoneinfo
read -p "Choose your region: " userregion
clear
ls /usr/share/zoneinfo/$userregion
read -p "Choose a city that shares your time zone: " usercity
ln -sf /usr/share/zoneinfo/$userregion/$usercity /etc/localtime
hwclock --systohc
#localization
#TODO: locale choice
userlocale1="en_US.UTF-8"
userlocale2="en_US ISO-8859-1"
sed -i "/^#.* $userlocale1 /s/^#//" /etc/locale.gen
sed -i "/^#.* $userlocale2 /s/^#//" /etc/locale.gen
locale-gen
echo "LANG=$userlocale1" > /etc/locale.conf
#hostname
read -p "What will you name your computer?: " hostname
echo $hostname > /etc/hostname
clear
echo "Select a root password."
passwd
#GRUB install
bootmode=`cat /ApertureInstall/bootmode`
installdrive=`cat /ApertureInstall/installdrive`
if [ $bootmode = uefi ] ; then
pacman -S grub efibootmgr --noconfirm
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
elif [ $bootmode = bios ]; then
pacman -S grub --noconfirm
grub-install --target=i386-pc $installdrive
mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --target=i386-pc --recheck $installdrive
pacman -S linux --noconfirm
fi
clear
#add user
read -p "Type your desired username: " newusername
mkdir /home/$newusername
useradd -d /home/$newusername $newusername
chown $newusername /home/$newusername
passwd $newusername
usermod --append --groups wheel $newusername
sed -i '/%wheel ALL=(ALL) ALL/s/^#//g' /etc/sudoers
#aperture configs, default shell
chsh -s /bin/zsh
curl https://raw.githubusercontent.com/ApertureLinux/Configuration/main/.zshrc > /home/$newusername/.zshrc
#install UX stuff
#detect gpu, set correct drivers to variable (done? gotta test)
if lspci -v | grep "Radeon"; then
correctpackages="xf86-video-amdgpu mesa lib32-mesa"
elif lspci -v | grep "Nvidia"; then
correctpackages="nvidia nvidia-utils lib32-nvidia-utils"
elif lspci -v | grep "Intel Corporation HD Graphics"; then
correctpackages= "xf86-video-intel mesa lib32-mesa"
elif lspci -v | grep "VMWare"; then
correctpackages="virtualbox-guest-utils"
elif lspci -v | grep "Hyper-V"; then
correctpackages="xf86-video-fbdev"
fi
#ask what DE user wants, set appropriate packages to variable
correctpackages="$correctdrivers xorg-server xorg-apps xorg-xinit i3 numlockx dmenu"
sudo pacman -S $correctpackages lightdm lightdm-gtk-greeter xterm noto-fonts ttf-ubuntu-font-family ttf-dejavu ttf-freefont ttf-liberation ttf-droid ttf-inconsolata ttf-roboto terminus-font ttf-font-awesome alsa-utils alsa-plugins alsa-lib pavucontrol dmenu firefox
sudo systemctl enable lightdm
sudo systemctl start lightdm
echo "Aperture Linux is probably now installed on your system~! Rebooting in 5 seconds."
sleep 5 && reboot