<commit_before>#!/usr/bin/env bash
# shellcheck disable=SC1091

# Use this script for any Linux-based specific installations

source ./bin/utils.sh

packages="$1"
fonts="$2"
config="$3"
# shellcheck disable=SC2034
xcode="$4"
gui="$5"
yes="$6"

if [[ $gui -eq 0 ]]
then
    CPOPT=-av
else
    CPOPT=-a
fi

INSTALLDIR=${TMPDIR:-/tmp}/dotfiles-installer
mkdir -p "$INSTALLDIR"

declare -a deb_extra_packages=()

installFonts () {
    g_bold "Installing Fonts"
    mkdir -p "${HOME}/.fonts"
    for dir in fonts/*
    do
        if [ -d "$dir" ]
        then
            fontname=$(basename "$dir")
            if [ -d "${HOME}/.fonts/${fontname}" ]
            then
                g_arrow "${fontname} is already installed"
            else
                cp $CPOPT "$dir" "${HOME}/.fonts" && g_success "Installed font: ${fontname}" || g_error "Unable to install font: ${fontname}"
            fi
        fi
    done
    fc-cache
}

installConfig () {
    g_bold "Installing Configuration Files"
    mkdir -p "${HOME}/.config"
    cp $CPOPT config/* "${HOME}/.config" && g_success "Installed config files" || g_error "Unable to install config files"
    mkdir -p "${HOME}/.local"
    cp $CPOPT local/* "${HOME}/.local" && g_success "Installed share files" || g_error "Unable to install share files"
    # fix the absolute path in qt5ct.conf
    if sed -i -- "s:color_scheme_path=.*:color_scheme_path=${HOME}/.config/qt5ct/colors/one dark.conf:g" "${HOME}/.config/qt5ct/qt5ct.conf"
    then
        g_success "Updated QT5 config file"
    else
        g_error "Unable to update QT5 config file"
    fi
    mkdir -p "${HOME}/.icons"
    for tarball in icons/*.tar.tgz
    do
        if tar -x -f "$tarball" -z -C "${HOME}/.icons"
        then
            g_success "Installed mouse cursor: $(basename -s .tar.gz "$tarball")"
        else
            g_error "Unable to install mouse cursor: $(basename -s .tar.gz "$tarball")"
        fi
    done
}

promptForPassword () {
    if [[ $gui -eq 1 ]]
    then
        zenity --info --text="Please return to the terminal to enter your password to allow software installation." \<commit_msg>Fix typo in mouse cursor install routine<commit_after>#!/usr/bin/env bash
# shellcheck disable=SC1091

# Use this script for any Linux-based specific installations

source ./bin/utils.sh

packages="$1"
fonts="$2"
config="$3"
# shellcheck disable=SC2034
xcode="$4"
gui="$5"
yes="$6"

if [[ $gui -eq 0 ]]
then
    CPOPT=-av
else
    CPOPT=-a
fi

INSTALLDIR=${TMPDIR:-/tmp}/dotfiles-installer
mkdir -p "$INSTALLDIR"

declare -a deb_extra_packages=()

installFonts () {
    g_bold "Installing Fonts"
    mkdir -p "${HOME}/.fonts"
    for dir in fonts/*
    do
        if [ -d "$dir" ]
        then
            fontname=$(basename "$dir")
            if [ -d "${HOME}/.fonts/${fontname}" ]
            then
                g_arrow "${fontname} is already installed"
            else
                cp $CPOPT "$dir" "${HOME}/.fonts" && g_success "Installed font: ${fontname}" || g_error "Unable to install font: ${fontname}"
            fi
        fi
    done
    fc-cache
}

installConfig () {
    g_bold "Installing Configuration Files"
    mkdir -p "${HOME}/.config"
    cp $CPOPT config/* "${HOME}/.config" && g_success "Installed config files" || g_error "Unable to install config files"
    mkdir -p "${HOME}/.local"
    cp $CPOPT local/* "${HOME}/.local" && g_success "Installed share files" || g_error "Unable to install share files"
    # fix the absolute path in qt5ct.conf
    if sed -i -- "s:color_scheme_path=.*:color_scheme_path=${HOME}/.config/qt5ct/colors/one dark.conf:g" "${HOME}/.config/qt5ct/qt5ct.conf"
    then
        g_success "Updated QT5 config file"
    else
        g_error "Unable to update QT5 config file"
    fi
    mkdir -p "${HOME}/.icons"
    for tarball in icons/*.tar.gz
    do
        if tar -x -f "$tarball" -z -C "${HOME}/.icons"
        then
            g_success "Installed mouse cursor: $(basename -s .tar.gz "$tarball")"
        else
            g_error "Unable to install mouse cursor: $(basename -s .tar.gz "$tarball")"
        fi
    done
}

promptForPassword () {
    if [[ $gui -eq 1 ]]
    then
        zenity --info --text="Please return to the terminal to enter your password to allow software installation." \
{'fraction_non_alphanumeric': 0.14365671641791045, 'fraction_numerical': 0.010261194029850746, 'mean_word_length': 2.444979919678715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1151527', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1374, 'n_words': 424}