Simple IRC client written in POSIX shell
i maintains two FIFOs: an input FIFO and an output FIFO. The input
FIFO is piped into the server, and the output FIFO is piped out of the
Unless noted otherwise,
$1 is the path of the input FIFO,
$2 is the
path of the output FIFO, and
$@ refers to
$3 and onward.
$XDG_CONFIG_HOME/i.conf will be sourced on startup. (If
$XDG_CONFIG_HOME is unset,
~/.config/i.conf will be sourced.)
on_start will be run on startup.
$@ is i's
on_start identifies the user as
handle_input will be called on input from the server. It
should return 0 when it doesn't handle the input and 1 when it does.
$3 is the prefix (usually the channel name),
$4 is the command, and
the remaining arguments are the rest of the input line.
handle_input always returns 0.
server will be called in order to set up the input and
server ignores SIGEXIT and runs
ncat --ssl to
handle_command handles commands (anything input that
$@ are the space-separated words in the command.
handle_command should return 0 when it doesn't handle the command, and
nonzero when it does. The default
default_handle_command, which is separated from
order to allow your
handle_command to handle default commands.
getchar prints the
$2nd character from
next prints the first space-separated field of
$1, stripping control
rest prints everything but the first space-separated field of
ident identifies you as
cleanup shuts down
default_handle_command handles some non-IRC commands which are
expected to exist. Run
/help to see them.
default_handle_command returns 0 if it doesn't handle the input and 1
if it does.