You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11 lines
389 B

  1. #!/bin/sh
  2. # Helps open a file with xdg-open from mutt in a external program without weird side effects.
  3. tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard/files"
  4. file="$tempdir/$(basename "$1")"
  5. [ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid -f xdg-open"
  6. mkdir -p "$tempdir"
  7. cp -f "$1" "$file"
  8. $opener "$file" >/dev/null 2>&1
  9. find "${tempdir:?}" -mtime +1 -type f -delete