summaryrefslogtreecommitdiff
path: root/open-as-pdf
blob: cc96c09e1c14d003deaec537055895f484b8aeba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

if [ $# -eq 0 ] ; then
    echo First arguments must be a file.
    exit 1
fi

PDF_FILE="$(tempfile --suffix .pdf)"
trap 'rm "$PDF_FILE"' EXIT
unoconv --format pdf -o "$PDF_FILE" "$1" && xdg-open "$PDF_FILE" && sleep 5