urxvt-selection-popup(1)

πŸ‘‘ NAME πŸ‘‘

selection-popup β€” selection management pop-up

ok bestie, this is the urxvt-selection-popup(1) page from the RXVT-UNICODE manual, and it's literally about a pop-up that manages your selection πŸ’…

🌈 DESCRIPTION 🌈

okay so here's the tea: this thing binds a popup menu to Ctrl-Button3 (Ctrl+Button3). That popup lets you paste the X selections, and then either modify or use the internal selection text in various ways β€” depending on content πŸ‘€. We're talking uri unescaping, perl evaluation, web-browser starting, etc. β€” it's giving "selection text but make it do tricks" ✨

Other extensions can extend this popup menu by pushing a code reference onto @{ $term->{selection_popup_hook} }. That hook gets called whenever the popup is being displayed. main character energy for your extensions, fr fr 🫢

Its sole argument is the popup menu, which can be modified. The selection is in $_, which can be used to decide whether to add something or not. It should either return nothing, or return a string and a code reference. The string will be used as button text, and the code reference will be called when the button gets activated β€” and it should transform $_. slay πŸ’…

The following will add an entry "a to b" that transforms all "a"s in the selection to "b"s, but only if the selection currently contains any "a"s:

          push @{ $self->{term}{selection_popup_hook} }, sub {
             /a/ ? ("a to b" => sub { s/a/b/g }
                 : ()
          };

ok that's it bestie, this page was from version 9.31, dated 2023-12-02 β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from