Created
October 31, 2024 19:19
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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