first modification

This commit is contained in:
Lukas Graz 2022-04-15 15:15:15 +02:00
parent 96b668a6e5
commit c789d0c6a4
16 changed files with 310 additions and 320 deletions

View File

@ -1,23 +0,0 @@
# Preinstall
Contains the steps necessary to configure and pacstrap the install to selected drive.
# Overview
Creates the btrfs subvolumes.
# Functions
* [mountallsubvol()](#mountallsubvol)
* [subvolumesetup()](#subvolumesetup)
## mountallsubvol()
Mount all btrfs subvolumes after root has been mounted.
## subvolumesetup()
BTRFS subvolulme creation and mounting.

View File

@ -1,8 +0,0 @@
# Setup
Configures installed system, installs base packages, and creates user.
# Functions

View File

@ -1,8 +0,0 @@
# User
User customizations and AUR package installation.
# Functions

View File

@ -1,8 +0,0 @@
# Post-Setup
Finalizing installation configurations and cleaning up after script.
# Functions

View File

@ -1,8 +0,0 @@
# ArchTitus
Entrance script that launches children scripts for each phase of installation.
# Functions

View File

@ -1,98 +0,0 @@
# Startup
This script will ask users about their prefrences like disk, file system, timezone, keyboard layout, user name, password, etc.
# Settings
## General Settings
* **CONFIG_FILE** (string)[default: **$CONFIGS_DIR/setup.conf**]: Location of setup.conf to be used by set_option and all subsequent scripts.
# Functions
* [set_option()](#set_option)
* [select_option()](#select_option)
* [logo()](#logo)
* [filesystem()](#filesystem)
* [timezone()](#timezone)
* [keymap()](#keymap)
* [drivessd()](#drivessd)
* [diskpart()](#diskpart)
* [userinfo()](#userinfo)
* [aurhelper()](#aurhelper)
* [desktopenv()](#desktopenv)
* [installtype()](#installtype)
## set_option()
set options in setup.conf
### Output on stdout
* Output routed to startup.log
### Output on stderr
* # @stderror Output routed to startup.log
### Arguments
* **$1** (string): Configuration variable.
### Arguments
* **$2** (string): Configuration value.
## select_option()
Renders a text based list of options that can be selected by the
user using up, down and enter keys and returns the chosen option.
Arguments : list of options, maximum of 256
"opt1" "opt2" ...
Return value: selected index (0 for opt1, 1 for opt2 ...)
## logo()
Displays ArchTitus logo
_Function has no arguments._
## filesystem()
This function will handle file systems. At this movement we are handling only
btrfs and ext4. Others will be added in future.
## timezone()
Detects and sets timezone.
## keymap()
Set user's keyboard mapping.
## drivessd()
Choose whether drive is SSD or not.
## diskpart()
Disk selection for drive to be used with installation.
## userinfo()
Gather username and password to be used for installation.
## aurhelper()
Choose AUR helper.
## desktopenv()
Choose Desktop Environment
## installtype()
Choose whether to do full or minimal installation.

View File

@ -1,8 +1,5 @@
#!/bin/bash
#github-action genshdoc
#
# @file ArchTitus
# @brief Entrance script that launches children scripts for each phase of installation.
# Find the name of the folder the scripts are in
set -a

View File

@ -47,9 +47,9 @@ TIMELINE_CLEANUP="yes"
# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"
TIMELINE_LIMIT_HOURLY="5"
TIMELINE_LIMIT_DAILY="7"
TIMELINE_LIMIT_WEEKLY="0"
TIMELINE_LIMIT_HOURLY="3"
TIMELINE_LIMIT_DAILY="3"
TIMELINE_LIMIT_WEEKLY="3"
TIMELINE_LIMIT_MONTHLY="0"
TIMELINE_LIMIT_YEARLY="0"

147
my_notes.md Normal file
View File

@ -0,0 +1,147 @@
# ArchTitus - my Fork
**Description:** Arch install script
this script is from [GitHub](https://github.com/ChrisTitusTech/ArchTitus) and is modified by me
# To change
## boot
- dual boot for windows (dont delete partition)
- skip boot menu (show if 'shift' pressed down)
- do not use grub-theming
## package-install
- pacman-pkgs.txt
- replace pulseaudio with pipewire
- GPU packages
- check if all nessecary:
libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa
- aur-pkgs.txt
- basically all useless -> substitute with own
- openbox.txt
- gnome.txt
- filter some unnessecary stuff,
- inspect gnome-extras (this is installed if 'FULL')
**Other:**
deepin.txt
awesome.txt
lxde.txt
cinnamon.txt
mate.txt
budgie.txt
kde.txt
xfce.txt
### services
- dont disable dhcpcd.service?
## configs:
- visudo add:
Defaults env_keep +="PYTHONPATH"
Defaults editor=/usr/bin/nano
### Sudo no password
just comment lines in setup.sh?
### US to DE/CH
LOCALE_IDENTIFIER="en_US.UTF-8 UTF-8"
and in `1-setup.sh` set:
`sed -i 's/^#$LOCALE_IDENTIFIER/$LOCALE_IDENTIFIER/' /etc/locale.gen`
### delete zsh
in `2-user.sh`
### turn of terminal bell/beep
## CleanUp
`rm -rf $AUR_HELPER`
---
# Files Structure
## archtitus.sh
**Variables:**
`SCRIPT_DIR`
`SCRIPTS_DIR`
`CONFIGS_DIR`
**Purpose:**
runs all the other scripts
**misc:**
## scripts/startup.sh
**Variables:**
`CONFIG_FILE` = configs/setup.conf
**Purpose:**
define variables (saved to `configs/setup.conf`)
## configs/setup.conf
**Variables:**
`FS` : Filesystem, eg: "btrfs"
`TIMEZONE`
`KEYMAP`
`DISK`
`MOUNT_OPTIONS`="noatime,compress=zstd,ssd,commit=120" #if ssd
`USERNAME`
`PASSWORD`
`NAME_OF_MACHINE` : hostname
`AUR_HELPER` : e.g: "yay"
`DESKTOP_ENV` : e.g: "gnome"
`INSTALL_TYPE` : in {FULL MINIMAL}, determines number of apps added
**Purpose:**
config file
## scripts/0-preinstall.sh
**Variables:**
`iso` =CH
`partition2` & `partition3`
**Purpose:**
- optimize pacman-downloads-install
- whipes **ALL** data/partitions (including Windows) on $DISK and creates new partition table
**misc:**
## scripts/1-setup.sh
**Variables:**
`TOTAL_MEM`
**Purpose:**
- Setup / config:
- Network,
- Mirrors,
- n_cores (for build),
- Parallel Downloads,
- Lang&Locale
- sudo no password
- Installing
- packages from `pkg-files/pacman-pkgs.txt`
- install CPU-packages
- install GPU-packages
- adding user
**misc:**
## scripts/2-user.sh
**Variables:**
**Purpose:**
**misc:**
## scripts/3-post-setup.sh
**Variables:**
**Purpose:**
**misc:**
---
## scripts/kderice-backup.sh
**Variables:**
**Purpose:**
**misc:**
## scripts/kderice-restore.sh
**Variables:**
**Purpose:**
**misc:**

View File

@ -1,22 +1,22 @@
--END OF MINIMAL INSTALL--
autojump
brave-bin
bridge-utils
dxvk-bin
github-desktop-bin
lightly-git
lightlyshaders-git
mangohud
mangohud-common
nerd-fonts-fira-code
nordic-darker-standard-buttons-theme
nordic-darker-theme
nordic-kde-git
nordic-theme
ocs-url
plymouth-git
sddm-nordic-theme-git
snapper-gui-git
ttf-meslo
vde2
# autojump
# brave-bin
# bridge-utils
# dxvk-bin
# github-desktop-bin
# lightly-git
# lightlyshaders-git
# mangohud
# mangohud-common
# nerd-fonts-fira-code
# nordic-darker-standard-buttons-theme
# nordic-darker-theme
# nordic-kde-git
# nordic-theme
# ocs-url
# plymouth-git
# sddm-nordic-theme-git
# snapper-gui-git
# ttf-meslo
# vde2
zoom

View File

@ -1,3 +1,4 @@
base-devel
mesa
xorg
xorg-server
@ -5,7 +6,7 @@ xorg-apps
xorg-drivers
xorg-xkill
xorg-xinit
xterm
# xterm
binutils
dosfstools
linux-headers
@ -13,95 +14,104 @@ noto-fonts-emoji
usbutils
xdg-user-dirs
--END OF MINIMAL INSTALL--
alsa-plugins
alsa-utils
autoconf
automake
awesome-terminal-fonts
bash-completion
bind
bison
bluez
bluez-libs
bluez-utils
bridge-utils
# alsa-plugins
# alsa-utils
## autoconf
## automake
# awesome-terminal-fonts
# bash-completion
# bind
## bison
# bluez
# bluez-libs
# bluez-utils
# bridge-utils
btrfs-progs
celluloid
cmatrix
# celluloid
# cmatrix
code
cronie
cups
dialog
dmidecode
dnsmasq
dtc
# dmidecode
# dnsmasq
# dtc
efibootmgr
egl-wayland
# egl-wayland
exfat-utils
flex
## flex
fuse2
fuse3
fuseiso
gamemode
gcc
gimp
# fuseiso
# gamemode
## gcc
# gimp
gparted
gptfdisk
grub-customizer
gst-libav
gst-plugins-good
gst-plugins-ugly
haveged
# grub-customizer
# gst-libav
# gst-plugins-good
# gst-plugins-ugly
# haveged
htop
jdk-openjdk
kitty
libdvdcss
libtool
lsof
lutris
lzop
m4
make
neofetch
# jdk-openjdk
# kitty
# libdvdcss
## libtool
# lsof
# lutris
# lzop
## m4
## make
# neofetch
ntfs-3g
ntp
openbsd-netcat
# openbsd-netcat
openssh
os-prober
p7zip
papirus-icon-theme
patch
picom
# p7zip
# papirus-icon-theme
## patch
# picom
pkgconf
powerline-fonts
pulseaudio
pulseaudio-alsa
pulseaudio-bluetooth
python-notify2
python-psutil
python-pyqt5
python-pip
qemu
snap-pac
snapper
steam
swtpm
synergy
# powerline-fonts
# pulseaudio
# pulseaudio-alsa
# pulseaudio-bluetooth
# python-notify2
# python-psutil
# python-pyqt5
# python-pip
# qemu
# snap-pac
# snapper
# steam
# swtpm
# synergy
terminus-font
traceroute
ttf-droid
ttf-hack
ttf-roboto
ufw
unrar
unzip
# traceroute
# ttf-droid
# ttf-hack
# ttf-roboto
# ufw
# unrar
# unzip
virt-manager
virt-viewer
which
wine-gecko
wine-mono
winetricks
## which
# wine-gecko
# wine-mono
# winetricks
zip
zsh
zsh-syntax-highlighting
zsh-autosuggestions
# zsh
# zsh-syntax-highlighting
# zsh-autosuggestions
#
##########################################
### MY PACKAGES
##########################################
gst-plugin-pipewire
pipewire
pipewire-alsa
pipewire-jack
pipewire-pulse

View File

@ -8,9 +8,7 @@
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
#-------------------------------------------------------------------------
#github-action genshdoc
#
# @file Preinstall
# @brief Contains the steps necessary to configure and pacstrap the install to selected drive.
echo -ne "
-------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗
@ -26,11 +24,11 @@ echo -ne "
Setting up mirrors for optimal download
"
source $CONFIGS_DIR/setup.conf
iso=$(curl -4 ifconfig.co/country-iso)
iso=$(curl -4 ifconfig.co/country-iso) #X output: "CH
timedatectl set-ntp true
pacman -S --noconfirm archlinux-keyring #update keyrings to latest to prevent packages failing to install
pacman -S --noconfirm --needed pacman-contrib terminus-font
setfont ter-v22b
setfont ter-v22b #X change font
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
pacman -S --noconfirm --needed reflector rsync grub
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
@ -54,7 +52,7 @@ echo -ne "
"
umount -A --recursive /mnt # make sure everything is unmounted before we start
# disk prep
sgdisk -Z ${DISK} # zap all on disk
sgdisk -Z ${DISK} # zap all on disk #X destroys/wipes the whole drive
sgdisk -a 2048 -o ${DISK} # new gpt disk 2048 alignment
# create partitions
@ -72,7 +70,6 @@ echo -ne "
Creating Filesystems
-------------------------------------------------------------------------
"
# @description Creates the btrfs subvolumes.
createsubvolumes () {
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
@ -81,7 +78,6 @@ createsubvolumes () {
btrfs subvolume create /mnt/@.snapshots
}
# @description Mount all btrfs subvolumes after root has been mounted.
mountallsubvol () {
mount -o ${MOUNT_OPTIONS},subvol=@home ${partition3} /mnt/home
mount -o ${MOUNT_OPTIONS},subvol=@tmp ${partition3} /mnt/tmp
@ -89,7 +85,6 @@ mountallsubvol () {
mount -o ${MOUNT_OPTIONS},subvol=@.snapshots ${partition3} /mnt/.snapshots
}
# @description BTRFS subvolulme creation and mounting.
subvolumesetup () {
# create nonroot subvolumes
createsubvolumes
@ -155,7 +150,7 @@ pacstrap /mnt base base-devel linux linux-firmware vim nano sudo archlinux-keyri
echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
cp -R ${SCRIPT_DIR} /mnt/root/ArchTitus
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
#X dual boot hier? os-prober????
genfstab -L /mnt >> /mnt/etc/fstab
echo "
Generated /etc/fstab:
@ -177,6 +172,7 @@ echo -ne "
-------------------------------------------------------------------------
"
TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
# my Acer swift3 has more than 8000000kb ram
if [[ $TOTAL_MEM -lt 8000000 ]]; then
# Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything.
mkdir -p /mnt/opt/swap # make a dir that we can apply NOCOW to to make it btrfs-friendly.

View File

@ -1,8 +1,5 @@
#!/usr/bin/env bash
#github-action genshdoc
#
# @file Setup
# @brief Configures installed system, installs base packages, and creates user.
echo -ne "
-------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗
@ -22,7 +19,7 @@ echo -ne "
Network Setup
-------------------------------------------------------------------------
"
pacman -S --noconfirm --needed networkmanager dhclient
pacman -S --noconfirm --needed networkmanager dhclient #X dhcclient unnecessary?
systemctl enable --now NetworkManager
echo -ne "
-------------------------------------------------------------------------
@ -48,21 +45,33 @@ sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg
fi
echo -ne "
-------------------------------------------------------------------------
Setup Language to US and set locale
Setup Language to DE and set locale
-------------------------------------------------------------------------
"
sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
# my locale on my ACER:
# System Locale: LANG=en_US.UTF-8
# LC_TIME=de_CH.UTF-8
# VC Keymap: de-latin1-nodeadkeys
# X11 Layout: de
# X11 Model: acer_laptop
# X11 Variant: nodeadkeys
#
# sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/^#de_CH.UTF-8 UTF-8/de_CH.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
timedatectl --no-ask-password set-timezone ${TIMEZONE}
timedatectl --no-ask-password set-ntp 1
localectl --no-ask-password set-locale LANG="en_US.UTF-8" LC_TIME="en_US.UTF-8"
# localectl --no-ask-password set-locale LANG="en_US.UTF-8" LC_TIME="en_US.UTF-8"
localectl --no-ask-password set-locale LANG="en_US.UTF-8" LC_TIME="de_CH.UTF-8"
ln -s /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
# Set keymaps
localectl --no-ask-password set-keymap ${KEYMAP}
localectl set-x11-keymap de acer_laptop nodeadkeys
# Add sudo no password rights
sed -i 's/^# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers
sed -i 's/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers
#X Sudo shall require password
# # Add sudo no password rights
# sed -i 's/^# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers
# sed -i 's/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers
#Add parallel downloading
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
@ -76,7 +85,7 @@ echo -ne "
Installing Base System
-------------------------------------------------------------------------
"
# sed $INSTALL_TYPE is using install type to check for MINIMAL installation, if it's true, stop
# sed $INSTALL_TYPE is using install type to check for MINIMAL installation, if it's true, stop #X 'trims' the file
# stop the script and move on, not installing any more packages below that line
if [[ ! $DESKTOP_ENV == server ]]; then
sed -n '/'$INSTALL_TYPE'/q;p' $HOME/ArchTitus/pkg-files/pacman-pkgs.txt | while read line
@ -85,8 +94,10 @@ if [[ ! $DESKTOP_ENV == server ]]; then
# If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line
continue
fi
if [[ ! $line = \#* ]] ; then
echo "INSTALLING: ${line}"
sudo pacman -S --noconfirm --needed ${line}
fi
done
fi
echo -ne "

View File

@ -1,8 +1,5 @@
#!/usr/bin/env bash
#github-action genshdoc
#
# @file User
# @brief User customizations and AUR package installation.
echo -ne "
-------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗
@ -20,10 +17,11 @@ source $HOME/ArchTitus/configs/setup.conf
cd ~
mkdir "/home/$USERNAME/.cache"
touch "/home/$USERNAME/.cache/zshhistory"
git clone "https://github.com/ChrisTitusTech/zsh"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
ln -s "~/zsh/.zshrc" ~/.zshrc
#X DELETE:
# touch "/home/$USERNAME/.cache/zshhistory"
# git clone "https://github.com/ChrisTitusTech/zsh"
# git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
# ln -s "~/zsh/.zshrc" ~/.zshrc
echo -ne "
-------------------------------------------------------------------------
@ -62,8 +60,10 @@ if [[ ! $AUR_HELPER == none ]]; then
# If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line
continue
fi
if [[ ! $line = \#* ]] ; then
echo "INSTALLING: ${line}"
$AUR_HELPER -S --noconfirm --needed ${line}
fi
done
fi

View File

@ -1,8 +1,5 @@
#!/usr/bin/env bash
#github-action genshdoc
#
# @file Post-Setup
# @brief Finalizing installation configurations and cleaning up after script.
echo -ne "
-------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗
@ -34,22 +31,22 @@ echo -ne "
if [[ "${FS}" == "luks" ]]; then
sed -i "s%GRUB_CMDLINE_LINUX_DEFAULT=\"%GRUB_CMDLINE_LINUX_DEFAULT=\"cryptdevice=UUID=${ENCRYPTED_PARTITION_UUID}:ROOT root=/dev/mapper/ROOT %g" /etc/default/grub
fi
# set kernel parameter for adding splash screen
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[^"]*/& splash /' /etc/default/grub
# # set kernel parameter for adding splash screen
# sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[^"]*/& splash /' /etc/default/grub
echo -e "Installing CyberRe Grub theme..."
THEME_DIR="/boot/grub/themes"
THEME_NAME=CyberRe
echo -e "Creating the theme directory..."
mkdir -p "${THEME_DIR}/${THEME_NAME}"
echo -e "Copying the theme..."
cd ${HOME}/ArchTitus
cp -a configs${THEME_DIR}/${THEME_NAME}/* ${THEME_DIR}/${THEME_NAME}
# echo -e "Installing CyberRe Grub theme..."
# THEME_DIR="/boot/grub/themes"
# THEME_NAME=CyberRe
# echo -e "Creating the theme directory..."
# mkdir -p "${THEME_DIR}/${THEME_NAME}"
# echo -e "Copying the theme..."
# cd ${HOME}/ArchTitus
# cp -a configs${THEME_DIR}/${THEME_NAME}/* ${THEME_DIR}/${THEME_NAME}
echo -e "Backing up Grub config..."
cp -an /etc/default/grub /etc/default/grub.bak
echo -e "Setting the theme as the default..."
grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
# echo -e "Setting the theme as the default..."
# grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
# echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
echo -e "Updating grub..."
grub-mkconfig -o /boot/grub/grub.cfg
echo -e "All set!"
@ -115,7 +112,7 @@ echo -ne "
Creating Snapper Config
-------------------------------------------------------------------------
"
# snapper is the snapshot-btrfs tool helper
SNAPPER_CONF="$HOME/ArchTitus/configs/etc/snapper/configs/root"
mkdir -p /etc/snapper/configs/
cp -rfv ${SNAPPER_CONF} /etc/snapper/configs/

View File

@ -1,28 +1,23 @@
#!/usr/bin/env bash
#github-action genshdoc
#
# @file Startup
# @brief This script will ask users about their prefrences like disk, file system, timezone, keyboard layout, user name, password, etc.
# @stdout Output routed to startup.log
# @stderror Output routed to startup.log
# This script will ask users about their prefrences
# like disk, file system, timezone, keyboard layout,
# user name, password, etc.
# @setting-header General Settings
# @setting CONFIG_FILE string[$CONFIGS_DIR/setup.conf] Location of setup.conf to be used by set_option and all subsequent scripts.
# set up a config file
CONFIG_FILE=$CONFIGS_DIR/setup.conf
if [ ! -f $CONFIG_FILE ]; then # check if file exists
touch -f $CONFIG_FILE # create file if not exists
fi
# @description set options in setup.conf
# @arg $1 string Configuration variable.
# @arg $2 string Configuration value.
# set options in setup.conf
set_option() {
if grep -Eq "^${1}.*" $CONFIG_FILE; then # check if option exists
sed -i -e "/^${1}.*/d" $CONFIG_FILE # delete option if exists
fi
echo "${1}=${2}" >>$CONFIG_FILE # add option
}
# @description Renders a text based list of options that can be selected by the
# Renders a text based list of options that can be selected by the
# user using up, down and enter keys and returns the chosen option.
#
# Arguments : list of options, maximum of 256
@ -131,8 +126,6 @@ select_option() {
return $(( $active_col + $active_row * $colmax ))
}
# @description Displays ArchTitus logo
# @noargs
logo () {
# This will be shown on every set as user is progressing
echo -ne "
@ -148,9 +141,9 @@ echo -ne "
------------------------------------------------------------------------
"
}
# @description This function will handle file systems. At this movement we are handling only
# btrfs and ext4. Others will be added in future.
filesystem () {
# This function will handle file systems. At this movement we are handling only
# btrfs and ext4. Others will be added in future.
echo -ne "
Please Select your file system for both boot and root
"
@ -181,7 +174,6 @@ done
*) echo "Wrong option please select again"; filesystem;;
esac
}
# @description Detects and sets timezone.
timezone () {
# Added this from arch wiki https://wiki.archlinux.org/title/System_time
time_zone="$(curl --fail https://ipapi.co/timezone)"
@ -204,7 +196,6 @@ case ${options[$?]} in
*) echo "Wrong option. Try again";timezone;;
esac
}
# @description Set user's keyboard mapping.
keymap () {
echo -ne "
Please select key board layout from this list"
@ -218,7 +209,6 @@ echo -ne "Your key boards layout: ${keymap} \n"
set_option KEYMAP $keymap
}
# @description Choose whether drive is SSD or not.
drivessd () {
echo -ne "
Is this an ssd? yes/no:
@ -236,7 +226,7 @@ case ${options[$?]} in
esac
}
# @description Disk selection for drive to be used with installation.
# selection for disk type
diskpart () {
echo -ne "
------------------------------------------------------------------------
@ -259,8 +249,6 @@ echo -e "\n${disk%|*} selected \n"
drivessd
}
# @description Gather username and password to be used for installation.
userinfo () {
read -p "Please enter your username: " username
set_option USERNAME ${username,,} # convert to lower case as in issue #109
@ -282,7 +270,6 @@ read -rep "Please enter your hostname: " nameofmachine
set_option NAME_OF_MACHINE $nameofmachine
}
# @description Choose AUR helper.
aurhelper () {
# Let the user choose AUR helper from predefined list
echo -ne "Please enter your desired AUR helper:\n"
@ -292,7 +279,6 @@ aurhelper () {
set_option AUR_HELPER $aur_helper
}
# @description Choose Desktop Environment
desktopenv () {
# Let the user choose Desktop Enviroment from predefined list
echo -ne "Please select your desired Desktop Enviroment:\n"
@ -302,7 +288,6 @@ desktopenv () {
set_option DESKTOP_ENV $desktop_env
}
# @description Choose whether to do full or minimal installation.
installtype () {
echo -ne "Please select type of installation:\n\n
Full install: Installs full featured desktop enviroment, with added apps and themes needed for everyday use\n