<commit_before>#!/bin/mksh
#
# wildefyr & z3bra - 2015 (c) wtfpl
# focus wrapper with fullscreen checks

source ~/.config/fyre/fyrerc

usage() {
    echo "usage: $(basename $0) <next|prev|wid>"
    exit 1
}

case $1 in
    next) wid=$(lsw | grep -v $CUR | sed '1 p;d') ;;
    prev) wid=$(lsw | grep -v $CUR | sed '$ p;d') ;;
    0x*) wattr $1 && wid=$1 ;;
    *) usage ;;
esac

if [[ $wid == $PFW ]]; then
    usage
fi 

if [ -e $FSFILE ]; then
    if [[ $(cat $FSFILE | cut -d\  -f 5) == $wid ]]; then
        setborder.sh none $wid
    elif [[ $(cat $FSFILE | cut -d\  -f 5) == $PFW ]]; then
        setborder.sh active $wid
    else
        setborder.sh active $wid
        setborder.sh inactive $CUR
    fi
else
    setborder.sh active $wid
    setborder.sh inactive $CUR
fi

chwso -r $wid
wtf $wid<commit_msg>focus.sh, correct logic border logic<commit_after>#!/bin/mksh
#
# wildefyr & z3bra - 2015 (c) wtfpl
# focus wrapper with fullscreen checks

source ~/.config/fyre/fyrerc

usage() {
    echo "usage: $(basename $0) <next|prev|wid>"
    exit 1
}

case $1 in
    next) wid=$(lsw | grep -v $CUR | sed '1 p;d') ;;
    prev) wid=$(lsw | grep -v $CUR | sed '$ p;d') ;;
    0x*) wattr $1 && wid=$1 ;;
    *) usage ;;
esac

if [[ $wid == $PFW ]]; then
    usage
fi 

if [ -e $FSFILE ]; then
    if [[ $(cat $FSFILE | cut -d\  -f 5) == $wid ]]; then
        setborder.sh none $wid
    else
        setborder.sh active $wid
        setborder.sh inactive $CUR
    fi
else
    setborder.sh active $wid
    setborder.sh inactive $CUR
fi

chwso -r $wid
wtf $wid
{'fraction_non_alphanumeric': 0.1668806161745828, 'fraction_numerical': 0.017329910141206675, 'mean_word_length': 2.3526881720430106, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1098735', 'n_tokens_mistral': 638, 'n_tokens_neox': 604, 'n_words': 191}