diff --git a/bin/mwimage b/bin/mwimage new file mode 100755 index 0000000..c798293 --- /dev/null +++ b/bin/mwimage @@ -0,0 +1,11 @@ +#!/bin/bash + +#get image resolution +resolution=$(identify $1 | awk '{print $3}') +IFS='x' # x is set as delimiter +read -ra ADDR <<< "$resolution" +width=${ADDR[0]} +height=${ADDR[1]} + +### Display Image / offset with mutt bar +echo -e "2;3;\n0;1;0;42;$((width));$((height));0;0;0;0;$1\n4;\n3;" | /usr/lib/w3m/w3mimgdisplay & diff --git a/bin/mwopen b/bin/mwopen new file mode 100755 index 0000000..e530b3e --- /dev/null +++ b/bin/mwopen @@ -0,0 +1,8 @@ +#!/bin/sh +# Helps open a file with xdg-open from mutt in a external program without weird side effects. +[ $(uname) = "Darwin" ] && opener="open" || opener="setsid xdg-open" +mkdir -p "/tmp/$USER-mutt-tmp" +file="/tmp/$USER-mutt-tmp/$(basename "$1")" +rm -f "$file" +cp "$1" "$file" +$opener "$file" >/dev/null 2>&1 &