# 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/jMQY6R5QFAmYUKjwACgkQ64/jMQY6 R5S33hAAqh4+J9WICANx1rYdLgx/ZoYDRl7a6Wh/zKDSo0aDhe/8+r1ETkPm6lk7 3d/0Pxwr5Ke+K0xM+h69Zx1wEyEiMUkLpBAqkW+3Zb+jXgyHtcq5He7ONFRo/R97 MxIZr2ouAMj8n9X31FPRxJF469yyt+hgW01Uc9DUBL1lzq8xCqo7VRDMBvBF6ti1 iQWbSW3WV/tv6wM9SrK4bLbRM4AWfVhC++Hdg4ILRK1D6huBuIiyQk2ByhxStpN/ TpMHkmO+1R7oLY8v1ANwlHhyfW3It87pfMbuifGpz/lljxwTeRz6GDsBKBbuIFDM BGG8IBswPSyEnZyKb4FNIo+6+HYhe7URiEivSJPPLXCiLiDAHNJOBc3M4MYEo1KC 45Nl1zjYkihkhVmuoBk/MsIYM4J/JZ7THT+EBWUQXW0JOrbVNrvlQeBKeS3CK/r2 Q9VoKS6cOadZUuwTyVJpN8jT/mgVRZ0NdT1pQLeqNJIyfsZfTFO4uS/Li3LHYd+t U1XKM8wksG0TW9vx4n+w8cK93iFrkuXE3xQmqTjbq04yjBHxCWbITgkqVNDun0UY Ki+ujkiSeVfNcxZI35MfsaWHURMPTewyhwcl3+TENJBj5qHZTek7upkzM/HZ7Z3+ 4q5sIype5y3s3eM4Cq4W+ChAjNRzRQsfqAvVEaNZqLgwug/XnNc= =ng4/ -----END PGP SIGNATURE-----