Last active
April 22, 2022 03:26
-
-
Save haridhayal11/1f0b2fe1cb31a215f4039d067060828f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
timedatectl set-ntp true | |
read -p " Timezone Selection | |
1. List All Timezones | |
2. Enter Timezone " TZCHECK | |
case $TZCHECK in | |
[1]* ) timedatectl list-timezones;; | |
[2]* ) read -p " Enter Timezone [eg: Asia/Colombo]" TZ | |
timedatectl set-timezone $TZ;; | |
* ) echo "Please select [1/2]";; | |
esac | |
read -p "Do you want to sync sytemclock & HW Clock?[Y/n]" CLOCK | |
case $CLOCK in | |
[Yy]* ) hwclock --systohc;; | |
[Nn]* ) echo "";; | |
* ) echo "Please answer [Y/n]";; | |
esac | |
read -p "Do you want to set (en_US.UTF-8) as System Locale?[Y/n]" LOCALE | |
case $LOCALE in | |
[Yy]* ) echo LANG=en_US.UTF-8 >> /etc/locale.conf;; | |
[Nn]* ) read -p "Enter the your System Locale Option" CUSTOMLOCALE | |
echo LANG=$CUSTOMLOCALE >> /etc/locale.conf;; | |
* ) echo "Please answer [Y/n]";; | |
esac | |
read -p "Enter the hostname for this system" HOSTNAME | |
echo $HOSTNAME >> /etc/hostname | |
echo " | |
127.0.0.1 localhost | |
::1 localhost | |
127.0.1.1 $HOSTNAME.localdomain $HOSTNAME" >> /etc/hosts | |
echo "Enter password for root user" | |
passwd | |
echo "Installing essential packages" | |
pacman -S grub grub-btrfs efibootmgr base-devel linux-headers networkmanager network-manager-applet wpa_supplicant dialog os-prober mtools dosfstools reflector git wget ntfs-3g | |
systemctl enable NetworkManager | |
read -p "Do you want to enable bluetooth support?[Y/n]" BLUETOOTH | |
case $BLUETOOTH in | |
[Yy]* ) pacman -S bluez bluez-utils | |
systemctl enable bluetooth ;; | |
[Nn]* ) echo "";; | |
* ) echo "Please answer [Y/n]";; | |
esac | |
mv /etc/mkinitcpio.conf /etc/mkinitcpio.conf.orig | |
touch /etc/mkinitcpio.conf | |
echo " | |
MODULES=() | |
BINARIES=() | |
FILES=() | |
HOOKS=(base udev autodetect modconf block filesystems keyboard btrfs)" > /etc/mkinitcpio.conf | |
mkinitcpio -p linux | |
echo "Installing GRUB" | |
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id Arch | |
grub-mkconfig -o /boot/grub/grub.cfg | |
read -p "Enter username for new user" NEWUSER | |
useradd -mG wheel $NEWUSER | |
echo "Emter Password for $NEWUSER" | |
passwd $NEWUSER | |
sed -i "s/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" /etc/sudoers.tmp | |
read -p "Select a desktop environment | |
1. Gnome | |
2. Xfce | |
3. KDE " DESKTOPENV | |
case $DESKTOPENV in | |
[1]* ) pacman -S gnome xdg-utils xdg-user-dirs | |
systemctl enable gdm;; | |
#[2]* ) pacman -S xfce4;; | |
[3]* ) pacman -S plasma-desktop sddm konsole plasma-nm | |
systemctl enable sddm;; | |
* ) echo "Please select [1/2/3]";; | |
esac | |
mkdir -p /tmp/yay | |
cd /tmp/yay | |
pacman -S --needed git base-devel | |
git clone https://aur.archlinux.org/yay-bin.git | |
cd yay-bin | |
makepkg -si | |
cd / | |
rm -rf /tmp/yay | |
exit | |
umount -l /mnt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment