Compare commits
2 commits
588f9083b3
...
f391b633de
Author | SHA1 | Date | |
---|---|---|---|
Yash Karandikar | f391b633de | ||
Yash Karandikar | a5de75167b |
|
@ -1,18 +1,32 @@
|
|||
import weechat
|
||||
import wn_backend
|
||||
|
||||
weechat.register("weechat-notify", "Yash Karandikar", "22.05.11", "Unlicense", "Notification script for weechat", "", "")
|
||||
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")
|
||||
if len(arr) == 1:
|
||||
a = arr[0].split("PRIVMSG")
|
||||
b = a[0].split("!")[0].removeprefix(":")
|
||||
c = a[1].split(":")[1]
|
||||
arr = [b, c]
|
||||
|
||||
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)
|
||||
text = arr[1]
|
||||
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', '')
|
||||
|
||||
weechat.hook_signal("weechat_highlight", "notify", "")
|
||||
weechat.hook_signal("irc_pv", "notify", "")
|
||||
|
|
Loading…
Reference in a new issue