Mailing List Archive

Anyone using extract_url with mutt?
urlview has served me faithfully for many years in conjunction with
mutt. In a recent install, I find it's no longer available (python
2.7?). extract_url is touted as a drop-in replacement for urlview. I
emerged it and did some RTFM, ending up more confused than ever. I want
to display urls on a simple menu, just like urlview, select, and pass
the selected url to my palemoon email profile...

/home/waltdnes/pm/palemoon/palemoon -new-instance -p email

The man page had example macros for mutt 1.4.x and mutt 1.5.x. I'm
on 1.14.4, so that doesn't seem to help. Is anyone running extract_url
with mutt? If so, what is your macro?

--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
Re: Anyone using extract_url with mutt? [ In reply to ]
Hello,

On Thu, 26 Nov 2020, Walter Dnes wrote:
> urlview has served me faithfully for many years in conjunction with
>mutt. In a recent install, I find it's no longer available (python
>2.7?).

Stated reason was "upstream dead" (which seems the case since 2013,
with issues on github[1])...

>extract_url is touted as a drop-in replacement for urlview. I
>emerged it and did some RTFM, ending up more confused than ever. I want
>to display urls on a simple menu, just like urlview, select, and pass
>the selected url to my palemoon email profile...
>
>/home/waltdnes/pm/palemoon/palemoon -new-instance -p email

I don't know urlview, but FWIW, I use the mouse or cursor in e.g.
emacs to select the URL (or just a part) as usual and then
Ctrl+"8th-Button" (actually lower thumb button, use xev / evtest to
find the right button number) to call the browser, done via xbindkeys:

# call browser with selected text as URL
"/home/dh/bin/browser $(xsel -o)"
Control + b:8

You can use pretty much any unused key-combination with or without the
mouse as trigger.

(that ~/bin/browser is just my little wrapper-shellscript adding e.g.
a profile option, a '-new-tab' if the browser is already running or
calling another unliked, but needed for some specific pages, browser...)

Ah: x11-misc/xbindkeys x11-misc/xsel

HTH,
-dnh

[1] https://github.com/sigpipe/urlview/issues

--
Door: Something a cat wants to be on the other side of
Re: Anyone using extract_url with mutt? [ In reply to ]
Hi Walter,

in case your problem isn't already solved net-mail/urlscan[1] might be an
alternative. Currently I maintain it in my overlay[2]. I just use it with
xdg-open or KDE's URL-click-behaviour, but according to the urlscan readme you
can "Run a command with the selected URL as the argument or pipe the selected
URL to a command." which sounds to me as your workflow.

In neomutt I use the following macro to just get all the URLs printed:
'macro pager \cb "<pipe-message> urlscan<Enter>" "description..."'

I think you could use the '--run' parameter (or the '--pipe' one if palemoon
supports that) and extend my macro to something like this:

macro pager \cb "<pipe-message> urlscan --run \
'/home/waltdnes/pm/palemoon/palemoon -new-instance -p email {}' \
<Enter>" "Open URLs in palemoon in a special profile."

Note that I test neither '--run' nor '--pipe' nor the extended macro.

[1] https://github.com/firecat53/urlscan
[2] https://git.holgersson.xyz/foss/holgersson-overlay/src/branch/master/net-mail/urlscan

Best regards,
Nils
Re: Anyone using extract_url with mutt? [ In reply to ]
On Sat, Apr 24, 2021 at 07:40:35AM +0000, Nils Freydank wrote
> Hi Walter,
>
> in case your problem isn't already solved net-mail/urlscan[1] might
> be an alternative. Currently I maintain it in my overlay[2]. I just
> use it with xdg-open or KDE's URL-click-behaviour, but according to
> the urlscan readme you can "Run a command with the selected URL as
> the argument or pipe the selected URL to a command." which sounds
> to me as your workflow.

Thanks. I simply want a list of URLs that I can select to open in
Pale Moon. If I can copy URLs into the paste buffer, even better. It's
been a long while since I last used an overlay. What are the steps to
setting up "urlscan" in an overlay? Even more basic, what are the steps
to setting up an overlay? My /etc/portage/repos.conf/

ll /etc/portage/repos.conf/
total 20
drwxr-xr-x 2 root root 4096 Dec 14 12:31 .
drwxr-xr-x 9 root root 4096 Mar 5 20:41 ..
-rw-r--r-- 1 root root 291 Dec 14 12:31 gentoo.conf
-rw-r--r-- 1 root root 74 Oct 26 2017 local.conf
-rw-r--r-- 1 root root 42 Oct 26 2017 localrepo.conf

=========

cat /etc/portage/repos.conf/gentoo.conf
[DEFAULT]
main-repo = gentoo

[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes
sync-rsync-verify-metamanifest = no

# for daily squashfs snapshots
#sync-type = squashdelta
#sync-uri = mirror://gentoo/../snapshots/squashfs

=========

cat /etc/portage/repos.conf/local.conf
[localrepo]
location = /usr/local/portage
masters = gentoo
auto-sync = no

=========

cat /etc/portage/repos.conf/localrepo.conf
[localrepo]
location = /usr/local/portage

--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
Re: Anyone using extract_url with mutt? [ In reply to ]
On Tue, Apr 27, 2021 at 09:18:14PM -0400, Walter Dnes wrote:
> On Sat, Apr 24, 2021 at 07:40:35AM +0000, Nils Freydank wrote
> > Hi Walter,
> >
> > in case your problem isn't already solved net-mail/urlscan[1] might
> > be an alternative. Currently I maintain it in my overlay[2]. I just
> > use it with xdg-open or KDE's URL-click-behaviour, but according to
> > the urlscan readme you can "Run a command with the selected URL as
> > the argument or pipe the selected URL to a command." which sounds
> > to me as your workflow.
>
> Thanks. I simply want a list of URLs that I can select to open in
> Pale Moon. If I can copy URLs into the paste buffer, even better. It's
> been a long while since I last used an overlay. What are the steps to
> setting up "urlscan" in an overlay? Even more basic, what are the steps
> to setting up an overlay? My /etc/portage/repos.conf/
>
> ll /etc/portage/repos.conf/
> total 20
> drwxr-xr-x 2 root root 4096 Dec 14 12:31 .
> drwxr-xr-x 9 root root 4096 Mar 5 20:41 ..
> -rw-r--r-- 1 root root 291 Dec 14 12:31 gentoo.conf
> -rw-r--r-- 1 root root 74 Oct 26 2017 local.conf
> -rw-r--r-- 1 root root 42 Oct 26 2017 localrepo.conf
>
> =========
>
> cat /etc/portage/repos.conf/gentoo.conf
> [DEFAULT]
> main-repo = gentoo
>
> [gentoo]
> location = /usr/portage
> sync-type = rsync
> sync-uri = rsync://rsync.gentoo.org/gentoo-portage
> auto-sync = yes
> sync-rsync-verify-metamanifest = no
>
> # for daily squashfs snapshots
> #sync-type = squashdelta
> #sync-uri = mirror://gentoo/../snapshots/squashfs
>
> =========
>
> cat /etc/portage/repos.conf/local.conf
> [localrepo]
> location = /usr/local/portage
> masters = gentoo
> auto-sync = no
>
> =========
>
> cat /etc/portage/repos.conf/localrepo.conf
> [localrepo]
> location = /usr/local/portage
>
> --
> Walter Dnes <waltdnes@waltdnes.org>
> I don't run "desktop environments"; I run useful applications
>

Hi Walter,

I'd be interested to see how this integrates in your workflow, I'm
looking for a similar solution myself. The current functionality of
mutt/neomutt leaves a bit to be desired when using it as described.

P.S thank you Nils for introducing this to me, I will likely take the
plunge in the near future.

- Steve
Re: Anyone using extract_url with mutt? [ In reply to ]
Hi Walter,

Am Dienstag, den 27.04.2021 schrieb Walter Dnes <waltdnes@waltdnes.org>:
> Thanks. I simply want a list of URLs that I can select to open in
> Pale Moon. If I can copy URLs into the paste buffer, even better. It's
> been a long while since I last used an overlay. What are the steps to
> setting up "urlscan" in an overlay? Even more basic, what are the steps
> to setting up an overlay? My /etc/portage/repos.conf/
I just drop you two links to the wiki, which do explain both an overlay from
an external/remote/foreign source aswell as a local-only overlay. I do prefer
app-eselect/eselect-repository over layman, but that is just personal
preference.

remote/foreign source:
https://wiki.gentoo.org/wiki/Ebuild_repository

local only:
https://wiki.gentoo.org/wiki/Custom_ebuild_repository

You already have a local repo in /usr/local/portage, so could use this:
> cat /etc/portage/repos.conf/localrepo.conf
> [localrepo]
> location = /usr/local/portage

Hope that helps and feel free to come back and ask if you get stuck somewhere.
Best regards,
Nils
Re: Anyone using extract_url with mutt? [ In reply to ]
On Wed, Apr 28, 2021 at 12:18:42PM +0800, Steve Kollios wrote
>
> I'd be interested to see how this integrates in your workflow, I'm
> looking for a similar solution myself. The current functionality of
> mutt/neomutt leaves a bit to be desired when using it as described.

I read email with mutt in an xterm. Here's my current my current,
deprecated, setup with Urlview. It's a two-step process...

1) In "~/.mutt/muttrc" in the "Macros" section, as one long line, tell
mutt to feed the message through "urlview" when you hit uppercase U,
either {SHIFT}{U} or "u" with {CAPSLOCK} enabled.

macro pager U ":set pipe_decode\n|urlview\n:unset pipe_decode\n" "extract URLs out of a message"

2) In "~/.urlview" two lines tell Urlview what regexp to match as a URL
and what to do when the user selects a URL. I don't know if the
"width/height" parameters are honoured any more in Pale Moon

REGEXP (((https?|ftp)|mailto):(//)?[^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]
COMMAND palemoon -width 950 -height 1050 -P email %s &

My workflow is...

* I'm reading an email, and I come across a URL I want to look at.

* I hit {SHIFT}{U} and a list of URLS from that email pops up at the top.
See the attached PNG image. I'm using a "what's coming soon" email
from Netflix as an example.

* Use the UP and DOWN keys on the keyboard to select the URL you're
interested in, i.e the arrow at the left of the image.

* Hit {ENTER} and the selected URL shows up at the bottom of my xterm.
I can edit the URL if it want to. Hitting {ENTER} again launches the
command (i.e. Pale Moon with the the email profile), or {CTRL}{C}
backs out.

--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
Re: Anyone using extract_url with mutt? [ In reply to ]
> I'd be interested to see how this integrates in your workflow,

Oops, forgote the attachment. Here it is.

--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications