Skip to content
Arijit Basu edited this page Apr 11, 2021 · 21 revisions

Pipes provide a way to interact with the xplr sessions from different programs. This, along with the environment variables allows xplr to integrate with the other tools.

Each xplr session will create its own set of input and output pipes.

As of now, these are the available pipes

Pipe Purpose
$XPLR_PIPE_MSG_IN read messages from other programs.
$XPLR_PIPE_FOCUS_OUT write the focused node path for other programs to read.
$XPLR_PIPE_SELECTION_OUT write the new-line delimited selected paths for other programs to read.
$XPLR_PIPE_MODE_OUT write the current mode name for other programs to read.
$XPLR_PIPE_GLOBAL_HELP_MENU_OUT write the global help menu for anyone to read.
$XPLR_PIPE_LOGS_OUT write the logs for anyone to read.
$XPLR_PIPE_RESULT_OUT write the currect result (selection or focused path).
$XPLR_PIPE_DIRECTORY_NODES_OUT write the absolute path of filtered nodes in present working directory.

We can pass messages to a running xplr session if we know its runtime path, which is made unique by the session's $XPLR_PID. Generally the input pipe is a file named msg_in inside $XPLR_SESSION_PATH/pipe/, also exported as $XPLR_PIPE_MSG_IN.

Example message passing:

echo ChangeDirectory: /tmp >> "${XPLR_PIPE_MSG_IN:?}"
echo FocusNext >> "${XPLR_PIPE_MSG_IN:?}"
Clone this wiki locally