2024-03-12 15:44:19 +01:00
|
|
|
#!/usr/bin/env sh
|
2024-03-19 17:40:21 +01:00
|
|
|
set -e
|
2024-03-12 15:44:19 +01:00
|
|
|
|
|
|
|
# Use local xdg-open if not in an ssh session
|
|
|
|
[ -n "$SSH_TTY" ] || exec /usr/bin/xdg-open "$@"
|
|
|
|
|
|
|
|
if [ -p /dev/stdin ]; then
|
|
|
|
exec nc -U "$XDG_RUNTIME_DIR/opener.sock" </dev/stdin
|
|
|
|
else
|
|
|
|
echo "$@" | nc -U "$XDG_RUNTIME_DIR/opener.sock"
|
|
|
|
fi
|