<commit_before>#!/usr/bin/env bash

needed_packages() {
    # Check package needed
    INSTALLED=$(yaourt -Q)
    TOINSTALL=""
    for PACKAGE in $INSTALL; do
        ISINSTALLED=$(echo "$INSTALLED" | grep "/$PACKAGE")
        if [ $? -eq 1 ]; then
            TOINSTALL="$TOINSTALL $PACKAGE"
        fi
    done

    echo "$TOINSTALL"
}

install_requirements() {
    echo "- Install Requirements"
    # Dotfiles manager
    INSTALL="stow"
    # Display (i3)
    INSTALL="$INSTALL i3-gaps i3-scripts i3-scrot i3exit i3lock i3status-manjaro manjaro-i3-settings conky-i3 conky compton dunst rofi"
    # Term
    INSTALL="$INSTALL rxvt-unicode rxvt-unicode-terminfo zsh tmux tmuxinator powerline"
    # Utils
    INSTALL="$INSTALL vim arandr feh glances nload bind-tools curl tig"
    # Dev
    INSTALL="$INSTALL python-pip docker jq aws-cli clusterssh vagrant"
    # Apps
    INSTALL="$INSTALL spotify slack-desktop atom google-chrome vlc"
    # Sound to use pulse
    INSTALL="$INSTALL pulseaudio pulseaudio-alsa manjaro-pulse pa-applet pavucontrol"
    # Misc (qt4 is for VLC display)
    INSTALL="$INSTALL thefuck epson-inkjet-printer-escpr qt4 network-manager-applet"

    # Install needed packages
    NEEDED=$(needed_packages)
    if [  "$NEEDED" != "" ]; then
        for PACKAGE in $NEEDED; do
          yaourt -S $PACKAGE
        done
    fi
}

# For information, now is included in doftfiles-shell
powerlinefont(){
    # Powerline fonts installation
    rm -rf /tmp/fonts
    cd /tmp
    git clone https://github.com/powerline/fonts.git
    cd fonts
    ./install.sh
}

materialdesginfont() {
    cp materialdesignicons-webfont.ttf /usr/share/fonts/materialdesignicons-webfont.ttf
}

BASE_DIR="$( cd "$( dirname "$0" )" && pwd )"

# Install
install_requirements
powerlinefont
materialdesginfont
cd $BASE_DIR

echo "Install softwares in /opt"
sudo $BASE_DIR/opt/install.sh
$BASE_DIR/install.sh<commit_msg>Add sudo for installing font<commit_after>#!/usr/bin/env bash

needed_packages() {
    # Check package needed
    INSTALLED=$(yaourt -Q)
    TOINSTALL=""
    for PACKAGE in $INSTALL; do
        ISINSTALLED=$(echo "$INSTALLED" | grep "/$PACKAGE")
        if [ $? -eq 1 ]; then
            TOINSTALL="$TOINSTALL $PACKAGE"
        fi
    done

    echo "$TOINSTALL"
}

install_requirements() {
    echo "- Install Requirements"
    # Dotfiles manager
    INSTALL="stow"
    # Display (i3)
    INSTALL="$INSTALL i3-gaps i3-scripts i3-scrot i3exit i3lock i3status-manjaro manjaro-i3-settings conky-i3 conky compton dunst rofi"
    # Term
    INSTALL="$INSTALL rxvt-unicode rxvt-unicode-terminfo zsh tmux tmuxinator powerline"
    # Utils
    INSTALL="$INSTALL vim arandr feh glances nload bind-tools curl tig"
    # Dev
    INSTALL="$INSTALL python-pip docker jq aws-cli clusterssh vagrant"
    # Apps
    INSTALL="$INSTALL spotify slack-desktop atom google-chrome vlc"
    # Sound to use pulse
    INSTALL="$INSTALL pulseaudio pulseaudio-alsa manjaro-pulse pa-applet pavucontrol"
    # Misc (qt4 is for VLC display)
    INSTALL="$INSTALL thefuck epson-inkjet-printer-escpr qt4 network-manager-applet"

    # Install needed packages
    NEEDED=$(needed_packages)
    if [  "$NEEDED" != "" ]; then
        for PACKAGE in $NEEDED; do
          yaourt -S $PACKAGE
        done
    fi
}

# For information, now is included in doftfiles-shell
powerlinefont(){
    # Powerline fonts installation
    rm -rf /tmp/fonts
    cd /tmp
    git clone https://github.com/powerline/fonts.git
    cd fonts
    ./install.sh
}

materialdesginfont() {
    cp materialdesignicons-webfont.ttf /usr/share/fonts/materialdesignicons-webfont.ttf
}

BASE_DIR="$( cd "$( dirname "$0" )" && pwd )"

# Install
install_requirements
powerlinefont
sudo materialdesginfont
cd $BASE_DIR

echo "Install softwares in /opt"
sudo $BASE_DIR/opt/install.sh
$BASE_DIR/install.sh
{'fraction_non_alphanumeric': 0.10561914672216441, 'fraction_numerical': 0.006763787721123829, 'mean_word_length': 3.107905982905983, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1803416', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1253, 'n_words': 336}