Skip to content

Instantly share code, notes, and snippets.

@terminaldweller
Created October 31, 2024 19:19
Show Gist options
  • Save terminaldweller/a4e98358d51452c595a50f8d49a5ce9a to your computer and use it in GitHub Desktop.
Save terminaldweller/a4e98358d51452c595a50f8d49a5ce9a to your computer and use it in GitHub Desktop.
uses the item name to name all windows that don't already have a name. will name windows indiscriminately, so query windows will also get named.
use Irssi;
sub name_all_windows {
foreach my $window (Irssi::windows) {
if ($window->{name} == "") {
foreach my $item ($window->items) {
$window->set_name($item->{name});
}
}
}
}
sub list_all {
foreach my $window (Irssi::windows) {
my $name = $window->{name};
Irssi::print("window name: $name");
}
}
Irssi::command_bind('name_all_windows', 'name_all_windows');
Irssi::command_bind('list_all_window_names', 'list_all');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment