NAME

coords - weechat script to map screen coordinates (weechat edition)

SYNOPSIS

first, copy the file to your .weechat/perl directory. Then you can type

  /script load coords.pl

in weechat to load the script. Use

  /coords

to open the coords screen, or conveniently

  /key bind meta-/ /coords /

to open it with the Alt+/ keybinding.

DESCRIPTION

coords will hilight links, allow text selection and tries to send the selection to xterm

SETUP

if you would like urls to be copied into the selection clipboard, add

  xterm*disallowedWindowOps:20,21,SetXprop

to your .Xresources file for xterm.

For rxvt-unicode, get the osc-xterm-clipboard script from http://anti.teamidiot.de/static/nei/*/Code/urxvt/, install it to your perl-lib directory and add it to your .Xresources like such:

  URxvt.perl-ext-common: default,osc-xterm-clipboard

USAGE

to open the url overlay on a window, type /coords or use the keybinding you created as explained in the "SYNOPSIS".

Selection Mode

by default, the copy window will be in selection mode. you can move the text cursor with the arrow keys and open a selection with the Space key. The selection content will be transfered into clipboard.

URL Mode

to switch between selection mode and URL mode, use the / key or type the command /coords / to directly start in URL mode.

inside the overlay, you can use Arrow-Up and Arrow-Down keys to select URLs. This script will try to copy them into your selection clipboard (see "SETUP") so you should be able to open the selected link by clicking the middle mouse button in your browser.

once you click or hit enter, an url open signal will be sent to WeeChat. Use an appropriate script such as urlopener.pl from http://anti.teamidiot.de/static/nei/*/Code/WeeChat/ if you would like to associate this with some application (web browser etc.)

to leave the overlay, hit the q key.

for mouse support, this script will listen to mouse input signals. Another script is needed to supply these signals, such as mouse.pl which can be found in the same place as urlopener.pl and this script.

CAVEATS

TODO

BUGS

SETTINGS

the settings are usually found in the

  plugins.var.perl.coords

namespace, that is, type

  /set plugins.var.perl.coords.*

to see them and

  /set plugins.var.perl.coords.SETTINGNAME VALUE

to change a setting SETTINGNAME to a new value VALUE. Finally,

  /unset plugins.var.perl.coords.SETTINGNAME

will reset a setting to its default value.

the following settings are available:

url_regex

a regular expression to identify URLs in the text. See perlre for more information about Perl regular expressions.

url_braces

parenthesis-like characters which nest and should be excluded when found around an URL. make sure the variable setting nests properly when modifying this.

url_non_endings

this is matched against the end of a link and removed

hyper_nicks

make nicks to hyperlinks for menu/pm

hyper_channels

make channels to hyperlinks for join

hyper_show

set to types of hyperlinks that are shown by default

use_nick_menu

use nick menu when opening nick hyperlink (see hyper_nicks, requires menu.pl script). otherwise open private message. this setting only applies to text mode selection, for mouse see mouse.nick_2nd_click

color.url_highlight

the weechat color and/or attribute to be used for highlighting URLs in the copy window. seperate multiple attributes with .

color.url_highlight_active

the same as color.url_highlight except for the currently (using arrow keys) selected link.

color.selection_cursor

the weechat color and/or attribute to be used for the text cursor.

color.selection

the color of the currently selected text in selection mode

copybuf_short_name

short_name to use for coords buffer. it is set to the copy sign by default to not disturb buffers bar width, set to the empty string to have window position and size shown

mouse.copy_on_click

set to on if it should be possible to directly click on URLs and select text, set to off if mouse should only work in open coords buffer

mouse.close_on_release

set to on or a delay (in ms) to autoclose coords buffer opened by copy_on_click on button release, set to off if the coords buffer should stay open after click

mouse.click_select_pane

set to on to use the mouse to select windows

mouse.click_through_pane

set to on if copy_on_click should work on inactive windows (works only if click_select_pane is set too). set to off if window needs to be active

mouse.url_open_2nd_click

if this is set, URLs are only opened when clicked twice (in the same incarnation of a coords buffer) instead of on first click. it can be set to a delay (in ms) that will be added to the close_on_release delay if the script is waiting for a second click on the URL to happen

mouse.handle_scroll

set to on if coords should handle scrolling inside windows. the script will try to guess non-chat areas to be nicklist, top to be title and bottom to be status and scroll the respective bars if the cursor is in that area. set to off if scrolling should be handled by the default mouse.pl script or another mouse scrolling script

mouse.scroll_inactive_pane

set to on if inactive windows should be scrolled instead of active window if the mouse cursor is over it (requires handle_scroll to be enabled)

clipboard_command

if you set this, an external program may be executed to store the selection or URL. begin with | to pipe into program or use parameters %s for text, %q for quoted text or %x for quoted escape sequence.

copywin_custom_keys

You can define custom key bindings to use inside the copywin here. syntax is: command-letter:weechat-keycode. available commands: -+>< (up/down/left/right) fbae (forward word/backward word/beginning/end) !@ (open/start selection) /UNCunc (toggle highlights/urls/nicks/channels) q (close window)

FUNCTION DESCRIPTION

for full pod documentation, filter this script with

  perl -pE'
  (s/^## (.*?) -- (.*)/=head2 $1\n\n$2\n\n=over\n/ and $o=1) or
   s/^## (.*?) - (.*)/=item I<$1>\n\n$2\n/ or
  (s/^## (.*)/=back\n\n$1\n\n=cut\n/ and $o=0,1) or
  ($o and $o=0,1 and s/^sub /=back\n\n=cut\n\nsub /)'