<commit_before>package Numpaar::Engine::DebugIto::MainMenu;
use base 'Numpaar::Engine::DebugIto::Thunar';
use Numpaar::Config ('configGet');

sub new {
    my ($class, $winclass_winname_pattern, $window_title) = @_;
    my $self = $class->setupBasic("^$winclass_winname_pattern $window_title");
    $self->heap->{'title'} = $window_title;
    return $self;
}

sub handler0_center {
    my ($self, $want_help) = @_;
    my $connection = $self->getConnection();
    return 'Enter' if defined($want_help);
    $connection->comKeyString('Return');
    system(&configGet('extern_program', 'xdotool'), "search", '--name', $self->heap->{'title'}, 'windowkill');
    return 0;
}

1;

__END__

=pod

=head1 NAME

Numpaar::Engine::DebugIto::MainMenu - Engine for a window as a main menu

=head1 SYNOPSIS

In configuration file<commit_msg>Engine::DebugIto::MainMenu: add delay before remove the thunar window to stabilize its behavior.<commit_after>package Numpaar::Engine::DebugIto::MainMenu;
use base 'Numpaar::Engine::DebugIto::Thunar';
use Numpaar::Config ('configGet');

sub new {
    my ($class, $winclass_winname_pattern, $window_title) = @_;
    my $self = $class->setupBasic("^$winclass_winname_pattern $window_title");
    $self->heap->{'title'} = $window_title;
    return $self;
}

sub handler0_center {
    my ($self, $want_help) = @_;
    my $connection = $self->getConnection();
    return 'Enter' if defined($want_help);
    $connection->comKeyString('Return');
    sleep 1;
    system(&configGet('extern_program', 'xdotool'), "search", '--name', $self->heap->{'title'}, 'windowkill');
    return 0;
}

1;

__END__

=pod

=head1 NAME

Numpaar::Engine::DebugIto::MainMenu - Engine for a window as a main menu

=head1 SYNOPSIS

In configuration file
{'fraction_non_alphanumeric': 0.1649543378995434, 'fraction_numerical': 0.006278538812785388, 'mean_word_length': 5.19434628975265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '5537359', 'n_tokens_mistral': 617, 'n_tokens_neox': 604, 'n_words': 136}