summary refs log tree commit diff
path: root/home/.local/bin/open
blob: 9439f07d81b817dbc75f9b3e9a1cbe4b13d4e307 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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/*)
		ulimit -c 0 # mpv segfaults on exit every time on OpenBSD...
		exec mpv "$1" >/dev/null 2>&1
		;;
	(*)
		exec firefox -new-tab "$1" >/dev/null 2>&1
		;;
esac
/commit/bin/qf.c?id=77113cf667e1f4fbccc337b508d0f81b1f4b7563&follow=1'>Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe