|
|
|
|
|
by PuercoPop
1313 days ago
|
|
> The plumber is cool, it’s like “what if xdg-open was good actually” Yeah, plumber is way better than xdg-open in that it is extensible and it can be invoked from a script more easily via 9P. Given how hard it to customize xdg-open, I use a xdg-open wrapper that gets the caller's name using procfs and sends it to the plumber service. That way I can open links on a different browser depending from where the link was clicked/opened from . #!/usr/bin/env bash
# this is named xdg-open and placed in a directory that is
# before /usr/bin in the $PATH
PARENT_COMMAND=$(cat "/proc/$PPID/comm")
case "$PARENT_COMMAND" in
slack)
/home/puercopop/src/plan9/bin/9 plumb -s slack "$@"
;;
zoom)
/home/puercopop/src/plan9/bin/9 plumb -s zoom "$@"
;;
*)
/usr/bin/xdg-open "$@"
;;
esac
And then on my plumbling file I have type is text
src is zoom
data matches 'https?://.*'
plumb to firefox-trunk $data
type is text
plumb to xdg-open $data
|
|