commit fa3e0e302b004d0d8e1c1d0040b0b242d22c2eb9
parent f7e83c7f0794c3f29390e8ed635a27710a01a5b2
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sat, 20 Feb 2021 20:38:27 +0100
plumb: convert remote svg files to png
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/.local/bin/plumb b/.local/bin/plumb
@@ -219,6 +219,10 @@ handle_url() {
$prefix mplayer "$(fetch "$t")"
elif regeximatch "$t" '\.(png|jpg|jpeg|tif|bmp|gif)$'; then
$prefix sxiv -a -s f "$(fetch "$t")"
+ elif regeximatch "$t" '\.svg$'; then
+ _o="$(mktemp)"
+ convert svg:- png:- <"$(fetch "$t")" > "$_o"
+ sxiv -s f "$_o"
elif regeximatch "$t" '\.webp$'; then
$prefix sxiv -a -s f "$(unwebp -e "$(fetch "$t")")"
elif regeximatch "$t" '\.(pdf|ps|epub|djvu)$'; then