-
Notifications
You must be signed in to change notification settings - Fork 20
/
README.txt
78 lines (58 loc) · 2.82 KB
/
README.txt
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
You can find this project online at:
https://github.com/stickster/irssi-libnotify
This is a slightly nicer D-Bus approach that plays nicely with the
GNOME Shell's notification area. If you are looking for the older,
simpler version using libnotify, simply check out the old-libnotify
branch instead.
To make this script work better for people who use irssi remotely via
SSH (often with screen), I've separated out the actual notifier into a
small listener program. That piece is written in Python so it should
be easy to read and understand.
REQUIREMENTS
============
* irssi
* libnotify >= 0.7 (but slightly older libnotify may work)
* pygobject >= 3.0
* perl-HTML-Parser
INSTRUCTIONS
============
1. Copy notify-listener.py and irssi-notifier.sh to your $HOME/bin/
directory.
2. Run gnome-session-properties and add an automatic launcher for
notify-listener.py. In very new versions of GNOME, you may need
to construct a .desktop file and add it to ~/.config/autostart/ .
3. Copy notify.pl to the $HOME/.irssi/scripts/ directory.
4. To load it at irssi launch, make sure you have a
$HOME/.irssi/scripts/autorun/ folder. Then set up a symbolic link
to the script:
$ ln -s ../notify.pl $HOME/.irssi/scripts/autorun/
5. Setup the listener background task:
$ cp notify-listener.service $HOME/.config/systemd/user/
$ systemctl --user enable notify-listener --now
6. Start or restart irssi, or else load the notify script in irssi:
/SCRIPT LOAD notify.pl
If you are running irssi remotely, currently your remote machine
account would need to be able to SSH back to your local box without a
passphrase. You'll need to set that up yourself, using 'ssh-copy-id'
or another method.
Then in irssi, use /SET notify_remote <HOST> to activate the remote
notification bit. Replace <HOST> with the name or IP address of the
local machine you're on, *as it would be known to the remote
machine*. This is most useful if you're on the same local network
with the other box; firewalls or other non-local routing will probably
make it difficult to use this feature.
If your local machine is a Mac, add the "M" character to the end of
the IP address. Obviously on Macs you can skip steps 1, 2, and 5.
The script will use the built-in osascript binary to trigger
notifications. You still need to make sure your SSH key works from
the system on which irssi is running to the Mac you're using locally.
In the future I'm going to add a feature to provide messages raw over
a remotely forwarded port, so you won't need any special key handling
or have to worry about firewalls and other such stuff. Thanks for
trying this out.
BUGS
====
Ubuntu 16.04 doesn't display notifications with normal urgency by
default. Add a line 'n.set_urgency(Notify.Urgency.CRITICAL)' to the
IrssiListener.notify method in notify-listener.py to work around this.
-- PWF 2015-03-18