… | |
… | |
39 | URxvt.selection.pattern-0: ^(/[^:]+):\ |
39 | URxvt.selection.pattern-0: ^(/[^:]+):\ |
40 | |
40 | |
41 | You can look at the source of the selection extension to see more |
41 | You can look at the source of the selection extension to see more |
42 | interesting uses, such as parsing a line from beginning to end. |
42 | interesting uses, such as parsing a line from beginning to end. |
43 | |
43 | |
44 | This extension also offers following bindable keyboard commands: |
44 | This extension also offers the following actions: |
45 | |
45 | |
46 | =over 4 |
46 | =over 4 |
47 | |
47 | |
48 | =item rot13 |
48 | =item rot13 |
49 | |
49 | |
50 | Rot-13 the selection when activated. Used via keyboard trigger: |
50 | Rot-13 the selection when activated. |
51 | |
51 | |
|
|
52 | Example: |
|
|
53 | |
52 | URxvt.keysym.C-M-r: perl:selection:rot13 |
54 | URxvt.keysym.C-M-r: selection:rot13 |
53 | |
55 | |
54 | =back |
56 | =back |
55 | |
57 | |
56 | =cut |
58 | =cut |
|
|
59 | |
|
|
60 | sub on_user_command { |
|
|
61 | my ($self, $cmd) = @_; |
|
|
62 | |
|
|
63 | $cmd eq "selection:rot13" |
|
|
64 | and $self->selection (map { y/A-Za-z/N-ZA-Mn-za-m/; $_ } $self->selection); |
|
|
65 | |
|
|
66 | () |
|
|
67 | } |
57 | |
68 | |
58 | sub on_action { |
69 | sub on_action { |
59 | my ($self, $action) = @_; |
70 | my ($self, $action) = @_; |
60 | |
71 | |
61 | $action eq "rot13" |
72 | $action eq "rot13" |