--- rxvt-unicode/src/perl/overlay-osc 2008/10/10 00:11:40 1.1 +++ rxvt-unicode/src/perl/overlay-osc 2012/06/10 17:31:53 1.4 @@ -1,17 +1,33 @@ #! perl +=head1 NAME + + overlay-osc - implement OSC to manage overlays + +=head1 DESCRPTION + +This extension implements some OSC commands to display timed popups on the +screen - useful for status displays from within scripts. You have to read +the sources for more info. + +=cut + # allows programs to open popups # printf "\033]777;overlay;action;args\007" # -# action "simple;;;;;" -# printf "\033]777;overlay;simple;ov1;0;0;t;test\007" +# action "simple;;;;;;" +# printf "\033]777;overlay;simple;ov1;5;0;0;t;test\007" # -## action "complex;;;;;;;;;" # action "timeout;;" # printf "\033]777;overlay;timeout;ov1;6\007" # action "destroy;" +# printf "\033]777;overlay;destroy;ov1\007" + +# TODO: +## action "complex;;;;;;;;" +## action "set;;;;;;" sub on_osc_seq_perl { my ($self, $osc, $resp) = @_; @@ -32,7 +48,7 @@ } } elsif ($1 eq "simple") { - my ($id, $x, $y, $t, $txt) = split /;/, $osc, 5; + my ($id, $to, $x, $y, $t, $txt) = split /;/, $osc, 6; if ($t eq "h") { $txt = pack "H*", $txt; utf8::decode $txt; @@ -41,7 +57,7 @@ ov => $self->overlay_simple ($x, $y, $txt), to => urxvt::timer ->new - ->start (urxvt::NOW + 60) + ->start (urxvt::NOW + $to) ->cb(sub { delete $self->{ov}{$id}; }),