dotfiles

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

commit 32774c14adad661948bf3e2a7f87e3eb12ee278f
parent a497af2c5c50438c5759a5c24908b47afb8839bf
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon, 29 Jun 2020 16:46:03 +0200

Add happiness & cyanide integration into comic script

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

diff --git a/.local/bin/comic b/.local/bin/comic @@ -26,6 +26,9 @@ case "$url" in sed 's/^.*https/https/;s/".*$//'))" alttext="$(printf '%s' "$html" | grep 2x | tail -1 | \ sed 's/.*title="//;s/".*//')";; + *explosm*) + f="$(mktemp)" + hurl "$(hurl "$url" | sed -nE '/.*<meta property="og:image" content="([^"]*)">/{ s//\1/;p; }')" > "$f";; *) (>&2 echo "unknown site") exit 1;; diff --git a/.local/bin/plumb b/.local/bin/plumb @@ -207,7 +207,7 @@ handle_target() { $prefix sxiv "$(fetch "$t")" elif regeximatch "$t" '\.(pdf|ps|epub|djvu)$'; then $prefix zathura "$(fetch "$t")" - elif regeximatch "$t" '(smbc-comics\.com|xkcd\.com|jspowerhour\.com)'; then + elif regeximatch "$t" '(smbc-comics\.com|xkcd\.com|jspowerhour\.com|explosm\.net)'; then cd /tmp && detach comic "$t" elif regexmatch "$t" '.*doi.*10\.[0-9]*\/'; then detach $prefix $BROWSER "https://doi.org/${t}"