Set up opener. Support multiple hosts.
Enable with `systemctl --user enable --now opener@myhost`
This commit is contained in:
parent
fe11201cdb
commit
e176c27955
3 changed files with 22 additions and 0 deletions
bin
11
bin/xdg-open
Executable file
11
bin/xdg-open
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue