|
|
@ -1,72 +1,86 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inf() {
|
|
|
|
|
|
|
|
echo -e "\e[1m♠ $@\e[0m"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
err() {
|
|
|
|
|
|
|
|
echo -e "\e[1m\e[31m✗ $@\e[0m"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
response=""
|
|
|
|
|
|
|
|
prompt() {
|
|
|
|
|
|
|
|
printf "\e[1m\e[33m$@ : \e[0m"
|
|
|
|
|
|
|
|
read response
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TZ="/usr/share/zoneinfo/FUCK/OFF"
|
|
|
|
TZ="/usr/share/zoneinfo/FUCK/OFF"
|
|
|
|
|
|
|
|
|
|
|
|
while [[ ! -f $TZ ]]; do
|
|
|
|
while [[ ! -f $TZ ]]; do
|
|
|
|
printf "Pick a time zone (Format: America/New_York , Europe/London, etc): "
|
|
|
|
prompt "Pick a time zone (Format: America/New_York , Europe/London, etc)"
|
|
|
|
read PT
|
|
|
|
PT="$response"
|
|
|
|
TZ="/usr/share/zoneinfo/${PT}"
|
|
|
|
TZ="/usr/share/zoneinfo/${PT}"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
ln -sf $TZ /etc/localtime
|
|
|
|
ln -sf $TZ /etc/localtime
|
|
|
|
echo "Set TZ to ${TZ}"
|
|
|
|
inf "Set TZ to ${TZ}"
|
|
|
|
echo "Syncing hardware offset"
|
|
|
|
inf "Syncing hardware offset"
|
|
|
|
hwclock --systohc
|
|
|
|
hwclock --systohc
|
|
|
|
|
|
|
|
|
|
|
|
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
|
|
|
|
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
|
|
|
|
echo "LANG=en_US.UTF-8" > /etc/locale.conf
|
|
|
|
echo "LANG=en_US.UTF-8" > /etc/locale.conf
|
|
|
|
|
|
|
|
|
|
|
|
printf "Do you need more locales than just en_US? (y/N): "
|
|
|
|
prompt "Do you need more locales than just en_US? (y/N)"
|
|
|
|
read MORE
|
|
|
|
MORE="$response"
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$MORE" == "y" || "$MORE" == "Y" ]]; then
|
|
|
|
if [[ "$MORE" == "y" || "$MORE" == "Y" ]]; then
|
|
|
|
printf "Preferred editor: "
|
|
|
|
prompt "Preferred editor"
|
|
|
|
read PGRM
|
|
|
|
PGRM="$response"
|
|
|
|
if [[ -x "$(command -v ${PGRM})" ]]; then
|
|
|
|
if [[ -x "$(command -v ${PGRM})" ]]; then
|
|
|
|
echo "Attempting to install ${PGRM}"
|
|
|
|
inf "Attempting to install ${PGRM}"
|
|
|
|
pacman -Sy ${PGRM} --noconfirm
|
|
|
|
pacman -Sy ${PGRM} --noconfirm
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "When we open the file, please remove the leading # before any locales you need."
|
|
|
|
inf "When we open the file, please remove the leading # before any locales you need."
|
|
|
|
echo "Then, save and exit.\nPress enter."
|
|
|
|
inf "Then, save and exit.\nPress enter."
|
|
|
|
read
|
|
|
|
read
|
|
|
|
${PGRM} /etc/locale.gen
|
|
|
|
${PGRM} /etc/locale.gen
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Generating selected locales."
|
|
|
|
inf "Generating selected locales."
|
|
|
|
locale-gen
|
|
|
|
locale-gen
|
|
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo "en_US was set as system primary. After install, you can edit /etc/locale.conf to change the primary if desired."
|
|
|
|
inf "en_US was set as system primary. After install, you can edit /etc/locale.conf to change the primary if desired."
|
|
|
|
echo "Press enter"
|
|
|
|
inf "Press enter"
|
|
|
|
read
|
|
|
|
prompt ""
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -f /keymap ]]; then
|
|
|
|
if [[ -f /keymap ]]; then
|
|
|
|
echo "You set a custom keymap. We're making that change to the new system, too."
|
|
|
|
inf "You set a custom keymap. We're making that change to the new system, too."
|
|
|
|
KMP=$(cat /keymap)
|
|
|
|
KMP=$(cat /keymap)
|
|
|
|
rm /keymap
|
|
|
|
rm /keymap
|
|
|
|
echo "KEYMAP=${KMP}" > /etc/vconsole.conf
|
|
|
|
echo "KEYMAP=${KMP}" > /etc/vconsole.conf
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
printf "System hostname: "
|
|
|
|
prompt "System hostname"
|
|
|
|
read HOSTNAME
|
|
|
|
HOSTNAME="$response"
|
|
|
|
echo ${HOSTNAME} > /etc/hostname
|
|
|
|
echo ${HOSTNAME} > /etc/hostname
|
|
|
|
echo "127.0.0.1 localhost" > /etc/hosts
|
|
|
|
echo "127.0.0.1 localhost" > /etc/hosts
|
|
|
|
printf "Would you like IPV6? (y/N)"
|
|
|
|
prompt "Would you like IPV6? (y/N)"
|
|
|
|
read IPS
|
|
|
|
IPS="$response"
|
|
|
|
if [[ "$IPS" == "y" || "$IPS" == "Y" ]]; then
|
|
|
|
if [[ "$IPS" == "y" || "$IPS" == "Y" ]]; then
|
|
|
|
echo "::1 localhost" >> /etc/hosts
|
|
|
|
echo "::1 localhost" >> /etc/hosts
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME}" >> /etc/hosts
|
|
|
|
echo "127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME}" >> /etc/hosts
|
|
|
|
|
|
|
|
|
|
|
|
echo "Password for root"
|
|
|
|
inf "Password for root"
|
|
|
|
passwd
|
|
|
|
passwd
|
|
|
|
|
|
|
|
|
|
|
|
printf "Your username: "
|
|
|
|
prompt "Your username"
|
|
|
|
read UN
|
|
|
|
UN="$response"
|
|
|
|
useradd -m ${UN}
|
|
|
|
useradd -m ${UN}
|
|
|
|
usermod -aG wheel ${UN}
|
|
|
|
usermod -aG wheel ${UN}
|
|
|
|
echo "Set password for ${UN}"
|
|
|
|
inf "Set password for ${UN}"
|
|
|
|
passwd ${UN}
|
|
|
|
passwd ${UN}
|
|
|
|
echo >> /etc/sudoers
|
|
|
|
echo >> /etc/sudoers
|
|
|
|
echo "# Enabled by Crystalinstall" >> /etc/sudoers
|
|
|
|
echo "# Enabled by Crystalinstall" >> /etc/sudoers
|
|
|
@ -88,16 +102,16 @@ systemctl enable NetworkManager
|
|
|
|
pacman-key --init
|
|
|
|
pacman-key --init
|
|
|
|
pacman-key --populate archlinux
|
|
|
|
pacman-key --populate archlinux
|
|
|
|
|
|
|
|
|
|
|
|
printf "Would you like to install a DE profile? (y/N): "
|
|
|
|
prompt "Would you like to install a DE profile? (y/N)"
|
|
|
|
read DEP
|
|
|
|
DEP="$response"
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$DEP" == "y" || "$DEP" == "Y" ]]; then
|
|
|
|
if [[ "$DEP" == "y" || "$DEP" == "Y" ]]; then
|
|
|
|
echo "- KDE"
|
|
|
|
inf "- KDE"
|
|
|
|
echo "- GNOME"
|
|
|
|
inf "- GNOME"
|
|
|
|
echo "- i3"
|
|
|
|
inf "- i3"
|
|
|
|
echo "(We'll add more as people ask)"
|
|
|
|
inf "(We'll add more as people ask)"
|
|
|
|
printf ": "
|
|
|
|
prompt ""
|
|
|
|
read DE
|
|
|
|
DE="$response"
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$DE" == "KDE" ]]; then
|
|
|
|
if [[ "$DE" == "KDE" ]]; then
|
|
|
|
pacman -Sy --noconfirm plasma kde-applications sddm
|
|
|
|
pacman -Sy --noconfirm plasma kde-applications sddm
|
|
|
@ -106,19 +120,19 @@ if [[ "$DEP" == "y" || "$DEP" == "Y" ]]; then
|
|
|
|
pacman -Sy --noconfirm gnome gnome-extra
|
|
|
|
pacman -Sy --noconfirm gnome gnome-extra
|
|
|
|
DM="gdm"
|
|
|
|
DM="gdm"
|
|
|
|
elif [[ "$DE" == "i3" ]]; then
|
|
|
|
elif [[ "$DE" == "i3" ]]; then
|
|
|
|
echo "Choose either i3 or i3-gaps in below prompt. Rest of group is your preference (or not"
|
|
|
|
inf "Choose either i3 or i3-gaps in below prompt. Rest of group is your preference (or not"
|
|
|
|
echo "Press enter"
|
|
|
|
inf "Press enter"
|
|
|
|
read
|
|
|
|
prompt ""
|
|
|
|
pacman -Sy i3 xorg-xinit xorg-server
|
|
|
|
pacman -Sy i3 xorg-xinit xorg-server
|
|
|
|
printf "Would you like a display manager? If so, provide the package name: "
|
|
|
|
prompt "Would you like a display manager? If so, provide the package name"
|
|
|
|
read ND
|
|
|
|
ND="$response"
|
|
|
|
if [[ "$ND" != "" ]]; then
|
|
|
|
if [[ "$ND" != "" ]]; then
|
|
|
|
echo "Ok, we'll install $ND"
|
|
|
|
inf "Ok, we'll install $ND"
|
|
|
|
DM="$ND"
|
|
|
|
DM="$ND"
|
|
|
|
pacman -Sy --noconfirm $DM
|
|
|
|
pacman -Sy --noconfirm $DM
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "Ok, not installing a display manager."
|
|
|
|
inf "Ok, not installing a display manager."
|
|
|
|
echo "We're setting up a default .xinitrc for you, though"
|
|
|
|
inf "We're setting up a default .xinitrc for you, though"
|
|
|
|
echo "exec i3" > /home/${UN}/.xinitrc
|
|
|
|
echo "exec i3" > /home/${UN}/.xinitrc
|
|
|
|
chown $UN:$UN /home/${UN}/.xinitrc
|
|
|
|
chown $UN:$UN /home/${UN}/.xinitrc
|
|
|
|
chmod +x /home/${UN}/.xinitrc
|
|
|
|
chmod +x /home/${UN}/.xinitrc
|
|
|
@ -127,20 +141,20 @@ if [[ "$DEP" == "y" || "$DEP" == "Y" ]]; then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$DM" != "" ]]; then
|
|
|
|
if [[ "$DM" != "" ]]; then
|
|
|
|
printf "Would you like to enable ${DM} for ${DE}? (Y/n)"
|
|
|
|
prompt "Would you like to enable ${DM} for ${DE}? (Y/n)"
|
|
|
|
read useDM
|
|
|
|
useDM="$response"
|
|
|
|
if [[ "$useDM" != "n" ]]; then
|
|
|
|
if [[ "$useDM" != "n" ]]; then
|
|
|
|
systemctl enable ${DM}
|
|
|
|
systemctl enable ${DM}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
printf "Would you like to add more packages? (Y/n): "
|
|
|
|
prompt "Would you like to add more packages? (Y/n)"
|
|
|
|
read MP
|
|
|
|
MP="$response"
|
|
|
|
if [[ "$MP" != "n" ]]; then
|
|
|
|
if [[ "$MP" != "n" ]]; then
|
|
|
|
printf "Write package names: "
|
|
|
|
prompt "Write package names"
|
|
|
|
read PKGNS
|
|
|
|
PKGNS="$response"
|
|
|
|
pacman -Sy --noconfirm ${PKGNS}
|
|
|
|
pacman -Sy --noconfirm ${PKGNS}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Installation complete"
|
|
|
|
inf "Installation complete"
|