dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit 9525a50243f75ff7add818a237f5cf299e6cbd20
parent 7d8578ab168f3bd842d95deb7d6b84f300948f6f
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue,  9 Mar 2021 12:47:34 +0100

comic, plumb: handle patchfriday

Diffstat:
M.local/bin/comic | 6++++++
M.local/bin/plumb | 2+-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.local/bin/comic b/.local/bin/comic @@ -55,6 +55,10 @@ process_url() { html="$(fetch "$1")" $fetcher "$(sed -nE '/.*<meta property="og:image" content="([^"]*)">/{ s//\1/;p; }' "$html")" > "$img";; + *patchfriday*) + html="$(fetch "$1")" + $fetcher "https://patchfriday.com$(sed -nE '/.*<img src="([^"]*)" .*/{ + s//\1/;p; }' "$html")" > "$img";; *) die "unknown site: $1";; esac @@ -77,6 +81,8 @@ for u in "$@"; do u="https://www.jspowerhour.com";; xkcd) u="https://xkcd.com";; + patchfriday) + u="https://patchfriday.com";; esac process_url "$u" done diff --git a/.local/bin/plumb b/.local/bin/plumb @@ -239,7 +239,7 @@ handle_uri() { $prefix sxiv -a -s f "$(unwebp -e "$(fetch "$t")")" elif regeximatch "$t" '\.(pdf|ps|epub|djvu)$'; then $prefix zathura "$(fetch "$t")" - elif regeximatch "$t" '(smbc-comics\.com|xkcd\.com|jspowerhour\.com|explosm\.net)'; then + elif regeximatch "$t" '(smbc-comics\.com|xkcd\.com|jspowerhour\.com|explosm\.net|patchfriday\.com)'; then cd /tmp && detach comic "$t" elif regexmatch "$t" '^doi.*10\.[0-9]*\/'; then t="${t#doi://}"