# Owner: glow # KeyID: E65A8520F36AEE13CFE4F56BEB8FE331063A4794 # Key: https://glow.li/pgp # Verify: curl "https://glow.li/posts/android-notifications-for-weechat-in-termux/index.html.asc" | gpg -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 +++ { "date": "2016-01-05 12:30:59+00:00", "layout": "post", "oldurls": [ "technology/2016/1/05/android-notifications-for-weechat-in-termux/" ], "tags": ["Technology", "Android", "CLI", "Termux", "IRC", "Weechat"], "title": "Android notifications for WeeChat in Termux" } +++ [![Screenshot](media/images/Screenshot-weechat-termux)](media/images/big/Screenshot-weechat-termux) I figured out how to have WeeChat in [Termux ](https://termux.com/) create a notification on your android device whenever someone mentions your username or you receive a private message. You need to have [Termux:API](https://f-droid.org/en/packages/com.termux.api/) installed for this. `All` you need to do is type following command into WeeChat: ``` /set trigger.trigger.beep.command "/print -beep;/exec -bg termux-notification -t 'IRC Notification' -c "${tg_tag_nick}: ${tg_message_nocolor}";/exec -bg termux-vibrate" ``` ## Explanation Normal WeeChat behavior is to send a BEL character to the terminal whenever someone mentions you or sends you a private message. This extends that with the commands termux-notification and termux-vibrate found in the [Termux:API](https://f-droid.org/en/packages/com.termux.api/). The content of the notification is ${tg_tag_nick} (which is the user who sent you the message) and ${tg_message_nocolor} (which is the message without coloring). [Here](https://weechat.org/files/doc/devel/weechat_user.en.html#trigger_data_print) you can find more available variables. -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5lqFIPNq7hPP5PVr64/jMQY6R5QFAmevrjMACgkQ64/jMQY6 R5RqyRAAm9N+JG3H1/sslmsVKcuoJSDCII475HiyQtrhPfRnN3nzZ0O7U0EBso/s lhVbALMq5kqlz4QClqc6wTePBRNKU6UOReW3ZMGmhbB1j8zv7E9yxRRnl2QktUCP yAkxjIiNzEt8wGFDqzr7WB8nb6T1jbyqHNMJf54rdwCh063bJocopxvXLdkYj2qC FPF7K/UBvPAjFCxRlfBfk9HaZtOr9MGx/N/d1hGWWB2Qvjz3hf3trUXtWQc2WH0z Km7oF0nU0kNp5PxG5HVggab6wYZ69oh6/cqHi2t96nqDCaHbg6IzwyJ9MC2LJ/ic B4ELzUuO156yuUkvbqiR3Mjcr45UzgjGNPyTnnR6jeqAeg/waajxHafi8AiIulvo 9UU0ti7N4ydkpdx+xse3VnSY8lC2r/f8Fe0uZFBGUnmWwcRl3aspw5Cs26A0crFV YPO+nA+5wcDzlh6+9EOr0SGu7SIyFDjgNCmqVTfqylYbEfB6t5Os4BtAxf3RaTiL E7yzSOcuppU2Vj6JrE4ZCO1MpnQZMuurUmUASh43kAITZPdAK5uRDHynmARtqfvd FsHexkF65nA1W/lksGVEOv6TpzhCAsbszremSJZHwNbZxVzYaczZMdPmlGSqRBhi sJ/UeRbakhUGN2vNSEE/gIIw41ukCLDvum5WCcprAVUYjnHCJws= =uthY -----END PGP SIGNATURE-----