aboutsummaryrefslogtreecommitdiff
path: root/scripts/open
blob: 23f12fe2a3d4919a3377b6d2c944f884757fdc0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -eu

if [ -z "${1:-}" ]; then
	exit
fi

set -x

case "$1" in
  *.ico|*.jpg|*.jpeg|*.png)
    feh "$1"
    ;;
  https://www.youtube.com/watch*)
    vid "$1"
    ;;
  http*|*.svg|*.html)
    "$BROWSER" "$1"
    ;;
  *.pdf|*.djvu)
    nohup zathura "$1" 1>&2 2>/dev/null &
    ;;
  *.flac|*.ogg|*.mkv)
    vid "$1"
    ;;
  *)
    /run/current-system/sw/bin/xdg-open "$1"
    ;;
esac