summary refs log tree commit diff
path: root/home/.local/bin/open
blob: 17cfb52343520922df78489e98b4020204f11414 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
set -eu

if [ -n "${SSH_CLIENT:-}" ]; then
	exec pbd -o "$@"
fi

case "$1" in
	(*.gif|*.jpeg|*.jpg|*.png)
		curl -LSs "$1" | imv -
		;;
	(https://youtu.be/*|https://www.youtube.com/watch*|https://twitch.tv/*)
		exec mpv "$1" >/dev/null 2>/dev/null
		;;
	(*)
		exec xterm -e w3m "$1"
		;;
esac