aboutsummaryrefslogtreecommitdiff
path: root/config/newsboat/opener.sh
blob: 772b35c5d1e7ff324ca21e1986825d86658548ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

type="$1"; shift;

video() { mpv --player-operation-mode=pseudo-gui "$@"; }
image() { feh -x -F --image-bg "#0f0c19" "$@"; }

case "$type" in
  image) image "$@" ;;
  video|audio) video "$@" ;;
  *)
    case "$1" in
      https://*youtube.com/watch*) video "$@" ;;
      https://youtu.be/*) video "$@" ;;
      *) sensible-browser "$@" 2>&1 >/dev/null & disown ;;
    esac
  ;;
esac;