<commit_before>#!/bin/bash
readarray -t PROPS < <(xwinfo -its $1)

INST=${PROPS[0]}
TYPE=${PROPS[1]}
STATE=(${PROPS[2]})

RULE=()

case "$TYPE" in
    dock|desktop|notification)  RULE+=("manage=off")    ;;
    toolbar|utility)            RULE+=("focus=off")     ;;
    desktop)                    RULE+=("lower=on")      ;;
esac

for s in $STATE; do
    case $s in
        sticky)                 RULE+=("sticky=on")     ;;
        fullscreen)             RULE+=("fullscreen=on") ;;
    esac
done

case "$INST" in
    pithos)
        RULE+=("desktop=$([[ $(bspc query -M | wc -l) -gt 1 ]] && echo '^1' || echo 'next.free')") ;;
    mpv|keepassx)
        RULE+=("floating=on") ;;
    dropterm|crx_nckgahadagoaajjgafhacjanaoiihapd)
        RULE+=("floating=on sticky=on") ;;
esac

echo "${RULE[*]}"<commit_msg>Handle modal dialogs.<commit_after>#!/bin/bash
readarray -t PROPS < <(xwinfo -its $1)

INST=${PROPS[0]}
TYPE=${PROPS[1]}
STATE=(${PROPS[2]})

RULE=()

case "$TYPE" in
    dock|desktop|notification)  RULE+=("manage=off")    ;;
    toolbar|utility)            RULE+=("focus=off")     ;;
    desktop)                    RULE+=("lower=on")      ;;
esac

for s in $STATE; do
    case $s in
        sticky)                 RULE+=("sticky=on")     ;;
        fullscreen)             RULE+=("fullscreen=on") ;;
        modal)                  RULE+=("floating=on") ;;
    esac
done

case "$INST" in
    pithos)
        RULE+=("desktop=$([[ $(bspc query -M | wc -l) -gt 1 ]] && echo '^1' || echo 'next.free')") ;;
    mpv|keepassx)
        RULE+=("floating=on") ;;
    dropterm|crx_nckgahadagoaajjgafhacjanaoiihapd)
        RULE+=("floating=on sticky=on") ;;
esac

echo "${RULE[*]}"
{'fraction_non_alphanumeric': 0.2016656751933373, 'fraction_numerical': 0.007138607971445568, 'mean_word_length': 2.3911290322580645, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6728646', 'n_tokens_mistral': 690, 'n_tokens_neox': 644, 'n_words': 121}