Browse Source

integrate mailsync into mw 1

pull/276/head
Roland Puntaier 5 years ago
parent
commit
caf79d7a78
2 changed files with 19 additions and 0 deletions
  1. +11
    -0
      bin/mwimage
  2. +8
    -0
      bin/mwopen

+ 11
- 0
bin/mwimage View File

@@ -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 &

+ 8
- 0
bin/mwopen View File

@@ -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 &

Loading…
Cancel
Save