Compare commits
2 commits
997ea896d4
...
694b8f49f9
Author | SHA1 | Date | |
---|---|---|---|
Yash Karandikar | 694b8f49f9 | ||
Yash Karandikar | ff60d6b798 |
11
README.md
Normal file
11
README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# weechat-notify
|
||||
|
||||
tiny notification script for weechat.
|
||||
|
||||
i wrote this because all of the other notification scripts i could find didn't do something i wanted or were broken in another way.
|
||||
|
||||
requires: rust, notify-send, python
|
||||
|
||||
to build, first run `cargo build --release` then move `plugin.py` and the generated .so (`target/release/libwn_backend.so`) to your python script directory (probably `~/.local/share/weechat/python` but could also be `~/.weechat/python`). then rename the .so to `libwn_backend.so`
|
||||
|
||||
next, run `/script load weechat-notify.py` and enjoy your notifications!
|
18
plugin.py
Normal file
18
plugin.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import weechat
|
||||
import wn_backend
|
||||
|
||||
weechat.register("weechat-notify", "Yash Karandikar", "22.05.11", "Unlicense", "Notification script for weechat", "", "")
|
||||
|
||||
def notify(data, signal, signal_data):
|
||||
arr = signal_data.split("\t")
|
||||
nick = arr[0]
|
||||
try:
|
||||
text = arr[1]
|
||||
except IndexError:
|
||||
text = "new private message"
|
||||
wn_backend.send_notification("/usr/share/icons/Papirus-Dark/128x128/apps/weechat.svg", nick, text)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
weechat.hook_signal('weechat_highlight', 'notify', '')
|
||||
weechat.hook_signal('irc_pv', 'notify', '')
|
||||
|
Loading…
Reference in a new issue