From 695bc1cf68cd435a364df0251e6ae1c1ea1c71c9 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Tue, 24 Nov 2015 20:40:30 +0100 Subject: [PATCH] rifle handles image urls not exactly the right way --- local/bin/open.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/local/bin/open.sh b/local/bin/open.sh index b7932fe..e98f8e6 100755 --- a/local/bin/open.sh +++ b/local/bin/open.sh @@ -1,2 +1,5 @@ #!/bin/bash -rifle "$1" | grep 'cannot open' && xdg-open "$1" +curl -IL "$1" \ + | grep Content-Type \ + | tail -n 1 \ + | grep image && rifle "$1" || xdg-open "$1"