.\" Hey, EMACS: -*- nroff -*- .TH URLSCAN 1 "15 May 2020" .SH NAME urlscan \- browse the URLs in an email message from a terminal .SH SYNOPSIS \fBurlscan\fR [options] < .I message \fBurlscan\fR [options] .I message .SH DESCRIPTION \fBurlscan\fR accepts a single email message on standard input, then displays a terminal-based list of the URLs in the given message. Selecting a URL uses the Python webbrowser module to determine which browser to open. The \fBBROWSER\fR environment variable will be used if it is set. \fBurlscan\fR is primarily intended to be used with the .B mutt (1) mailreader, but it should work well with any terminal-based mail program. \fBurlscan\fR is similar to \fBurlview\fR(1), but has the following additional features: \fB1.\fR Support for more message encodings, such as quoted-printable and base64. \fB2.\fR Extraction and display of the context surrounding each URL. Toggle context view on/off with \fBc\fR. Reverse displayed order of URLs with \fBR\fR. \fB3.\fR Copy current URL to primary selection with \fBP\fR or to clipboard with \fBC\fR. \fB4.\fR URLs are shortened by default to fit on one line. Toggle one or all shortened URLs with \fBs\fR or \fBS\fR. \fB5.\fR Incremental case-insensitive search using \fB/\fR. Footer shows current search term. \fB/\fR again resets search. \fB6.\fR Cycle through all available palettes (color and black & white available by default) using \fBp\fR. Running \fBurlscan \-g\fR will generate a ~/.config/urlscan/config.json file for editing or adding additional pallettes and keybindings. See http://urwid.org/manual/displayattributes.html#display-attributes for color options and allowed values. Set display width with `--width`. \fB7.\fR \fBu\fR will unescape the highlighted URL if necessary. \fB8.\fR Run a command with the selected URL as the argument or pipe the selected URL to a command using the \fB--run\fR and \fB--pipe\fR arguments. \fB9.\fR Use \fBl\fR to cycle through whether URLs are opened using the Python webbrowser module (default), xdg-open (if installed) or a function passed on the command line with \fB--run\fR. The \fB--run\fR function will respect the value of \fB--pipe\fR. \fB10.\fR \fBF1\fR shows the help menu. .SH OPTIONS .TP .B \-g, \-\-genconf Generate ~/.config/urlscan/config.json with default options. .TP .B \-c, \-\-compact Display a simple list of the extracted URLs, instead of showing the context of each URL. Also toggle with `c` from within the viewer. .TP .B \-H, \-\-nohelp Start with header menu hidden. .TP .B \-d, \-\-dedupe Remove duplicated URLs from the list of URLs. .TP .B \-n, \-\-no-browser Disables the selection interface and print the links to standard output. Useful for scripting (implies \fB\-\-compact\fR). .TP .B \-r, \-\-run \ Execute \ in place of opening URL with a browser. Use {} in \ to substitute in the URL. Examples: $ urlscan --run 'echo {} | xclip -i' file.txt $ urlscan --run 'tmux set buffer {}' .TP .B \-p, \-\-pipe Pipe the selected URL to the command specified by `--run`. This is preferred when the command supports it, as it is more secure and tolerant of special characters in the URL. Example: $ urlscan --run 'xclip -i' --pipe file.txt .TP .B \-R, \-\-reverse Reverse displayed order of URLs. .TP .B \-s, \-\-single Exit urlscan after opening or copying a single browser link. $ urlscan -s file.txt .TP .B \-w, \-\-width Set display width. .SH MUTT INTEGRATION To integrate urlscan with mutt, include the following two commands in \fB~/.muttrc\fR: .ad l macro index,pager \\cb " urlscan" "call urlscan to extract URLs out of a message" macro attach,compose \\cb " urlscan" "call urlscan to extract URLs out of a message" .ad b Once these lines are in your mutt configuration file, pressing Control-b will allow you to browse and open the URLs in the currently selected message. Alternately, you can pipe a message into urlscan using the '|' operator. This can be useful for applying a different flag (such as the '-d' or '-c' options). .SH KEYBINDINGS Run \fBurlscan \-g\fR to generate ~/.config/urlscan/config.json. All of the keys will be listed. You can either leave in place or delete any that will not be altered. To unset a binding, set it equal to "". For example: \fB"P": ""\fR The follow actions are supported: .TP \fBall_escape\fR \-\- toggle unescape all URLs (Default: \fBu\fR) .TP \fBall_shorten\fR \-\- toggle shorten all URLs (Default: \fBS\fR) .TP \fBbottom\fR \-\- move cursor to last item (Default: \fBG\fR) .TP \fBclear_screen\fR \-\- redraw screen (Default: \fBCtrl-l\fR) .TP \fBclipboard\fR \-\- copy highlighted URL to clipboard using xsel/xclip (Default: \fBC\fR) .TP \fBclipboard_pri\fR \-\- copy highlighted URL to primary selection using xsel/xclip (Default: \fBP\fR) .TP \fBcontext\fR \-\- show/hide context (Default: \fBc\fR) .TP \fBdown\fR \-\- cursor down (Default: \fBj\fR) .TP \fBhelp_menu\fR \-\- show/hide help menu (Default: \fBF1\fR) .TP \fBlink_handler\fR \-\- cycle link handling (webbrowser, xdg-open or custom) (Default: \fBl\fR) .TP \fBopen_url\fR \-\- open selected URL (Default: \fBspace\fR or \fBenter\fR) .TP \fBpalette\fR \-\- cycle through palettes (Default: \fBp\fR) .TP \fBquit\fR \-\- quit (Default: \fBq\fR or \fBQ\fR) .TP \fBreverse\fR \-\- reverse display order (Default: \fBR\fR) .TP \fBshorten\fR \-\- toggle shorten highlighted URL (Default: \fBs\fR) .TP \fBtop\fR \-\- move to first list item (Default: \fBg\fR) .TP \fBup\fR \-\- cursor up (Default: \fBk\fR) .SH FILES $HOME/.config/urlscan/config.json Only required if additional or modified palettes are desired. .SH SEE ALSO \fI/usr/share/doc/urlscan/README\fR, \fBurlview\fR(1), \fBmutt\fR(1) .SH AUTHOR This manual page was written by Daniel Burrows and Scott Hansen