1
0
Fork 0

replaced pamac with paru, added paru installation function, moved test section before thee start section, removed some local programs I don't use anymore, moved some instructions to setup_essentials

This commit is contained in:
Kim, Jimin 2021-10-08 12:16:06 +09:00
parent 75d844a06c
commit 273b1d106a

View file

@ -3,6 +3,7 @@
# don't remove line after package_install # don't remove line after package_install
# it will result in this syntax error: unexpected end of file # it will result in this syntax error: unexpected end of file
# #################### [ ESSENTIALS ] #################### # #################### [ ESSENTIALS ] ####################
# Installs essential packages and defining important functions # Installs essential packages and defining important functions
@ -48,15 +49,13 @@ title() {
} }
package_install() { package_install() {
pamac install "$@" paru -S --noconfirm "$@"
} }
package_remove() { package_remove() {
pamac remove "$@" paru -R --noconfirm "$@"
} }
# #################### [ DEFINING ESSENTIAL SETUP ] ####################
backup() { backup() {
dconf dump / > "$SCRIPT_DIR/dconf.conf" dconf dump / > "$SCRIPT_DIR/dconf.conf"
# copy /home/pomp directory # copy /home/pomp directory
@ -64,8 +63,25 @@ backup() {
sudo timeshift --create --comments "auto created by developomp setup script" sudo timeshift --create --comments "auto created by developomp setup script"
} }
install_paru() {
log "installing paru"
cd /tmp || (error "failed to move to /tmp for paru installation" && exit 1)
sudo pacman --noconfirm -S --needed base-devel git
git clone https://aur.archlinux.org/paru.git
cd ./paru && makepkg -si
cd .. && rm -rf ./paru
cd "$SCRIPT_DIR" || (error "failed to come back to working directory after installing paru" && exit 1)
}
setup_essentials() { setup_essentials() {
: # install paru if it does not exist
if ! command -v paru &> /dev/null; then
install_paru
fi
package_install dialog &> /dev/null
# enable multilib, color, parallel download, and total download in /etc/pacman.conf # enable multilib, color, parallel download, and total download in /etc/pacman.conf
} }
@ -74,12 +90,14 @@ remove_essentials() {
epiphany \ epiphany \
totem \ totem \
kvantum-qt5 \ kvantum-qt5 \
gnome-firmware \
gnome-color-manager \ gnome-color-manager \
manjaro-hello \ manjaro-hello \
gnome-layout-switcher \ gnome-layout-switcher \
} }
# #################### [ DEFINING SETUP ] #################### # #################### [ DEFINING SETUP ] ####################
# Define instructions on how to setup applications & stuff # Define instructions on how to setup applications & stuff
@ -418,18 +436,6 @@ setup_local() {
log "dnspy" log "dnspy"
fi fi
if [[ -d /media/pomp/data/programs/amidst ]]; then
log "amidst"
fi
if [[ -d /media/pomp/data/programs/mcaselector ]]; then
log "mcaselector"
fi
if [[ -d /media/pomp/data/programs/mineways ]]; then
log "mineways"
fi
if [[ -d /media/pomp/data/programs/tor-browser ]]; then if [[ -d /media/pomp/data/programs/tor-browser ]]; then
log "tor" log "tor"
fi fi
@ -612,9 +618,24 @@ setup_zoom() {
} }
# #################### [ START ] ####################
pamac install dialog &> /dev/null # #################### [ TEST ] ####################
# Tests if script is ready to be executed
# some stuff has to be done manually
if [[ ! $EUID -ne 0 ]]; then
error "DO NOT RUN THIS SCRIPT AS ROOT"
exit 1
fi
# check partition
# check if $RESET$BOLD/media/pomp/data$GREEN exists in fstab and is mounted
# check if OS is manjaro
# #################### [ START ] ####################
cd "$SCRIPT_DIR" || { cd "$SCRIPT_DIR" || {
error "FAILED TO FIND SCRIPT DIRECTORY" error "FAILED TO FIND SCRIPT DIRECTORY"
@ -636,30 +657,11 @@ fi
echo echo
# #################### [ TEST ] ####################
# Tests if script is ready to be executed
# some stuff has to be done manually
title "TEST"
log "testing if script is ready to be exdecuted"
if [[ ! $EUID -ne 0 ]]; then
error "DO NOT RUN THIS SCRIPT AS ROOT"
exit 1
fi
# check partition
# check if $RESET$BOLD/media/pomp/data$GREEN exists in fstab and is mounted
# check if OS is manjaro
echo
echo
log "TEST phase complete!"
# #################### [ MAIN ] #################### # #################### [ MAIN ] ####################
setup_essentials
cmd=(dialog --separate-output --checklist "Select Setup Operations to perform" 20 50 5) cmd=(dialog --separate-output --checklist "Select Setup Operations to perform" 20 50 5)
options=( options=(
@ -765,6 +767,7 @@ done
rm -rf "$SCRIPT_DIR/tmp" rm -rf "$SCRIPT_DIR/tmp"
# #################### [ DONE ] #################### # #################### [ DONE ] ####################
# print some info after installation # print some info after installation