# 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", "title": "Android notifications for WeeChat in Termux", "tags": ["Technology", "Android", "CLI", "Termux", "IRC", "Weechat"], "oldurls": [ "technology\/2016\/1\/05\/android-notifications-for-weechat-in-termux\/" ] } - --- [![Screenshot](media/images/Screenshot-weechat-termux.webp)](media/images/big/Screenshot-weechat-termux.webp) 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://play.google.com/store/apps/details?id=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://play.google.com/store/apps/details?id=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/jMQY6R5QFAmO3UnMACgkQ64/jMQY6 R5Qv7A/+Mg6nJZFFWE2rRdaBmZUxLAJT/4SWHKGUm7Kd6kHLnyrMmjKXFPQh7+ts xGV3U5J2HuBhLcDiDF7LHkO0SHYIzFpCdfmCnywgenwSdOdC5buXaNoerTU1HMsB FukNQtWAMsjNxT/D4zwq80BeKZ0aZOMNcAAfKBQpQmq8AO5Kr28t3kmqdfnOeM6t AW0gl/utZDC4xgZ1dMCDlTCPSyDgK6lsE/koh0YDEVFUoK+kDhFILu0JtYIkaSR+ sr8ZyvD5FxAs7F/O9KZQtsaQT5sDn+w8cGpv/M52uWwckmsA4NV/iCM2TdcvrFzi p1ZV+mr0nlJnsF/mH3lTDQm0cgh45QgqDWl5sh8IEgyeXMfDVmeRvwQan9sAXsLX wT9TQpy4eZd8je+F7s7BbTgEWCunTUhrUTf5YJTFie9NdKA/lIeyz2gmHc+geFau w92Ilx5+I7oGJ1o0UtImQjEXjob5mN6SVMG4g03wH/TQ02vRRvqB3izdJ+kvGIef mnwdC3O6pUe16KnJHEd722cc5NVQct+ld2S3JKxM1r4tqZYMb3ez6qJ5Q7THmwej giL+CbFNXPnNyzue9U2GVjd45pfNqadZNrDPFV32wIGurQ7RX1M3nNGg0lEOL0Cs aXKN3KYHVnScyNiH2k0+oRkAIIESVNcFen7DNQerqhhKKmhx3Cg= =rIf1 -----END PGP SIGNATURE-----