dotfiles/bin/xdg-open

12 lines
262 B
Text
Raw Normal View History

#!/usr/bin/env sh
2024-03-19 17:40:21 +01:00
set -e
# 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