Просмотр исходного кода

more general openfile script

tags/v3.1
Luke Smith 5 лет назад
Родитель
Сommit
26c0df4511
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4C50B54A911F6252
3 измененных файлов: 16 добавлений и 13 удалений
  1. +0
    -11
      etc/htmlopen.sh
  2. +2
    -2
      etc/mailcap
  3. +14
    -0
      etc/openfile.sh

+ 0
- 11
etc/htmlopen.sh Просмотреть файл

@@ -1,11 +0,0 @@
#!/bin/sh

# Helps open an HTML file from mutt in a GUI browser without weird side effects.

file=$(mktemp -u --suffix=.html)

rm -f "$file"

cp "$1" "$file"

setsid firefox "$file" >/dev/null 2>&1 &

+ 2
- 2
etc/mailcap Просмотреть файл

@@ -1,7 +1,7 @@
text/plain; vim %s ;
text/html; ~/.config/mutt/etc/htmlopen.sh %s ;
text/html; ~/.config/mutt/etc/openfile.sh %s ;
text/html; w3m -I %{charset} -T text/html; copiousoutput;
image/*; ~/.config/mutt/etc/muttimage.sh %s ; copiousoutput
video/*; setsid mpv --quiet %s &; copiousoutput
application/pdf; cp '%s' /tmp/doc.pdf && setsid zathura /tmp/doc.pdf &; copiousoutput;
application/pdf; ~/.config/mutt/etc/openfile.sh %s ;
application/pgp-encrypted; gpg -d '%s'; copiousoutput;

+ 14
- 0
etc/openfile.sh Просмотреть файл

@@ -0,0 +1,14 @@
#!/bin/sh

# Helps open a file with xdg-open from mutt in a external program without weird side effects.

base=$(basename "$1")
ext="${base##*.}"

file=$(mktemp -u --suffix=".$ext")

rm -f "$file"

cp "$1" "$file"

setsid xdg-open "$file" >/dev/null 2>&1 &

Загрузка…
Отмена
Сохранить