<commit_before>#! /usr/bin/sh

##
# Forismatic Conky
# https://github.com/MnC-69/forq.git
#
# Copyright (c) 2014 <NAME>, <NAME>
# Licensed under the MIT license.
##

PATH1=/usr/local/forq
PATH2=~/.forq

# Explains the usage
usage_forq()
{
    echo "Usage: forq <flag>"
    echo "Valid flags:"
    echo "  -n : Request new quote from forismatic"
    echo "  -q : Print last quote"
    echo "  -a : Print author of last quote"
}

echo -n 'Install in /usr/local/forq (1) OR ~/.forq (2) [ 1|2 ] -> '
read ans 

if [ "$ans" = "2" ]
then
    path=$PATH2
else
    path=$PATH1
fi

echo "Installing in $path"

if [ ! -d $path ]
then
    mkdir $path           # Make directory if directory does not exist
fi

cp src/* $path                  # Copy scripts
cp conf/forq /usr/bin/          # Copy the forq conf file

echo "Install successful"
usage_forq<commit_msg>Streamlined installer, removed install to homedir<commit_after>#! /usr/bin/sh

##
# Forismatic Conky
# https://github.com/MnC-69/forq.git
#
# Copyright (c) 2014 <NAME>, <NAME>
# Licensed under the MIT license.
##

SCRIPT_DIR=$(readlink -f ${0%/*})
ROOT_ACCESS=1
USER_UID=$($SCRIPT_DIR/conf/uid.sh)

if [ "$USER_UID" = "0" ]
then
    ROOT_ACCESS=0
fi

if [ "$ROOT_ACCESS" != "0" ]
then
    echo 'Cannot install without root access'
    exit 1
fi

path=/usr/local/forq

if [ ! -d $path ]
then
    mkdir $path           # Make directory if directory does not exist
fi

install -m 0755 "$SCRIPT_DIR/src/generate.py" "$path"
install -m 0644 "$SCRIPT_DIR/src/getQuote.py" "$path"
install -m 0755 "$SCRIPT_DIR/src/parse.py" "$path"
install -m 0755 "$SCRIPT_DIR/conf/width.sh" "$path"
install -m 0755 "$SCRIPT_DIR/conf/forq" "/usr/bin" # Copy the forq conf file
{'fraction_non_alphanumeric': 0.14830011723329425, 'fraction_numerical': 0.027549824150058615, 'mean_word_length': 3.025943396226415, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, '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': '1291007', 'n_tokens_mistral': 682, 'n_tokens_neox': 633, 'n_words': 191}