Gentoo Archives: gentoo-user-hu

From: Bukuli Norbert <bukuli.norbert@×××××.com>
To: gentoo-user-hu@l.g.o
Subject: [gentoo-user-hu] urxvt perl segitseg
Date: Mon, 07 Nov 2011 22:00:45
Message-Id: CA+Rr8u4PcgfO4oipR+imzWYVtnWzqSg0NrDHUWT+UYZW6iOXQQ@mail.gmail.com
1 Szervusztok!
2
3 Szeretnek egy kis segitseget kerni az urxvt perl moduljaival kapcsolatban.
4 Talalatam egy elegge hasznosat, a neve "tabbed". Ez pontosan az, amire
5 a neve utal, azonban van vele egy kis problemam. Uj tab nyitasakor az
6 uj nem orokli a regi pwd-jet.
7 Az az otletem tamadt, hogy jol atirom a megfelelo perl modult, azonban
8 ezzel a nyelvvel nincsenek tapasztalataim.
9
10 Az uj terminal letrehozasaert felelos resze ez az emlitet modulnak:
11
12
13 sub new_tab {   my ($self, @argv) = @_;
14    my $offset = $self->fheight;
15    # save a backlink to us, make sure tabbed is inactive   push
16 @urxvt::TERM_INIT, sub {      my ($term) = @_;      $term->{parent} =
17 $self;
18       for (0 .. urxvt::NUM_RESOURCES - 1) {         my $value =
19 $self->{resource}[$_];
20          $term->resource ("+$_" => $value)            if defined $value;      }
21       $term->resource (perl_ext_2 => $term->resource ("perl_ext_2") .
22 ",-tabbed");   };
23    push @urxvt::TERM_EXT, urxvt::ext::tabbed::tab::;
24    my $term = new urxvt::term      $self->env, $urxvt::RXVTNAME,
25 -embed => $self->parent,      @argv,   ;}
26
27 A vegen az argumentumvekrotba a valami ilyesmit kellene meg beleirni "-cd $PWD".
28 Szerintetek az hogyan lehetseges?
29
30 http://linux.die.net/man/3/urxvtperl
31 Itt van a megfelelo man page.
32 Ez a reszlet lehet erdekes a refi terminap pdw-je szempontjabol
33
34
35 $urxvt::TERM
36 The current terminal. This variable stores the current "urxvt::term"
37 object, whenever a callback/hook is executing.
38 @urxvt::TERM_INIT
39 All code references in this array will be called as methods of the
40 next newly created "urxvt::term" object (during the "on_init" phase).
41 The array gets cleared before the code references that were in it are
42 being executed, so references can push themselves onto it again if
43 they so desire.
44 This complements to the perl-eval command line option, but gets executed first.
45
46 @urxvt::TERM_EXT
47 Works similar to @TERM_INIT, but contains perl package/class names,
48 which get registered as normal extensions after calling the hooks in
49 @TERM_INIT but before other extensions. Gets cleared just like
50 @TERM_INIT.
51
52 A segitsegeteket elore is koszonom.--
53 Üdvözlettel:
54 Bukuli Norbert