<commit_before>function tv_status --description="Return active status of the connected TV to my desktop."
    argparse --name check_xclients h/help b/barmode -- $argv
    or return 1 # error

    function print_help
        echo "Usage: tv_status [options]"
        echo "Options:"
        echo (set_color green)"-b"(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 --local tv_status (swaymsg -t get_outputs | jq --raw-output '.. | objects | select(.model == "LG TV") | .active')
    if test $MODE = bar
        if test $tv_status = true
            printf "<span color='green'>📺ON</span>"
        else if test $tv_status = false
            printf "<span color='green'>📺OFF</span>"
        end
    else
        echo $tv_status
    end
end<commit_msg>i3status-rs: update tv status block script<commit_after>function tv_status --description="Return active status of the connected TV to my desktop."
    argparse --name check_xclients h/help b/barmode -- $argv
    or return 1 # error

    function print_help
        echo "Usage: tv_status [options]"
        echo "Options:"
        echo (set_color green)"-b"(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 --local tv_status (swaymsg -t get_outputs | jq --raw-output '.. | objects | select(.model == "LG TV") | .active')
    if test $MODE = bar
        if string length --quiet "$tv_status"
            printf "<span color='red'>📺ON</span>"
        else
            printf "<span color='green'>📺OFF</span>"
        end
    else
        echo $tv_status
    end
end
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.00267379679144385, 'mean_word_length': 2.181972789115646, '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': '6122402', 'n_tokens_mistral': 596, 'n_tokens_neox': 572, 'n_words': 195}