ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/background
(Generate patch)

Comparing rxvt-unicode/src/perl/background (file contents):
Revision 1.40 by root, Fri Jun 8 22:19:21 2012 UTC vs.
Revision 1.41 by root, Fri Jun 8 22:21:48 2012 UTC

3#:META:X_RESOURCE:%.expr:string:background expression 3#:META:X_RESOURCE:%.expr:string:background expression
4#:META:X_RESOURCE:%.border.:boolean:respect the terminal border 4#:META:X_RESOURCE:%.border.:boolean:respect the terminal border
5 5
6#TODO: once, rootalign 6#TODO: once, rootalign
7 7
8=head1 NAME
9
8=head1 background - manage terminal background 10 background - manage terminal background
9 11
10=head2 SYNOPSIS 12=head1 SYNOPSIS
11 13
12 urxvt --background-expr 'background expression' 14 urxvt --background-expr 'background expression'
13 --background-border 15 --background-border
14 16
15=head2 DESCRIPTION 17=head1 DESCRIPTION
16 18
17This extension manages the terminal background by creating a picture that 19This extension manages the terminal background by creating a picture that
18is behind the text, replacing the normal background colour. 20is behind the text, replacing the normal background colour.
19 21
20It does so by evaluating a Perl expression that I<calculates> the image on 22It does so by evaluating a Perl expression that I<calculates> the image on
30 32
31Or specified as a X resource: 33Or specified as a X resource:
32 34
33 URxvt.background-expr: scale load "/path/to/mybg.png" 35 URxvt.background-expr: scale load "/path/to/mybg.png"
34 36
35=head2 THEORY OF OPERATION 37=head1 THEORY OF OPERATION
36 38
37At startup, just before the window is mapped for the first time, the 39At startup, just before the window is mapped for the first time, the
38expression is evaluated and must yield an image. The image is then 40expression is evaluated and must yield an image. The image is then
39extended as necessary to cover the whole terminal window, and is set as a 41extended as necessary to cover the whole terminal window, and is set as a
40background pixmap. 42background pixmap.
57image to the window size, so it relies on the window size and will 59image to the window size, so it relies on the window size and will
58be reevaluated each time it is changed, but not when it moves for 60be reevaluated each time it is changed, but not when it moves for
59example. That ensures that the picture always fills the terminal, even 61example. That ensures that the picture always fills the terminal, even
60after it's size changes. 62after it's size changes.
61 63
62=head3 EXPRESSIONS 64=head2 EXPRESSIONS
63 65
64Expressions are normal Perl expressions, in fact, they are Perl blocks - 66Expressions are normal Perl expressions, in fact, they are Perl blocks -
65which means you could use multiple lines and statements: 67which means you could use multiple lines and statements:
66 68
67 again 3600; 69 again 3600;
133It first takes a snapshot of the screen background image, and then 135It first takes a snapshot of the screen background image, and then
134moves it to the upper left corner of the screen - the result is 136moves it to the upper left corner of the screen - the result is
135pseudo-transparency, as the image seems to be static while the window is 137pseudo-transparency, as the image seems to be static while the window is
136moved around. 138moved around.
137 139
138=head3 CYCLES AND CACHING 140=head2 CYCLES AND CACHING
139 141
140As has been mentioned before, the expression might be evaluated multiple 142As has been mentioned before, the expression might be evaluated multiple
141times. Each time the expression is reevaluated, a new cycle is said to 143times. Each time the expression is reevaluated, a new cycle is said to
142have begun. Many operators cache their results till the next cycle. 144have begun. Many operators cache their results till the next cycle.
143 145
168 170
169Here, a path is selected randomly, and load is only called for one image, 171Here, a path is selected randomly, and load is only called for one image,
170so keeps only one image in memory. If, on the next evaluation, luck 172so keeps only one image in memory. If, on the next evaluation, luck
171decides to use the other path, then it will have to load that image again. 173decides to use the other path, then it will have to load that image again.
172 174
173=head2 REFERENCE 175=head1 REFERENCE
174 176
175=head3 COMMAND LINE SWITCHES 177=head2 COMMAND LINE SWITCHES
176 178
177=over 4 179=over 4
178 180
179=item --background-expr perl-expression 181=item --background-expr perl-expression
180 182
262 264
263=back 265=back
264 266
265=head2 VARIABLES 267=head2 VARIABLES
266 268
267The following functions provide variable data such as the terminal 269The following functions provide variable data such as the terminal window
270dimensions. They are not (Perl-) variables, they jsut return stuff that
268window dimensions. Most of them make your expression sensitive to some 271varies. Most of them make your expression sensitive to some events, for
269events, for example using C<TW> (terminal width) means your expression is 272example using C<TW> (terminal width) means your expression is evaluated
270evaluated again when the terminal is resized. 273again when the terminal is resized.
271 274
272=over 4 275=over 4
273 276
274=item TX 277=item TX
275 278

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines