<commit_before>function check_xclients --description="Return number of current X clients"
    argparse --name check_xclients h/help b-barmode -- $argv
    or return 1 # error

    function print_help
        echo "Usage: check_xclients [options]"
        echo "Options:"
        echo (set_color green)"--barmode"(set_color $fish_color_normal)": Output text for i3status-rs bar"
    end

    if set -lq _flag_help
        print help
        return
    end

    set MODE std
    if set -lq _flag_barmode
        set MODE bar
    end

    set val (xlsclients | wc --lines)
    if test $MODE = bar
        if test val = 0
            printf "<span color='green'>X0</span>"
        else
            printf "<span color='red'>X$val</span>"
        end
    else
        echo $val<commit_msg>fish/i3status-rs: explicitly name X11<commit_after>function check_xclients --description="Return number of current X clients"
    argparse --name check_xclients h/help b-barmode -- $argv
    or return 1 # error

    function print_help
        echo "Usage: check_xclients [options]"
        echo "Options:"
        echo (set_color green)"--barmode"(set_color $fish_color_normal)": Output text for i3status-rs bar"
    end

    if set -lq _flag_help
        print help
        return
    end

    set MODE std
    if set -lq _flag_barmode
        set MODE bar
    end

    set val (xlsclients | wc --lines)
    if test $MODE = bar
        if test val = 0
            printf "<span color='green'>X11(0)</span>"
        else
            printf "<span color='red'>X11($val)</span>"
        end
    else
        echo $val
{'fraction_non_alphanumeric': 0.090625, 'fraction_numerical': 0.009375, 'mean_word_length': 2.0907335907335907, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, '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': '7241473', 'n_tokens_mistral': 512, 'n_tokens_neox': 492, 'n_words': 160}