1 | #!/usr/bin/perl |
1 | #!/usr/bin/perl |
2 | |
2 | |
3 | # I tried to write this with Tk, as it uses elss memory and is |
3 | # I tried to write this with Tk, as it uses less memory and is |
4 | # more widely available. Alas, Tk is rather broken with respect to embedding. |
4 | # more widely available. Alas, Tk is rather broken with respect to embedding. |
5 | |
5 | |
6 | # on debian, do: |
6 | # on debian, do: |
7 | # apt-get install libgtk2-perl |
7 | # apt-get install libgtk2-perl |
|
|
8 | |
|
|
9 | # Also see the Gtk2::URxvt module family, which does this much cleaner |
|
|
10 | # and provides a real tabbed-terminal. |
8 | |
11 | |
9 | my $RXVT_BASENAME = "rxvt"; |
12 | my $RXVT_BASENAME = "rxvt"; |
10 | |
13 | |
11 | use Gtk2; |
14 | use Gtk2; |
12 | use Encode; |
15 | use Encode; |
… | |
… | |
50 | $hints->base_width ($base_width); $hints->base_height ($base_height); |
53 | $hints->base_width ($base_width); $hints->base_height ($base_height); |
51 | $hints->width_inc ($width_inc); $hints->height_inc ($height_inc); |
54 | $hints->width_inc ($width_inc); $hints->height_inc ($height_inc); |
52 | |
55 | |
53 | $rxvt->get_toplevel->set_geometry_hints ($rxvt, $hints, [qw(base-size resize-inc)]); |
56 | $rxvt->get_toplevel->set_geometry_hints ($rxvt, $hints, [qw(base-size resize-inc)]); |
54 | }; |
57 | }; |
55 | |
58 | |
56 | $rxvt->signal_connect_after (realize => sub { |
59 | $rxvt->signal_connect_after (realize => sub { |
57 | my $win = $_[0]->window; |
60 | my $win = $_[0]->window; |
58 | |
61 | |
59 | if (fork == 0) { |
62 | if (fork == 0) { |
60 | exec $RXVT_BASENAME, |
63 | exec $RXVT_BASENAME, |