<commit_before>#!/bin/bash

# Ubuntu doesn't have the updated lib xft library that allows emojis, so without
# the new version I manually installed, it will crash st, dmenu, and dwm if an
# emoji is shown.

# Every once in a while the library is overwritten by Ubuntu (I think it happens
# whenever I install or update something and apt replaces the library) so I have
# to manually overwrite it every once in a while.

MANUALLY_INSTALLED_VERSION="/usr/lib/libXft.so.2"
TARGET_LOCATION="/usr/lib/x86_64-linux-gnu/libXft.so.2"

if [ ! -f "$MANUALLY_INSTALLED_VERSION" ]; then
    echo "Manually installed version file does not exist [${MANUALLY_INSTALLED_VERSION}]"
    exit 1
fi

if [ ! -f "$TARGET_LOCATION" ]; then
    echo "Target file does not exist [${TARGET_LOCATION}]"
    exit 1
fi

sudo ln -sf "$MANUALLY_INSTALLED_VERSION" "$TARGET_LOCATION"<commit_msg>Backup location for target in fix-emoji-library.sh<commit_after>#!/bin/bash

# Ubuntu doesn't have the updated lib xft library that allows emojis, so without
# the new version I manually installed, it will crash st, dmenu, and dwm if an
# emoji is shown.

# Every once in a while the library is overwritten by Ubuntu (I think it happens
# whenever I install or update something and apt replaces the library) so I have
# to manually overwrite it every once in a while.

MANUALLY_INSTALLED_VERSION="/usr/lib/libXft.so.2"

TARGET_LOCATION="/usr/lib/x86_64-linux-gnu/libXft.so.2"
TARGET_LOCATION_BAK="/usr/lib/x86_64-linux-gnu/libXft.so.2.3.3"

if [ ! -f "$MANUALLY_INSTALLED_VERSION" ]; then
    echo "Manually installed version file does not exist [${MANUALLY_INSTALLED_VERSION}]"
    exit 1
fi

if [ ! -f "$TARGET_LOCATION" ]; then
    echo "Target file does not exist [${TARGET_LOCATION}]. Trying backup..."
    if [ ! -f "$TARGET_LOCATION_BAK" ]; then
        echo "Backup Target file also does not exist [${TARGET_LOCATION_BAK}]"
        exit 1
    fi

    TARGET_LOCATION="$TARGET_LOCATION_BAK"
fi

sudo ln -sf "$MANUALLY_INSTALLED_VERSION" "$TARGET_LOCATION"
{'fraction_non_alphanumeric': 0.0962962962962963, 'fraction_numerical': 0.011358024691358024, 'mean_word_length': 4.181585677749361, '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': '3067983', 'n_tokens_mistral': 706, 'n_tokens_neox': 654, 'n_words': 236}