Tag: urxvt
urxvt - Send to all vty
10. Juni 2014 22:12

Ein urxvt Script, welches es ermöglicht, dass man Tastatureingaben an alle offenen
Tabs senden kann.
Benutzung: STRG drücken und das Mausrad drücken.

                    #!/usr/bin/perl
#Send input to all vty
#Sebastian Kricner
#tuxwave.net Juni 2012
#To use:
#Hold CTRL and press the mouse wheel.
#In the options popup select "send to all vty"

#Hint:
#In the latest releases of urxvt-unicode, there is a new hook called 'on_tt_write'
#which interferes with this script (introduces a loop). So comment out the function 'on_tt_write'
#in the tabbed extension.
#This may introduce other problems, see: http://lists.schmorp.de/pipermail/rxvt-unicode/2011q3/001428.html
#Personally i don´t got these. Thanks to exg on #rxvt-unicode on freenode.

sub on_init
{
	my ($self) = @_;
	$self->{enabled} = 0;
	push @{$self->{term}{option_popup_hook}}, sub{("send to all vty" => $self->{enabled}, sub { $self->{enabled} = shift})};
};

sub on_tt_write
{
	my ($self, $octets) = @_;
	if($self->{enabled})
	{
		foreach my $terminal (urxvt::termlist)
		{
			unless($terminal == $self->{term})
			{
				$terminal->tt_write($octets);
			}
		}
	}
}
                    
        
Download