1 | #! perl |
1 | #! perl |
|
|
2 | |
|
|
3 | #:META:X_RESOURCE:tabbar-fg:colour:tab bar foreground colour |
|
|
4 | #:META:X_RESOURCE:tabbar-bg:colour:tab bar background colour |
|
|
5 | #:META:X_RESOURCE:tab-fg:colour:tab foreground colour |
|
|
6 | #:META:X_RESOURCE:tab-bg:colour:tab background colour |
|
|
7 | |
|
|
8 | =head1 NAME |
|
|
9 | |
|
|
10 | tabbed - tabbed interface to urxvt |
|
|
11 | |
|
|
12 | =head1 DESCRIPTION |
|
|
13 | |
|
|
14 | This transforms the terminal into a tabbar with additional terminals, that |
|
|
15 | is, it implements what is commonly referred to as "tabbed terminal". The topmost line |
|
|
16 | displays a "[NEW]" button, which, when clicked, will add a new tab, followed by one |
|
|
17 | button per tab. |
|
|
18 | |
|
|
19 | Clicking a button will activate that tab. Pressing B<Shift-Left> and |
|
|
20 | B<Shift-Right> will switch to the tab left or right of the current one, |
|
|
21 | while B<Shift-Down> creates a new tab. |
|
|
22 | |
|
|
23 | The tabbar itself can be configured similarly to a normal terminal, but |
|
|
24 | with a resource class of C<URxvt.tabbed>. In addition, it supports the |
|
|
25 | following four resources (shown with defaults): |
|
|
26 | |
|
|
27 | URxvt.tabbed.tabbar-fg: <colour-index, default 3> |
|
|
28 | URxvt.tabbed.tabbar-bg: <colour-index, default 0> |
|
|
29 | URxvt.tabbed.tab-fg: <colour-index, default 0> |
|
|
30 | URxvt.tabbed.tab-bg: <colour-index, default 1> |
|
|
31 | |
|
|
32 | See I<COLOR AND GRAPHICS> in the @@RXVT_NAME@@(1) manpage for valid |
|
|
33 | indices. |
|
|
34 | |
|
|
35 | =cut |
2 | |
36 | |
3 | sub refresh { |
37 | sub refresh { |
4 | my ($self) = @_; |
38 | my ($self) = @_; |
5 | |
39 | |
6 | my $ncol = $self->ncol; |
40 | my $ncol = $self->ncol; |
… | |
… | |
43 | $self->want_refresh; |
77 | $self->want_refresh; |
44 | } |
78 | } |
45 | |
79 | |
46 | sub new_tab { |
80 | sub new_tab { |
47 | my ($self, @argv) = @_; |
81 | my ($self, @argv) = @_; |
48 | |
|
|
49 | my $offset = $self->fheight; |
|
|
50 | |
82 | |
51 | # save a backlink to us, make sure tabbed is inactive |
83 | # save a backlink to us, make sure tabbed is inactive |
52 | push @urxvt::TERM_INIT, sub { |
84 | push @urxvt::TERM_INIT, sub { |
53 | my ($term) = @_; |
85 | my ($term) = @_; |
54 | $term->{parent} = $self; |
86 | $term->{parent} = $self; |