summaryrefslogtreecommitdiff
path: root/doc/senpai.5.scd
blob: 0f70e5c373956bc39038c567e887064b6c9fc7b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
senpai(5)

# NAME

senpai - Configuration file format and settings

# DESCRIPTION

A senpai configuration file is a YAML file.

Some settings are required, the others are optional.

# SETTINGS

*addr* (required)
	The address (_host:port_) of the IRC server.  senpai only supports TLS
	connections and thus you must specify the TLS port of the server (in most
	cases, 6697 or 7000).

*nick* (required)
	Your nickname, sent with a _NICK_ IRC message. It mustn't contain spaces or
	colons (*:*).

*real*
	Your real name, or actually just a field that will be available to others
	and may contain spaces and colons.  Sent with the _USER_ IRC message.  By
	default, the value of *nick* is used.

*user*
	Your username, sent with the _USER_ IRC message and also used for SASL
	authentication.  By default, the value of *nick* is used.

*password*
	Your password, used for SASL authentication.

*highlights*
	A list of keywords that will trigger a notification and a display indicator
	when said by others.  By default, senpai will use your current nickname.

*on-highlight*
	A command to be executed via _sh_ when you are highlighted.  The following
	environment variables are set with repect to the highlight, THEY MUST APPEAR
	QUOTED IN THE SETTING, OR YOU WILL BE OPEN TO ATTACKS.

[[ *Environment variable*
:< *Description*
|  BUFFER
:  buffer where the message appeared
|  HERE
:  equals 1 if _BUFFER_ is the current buffer, 0 otherwise
|  MESSAGE
:  content of the message
|  SENDER
:  nickname of the sender

*nick-column-width*
	The number of cell that the column for nicknames occupies in the timeline.
	By default, 16.

*chan-column-width*
	The number of cell that the column for channels occupies.  By default, 16.

*no-tls*
	Disable TLS encryption.  Defaults to false.

*no-typings*
	Prevent senpai from sending typing notifications which let others know when
	you are typing a message.  Defaults to false.

*mouse*
	Enable or disable mouse support.  Defaults to true.

*debug*
	Dump all sent and received data to the home buffer, useful for debugging.
	By default, false.

# EXAMPLES

A minimal configuration file to connect to freenode as "Guest123456":

```
addr: chat.freenode.net:6697
nick: Guest123456
```

A more advanced configuration file that enables SASL authentication, sends
notifications on highlight and decreases the width of the nick column to 12
(note: _swaymsg_ is specific to sway, a wayland compositor.  Use whatever you
need to know if the terminal emulator that runs senpai has focus):

```
addr: chat.freenode.net:6697
nick: Guest123456
user: senpai
real: Guest von Lenon
password: A secure password, I guess?
highlights:
	- guest
	- senpai
on-highlight: |
    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" "$MESSAGE"
    fi
nick-column-width: 12
```

# SEE ALSO

*senpai*(1)