.\" Generated by scdoc 1.11.2 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "senpai" "5" "2023-11-27" .P .SH NAME .P senpai - Configuration file format and settings .P .SH DESCRIPTION .P A senpai configuration file is a scfg file.\& See https://git.\&sr.\&ht/~emersion/scfg.\& .P Some settings are required, the others are optional.\& .P .SH SETTINGS .P \fBaddress\fR (required) .RS 4 The address (\fIhost[:port]\fR) of the IRC server.\& senpai uses TLS connections by default unless you specify \fBtls\fR option to be \fBfalse\fR.\& TLS connections default to port 6697, plain-text use port 6667.\& .P An optional scheme can be specified (scheme://\fIhost[:port]\fR): .P .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} irc:// is the implicit default, TLS is enabled or disabled according to the \fBtls\fR configuration value.\& .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} ircs:// enables TLS.\& .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} irc+insecure:// disables TLS (plain-text IRC).\& .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} ircs+insecure:// enables TLS but skips TLS certificate verification.\& This protects against passive MITM attacks but not against active MITM attacks.\& .RE .P .RE \fBnickname\fR (required) .RS 4 Your nickname, sent with a \fINICK\fR IRC message.\& It mustn'\&t contain spaces or colons (\fB:\fR).\& .P .RE \fBrealname\fR .RS 4 Your real name, or actually just a field that will be available to others and may contain spaces and colons.\& Sent with the \fIUSER\fR IRC message.\& By default, the value of \fBnick\fR is used.\& .P .RE \fBusername\fR .RS 4 Your username, sent with the \fIUSER\fR IRC message and also used for SASL authentication.\& By default, the value of \fBnick\fR is used.\& .P .RE \fBpassword\fR .RS 4 Your password, used for SASL authentication.\& See also \fBpassword-cmd\fR.\& .P .RE \fBpassword-cmd\fR command [arguments.\&.\&.\&] .RS 4 Alternatively to providing your SASL authentication password directly in plaintext, you can specify a command to be run to fetch the password at runtime.\& This is useful if you store your passwords in a separate (probably encrypted) file using `gpg` or a command line password manager such as \fIpass\fR or \fIgopass\fR.\& If a \fBpassword-cmd\fR is provided, the value of \fBpassword\fR will be ignored and the first line of the output of \fBpassword-cmd\fR will be used for login.\& .P .RE \fBchannel\fR .RS 4 A space separated list of channel names that senpai will automatically join at startup and server reconnect.\& This directive can be specified multiple times.\& .P .RE \fBhighlight\fR .RS 4 A space separated list of keywords that will trigger a notification and a display indicator when said by others.\& This directive can be specified multiple times.\& .P By default, senpai will use your current nickname.\& .P .RE \fBon-highlight-beep\fR .RS 4 Enable sending the bell character (BEL) when you are highlighted.\& Defaults to disabled.\& .P .RE \fBon-highlight-path\fR .RS 4 Alternative path to a shell script to be executed when you are highlighted.\& By default, senpai looks for a highlight shell script at $XDG_CONFIG_HOME/senpai/highlight.\& If no file is found at that path, and an alternate path is not provided, highlight command execution is disabled.\& .P If unset, $XDG_CONFIG_HOME defaults to \fB~/.\&config/\fR.\& .P Before the highlight script is executed, the following environment variables are populated: .P Shell scripts MUST ENSURE VARIABLES appear QUOTED in the script file, OR YOU WILL BE OPEN TO SHELL INJECTION ATTACKS.\& Shell scripts must also ensure characters like '\&*'\& and '\&?\&'\& are not expanded.\& .P .RE .TS allbox;l lx l lx l lx l lx l lx. T{ \fBEnvironment variable\fR T} T{ \fBDescription\fR T} T{ BUFFER T} T{ buffer where the message appeared T} T{ HERE T} T{ equals 1 if \fIBUFFER\fR is the current buffer, 0 otherwise T} T{ MESSAGE T} T{ content of the message T} T{ SENDER T} T{ nickname of the sender T} .TE .sp 1 .RS 4 Note: when passing those to \fBnotify-send\fR(1), some notification daemons use \fB\\\fR for escape sequences in the body, which causes \fB\\\fR to disappear from the message or triggers unintended side-effects (like newlines).\& .P To get around this, you can double the backslash with the following snippet: .P .RE .nf .RS 4 #!/bin/sh escape() { printf "%s" "$1" | sed \&'s#\\#\\\\#g\&' } notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")" .fi .RE .P \fBpane-widths\fR { .\&.\&.\& } .RS 4 Configure the width of various UI panes.\& .P Pane widths are set as sub-directives of the main \fBpane-widths\fR directive: .P .RE .nf .RS 4 pane-widths { nicknames 16 } .fi .RE .P .RS 4 This directive supports the following sub-directives: .P \fBnicknames\fR .RS 4 The number of cells that the column for nicknames occupies in the timeline.\& By default, 14.\& .P .RE \fBchannels\fR .RS 4 The number of cells that the column for channels occupies on screen.\& By default, 16.\& Use special value 0 to make the channel list horizontal.\& If the value is negative, the channel list will be horizontal by default and will take the positive (opposite) width value when toggled with F7.\& .P .RE \fBmembers\fR .RS 4 The number of cells that that the column for the list of channel members occupies on screen.\& By default, 16.\& Use special value 0 to disable.\& If the value is negative, the member list will be disabled by default and will take the positive (opposite) width value when toggled with F8.\& .P .RE \fBtext\fR .RS 4 The maximum message text line width for messages, in number of cells.\& By default, the value is zero, which means that there is no maximum.\& Useful for keeping a readable line width on large screens.\& .P .RE .RE \fBtls\fR .RS 4 Enable TLS encryption.\& Defaults to true.\& .P .RE \fBtypings\fR .RS 4 Send typing notifications which let others know when you are typing a message.\& Defaults to true.\& .P .RE \fBmouse\fR .RS 4 Enable or disable mouse support.\& Defaults to true.\& .P .RE \fBcolors\fR { .\&.\&.\& } .RS 4 Settings for colors of different UI elements.\& .P Colors can be set either by name ("red"), by number (from 0 to 255, for the default 256 terminal colors; -1 meaning default), or by RGB hex true color (\fB#\fR\fIrrggbb\fR).\& .P Colors are set as sub-directives of the main \fBcolors\fR directive: .P .RE .nf .RS 4 colors { prompt green } .fi .RE .P .TS allbox;l lx l lx l lx l lx l lx. T{ \fBSub-directive\fR T} T{ \fBDescription\fR T} T{ prompt T} T{ color for ">"-prompt that appears in command mode T} T{ unread T} T{ foreground color for unread buffer names in buffer lists T} T{ status [.\&.\&.\&] T} T{ foreground color for status event lines (e.\&g.\& join, part, nick changes) in buffers, see table below T} T{ nicks [.\&.\&.\&] T} T{ color scheme for user nicks, see table below T} .TE .sp 1 .TS allbox;l lx l lx l lx. T{ \fBstatus sub-directive\fR T} T{ \fBDescription\fR T} T{ status T} T{ show status events with the specified color T} T{ status disabled T} T{ hide status events T} .TE .sp 1 .TS allbox;l lx l lx l lx l lx. T{ \fBnicks sub-directive\fR T} T{ \fBDescription\fR T} T{ nicks base T} T{ show nicks with 16 different colors (default) T} T{ nicks extended T} T{ show nicks with 256 different colors T} T{ nicks fixed [ [self]] T} T{ show nicks with a fixed color, optionally specifying the colors for other nicks, and self T} .TE .sp 1 \fBdebug\fR .RS 4 Advanced.\& Dump all sent and received data to the home buffer, useful for debugging.\& Defaults to false.\& .P .RE \fB-transient\fR .RS 4 Advanced.\& Run an ephemeral instance without disk reads/writes (except for the initial configuration).\& .P .RE .SH EXAMPLES .P A minimal configuration file to connect to Libera.\&Chat as "Guest123456": .P .nf .RS 4 address irc\&.libera\&.chat nickname Guest123456 .fi .RE .P A more advanced configuration file that enables SASL authentication, fetches the password from an external program instead of storing in plaintext, sends notifications on highlight and decreases the width of the nick column to 12 (note: \fIswaymsg\fR is specific to sway, a wayland compositor.\& Use whatever you need to know if the terminal emulator that runs senpai has focus): .P .nf .RS 4 address irc\&.libera\&.chat nickname Guest123456 username senpai realname "Guest von Lenon" password-cmd gopass show irc/guest # use your favorite CLI password solution here channel "#rahxephon" highlight guest senpai highlight lenon # don\&'t know why you\&'d split it into multiple lines, but you can if you want pane-widths { nicknames 12 } .fi .RE .P And the highlight file (\fB~/.\&config/senpai/highlight\fR): .nf .RS 4 #!/bin/sh escape() { printf "%s" "$1" | sed \&'s#\\#\\\\#g\&' } FOCUS=$(swaymsg -t get_tree | jq \&'\&.\&.|objects|select(\&.focused==true)|\&.name\&' | grep senpai | wc -l) if [ "$HERE" -eq 0 ] || [ $FOCUS -eq 0 ]; then notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")" fi .fi .RE .P .SH SEE ALSO .P \fBsenpai\fR(1)