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

logdir="$HOME/.logs"
mkdir -p "$logdir"

logfile="$logdir/startup.log"

start_process() {
    local procname="$1"
    local procargs="$2"
    local kill="$3"

    if [[ ! "$(which $procname)" = "" ]]; then
        if [[ "$kill" = "1" ]]; then
            killall -q "$procname"
            while pgrep -x "$procname" >/dev/null; do sleep 0.1; done
        fi

        $procname $procargs >> "$logfile" 2>&1 &
    else
        notify-send \
            -u critical \
            -t 5000 \
            "Failed to start $procname" \
            "Ensure that the program \"$procname\" is installed"
    fi
}

echo "Starting up user processes $(date)" >> "$logfile" 2>&1
start_process "insync" "start" "1"
start_process "wpr" "" "1"
<commit_msg>Run nm-applet on startup<commit_after>#!/usr/bin/env bash

logdir="$HOME/.logs"
mkdir -p "$logdir"

logfile="$logdir/startup.log"

start_process() {
    local procname="$1"
    local procargs="$2"
    local kill="$3"

    if [[ ! "$(which $procname)" = "" ]]; then
        if [[ "$kill" = "1" ]]; then
            killall -q "$procname"
            while pgrep -x "$procname" >/dev/null; do sleep 0.1; done
        fi

        $procname $procargs >> "$logfile" 2>&1 &
    else
        notify-send \
            -u critical \
            -t 5000 \
            "Failed to start $procname" \
            "Ensure that the program \"$procname\" is installed"
    fi
}

echo "Starting up user processes $(date)" >> "$logfile" 2>&1
start_process "insync" "start" "1"
start_process "wpr" "" "1"
start_process "nm-applet" "" "1"

{'fraction_non_alphanumeric': 0.16917293233082706, 'fraction_numerical': 0.020676691729323307, 'mean_word_length': 2.181274900398406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '453052', 'n_tokens_mistral': 568, 'n_tokens_neox': 540, 'n_words': 150}