Waking my #Librem5 from suspend when a new #matrix message triggers a notification.
Starring:
- matrix server: #conduit
- #UnifiedPush and notification server: #ntfy
- #sip client: #pjsua
- #fractal: matrix client
- #feedbackd: rhythm & sound
Receiving SMS plays a long tune on my #Librem5. For a few persons I'd like to have this tune played also if they send me a message using #matrix.
A problem is that the #fractal flatpak does not use #feedbackd yet to signal new messages and on #PureOS #Byzantium there's no way to define different sounds for different notification events.
So I started testing a small script to read notifications and trigger feedback for messages coming from an account containing some string:
#!/usr/bin/python3 import gi import time gi.require_version('Lfb', '0.0') from gi.repository import Lfb from gi.repository import GLib import dbus from dbus.mainloop.glib import DBusGMainLoop def print_notification(bus, message): keys = ["app_name", "replaces_id", "app_icon", "summary", "body", "actions", "hints", "expire_timeout"] args = message.get_args_list() if len(args) == 8: notification = dict([(keys[i], args[i]) for i in range(8)]) if "account_i_want_to_be_notified_for_like_it_would_be_sms" in notification["summary"]: print( notification["summary"], ': ', notification["body"] ) event.trigger_feedback() Lfb.init('org.sigxcpu.lfbexample') event = Lfb.Event.new('message-new-sms') loop = DBusGMainLoop(set_as_default=True) session_bus = dbus.SessionBus() session_bus.add_match_string("type='method_call',interface='org.freedesktop.Notifications',member='Notify',eavesdrop=true") session_bus.add_message_filter(print_notification) GLib.MainLoop().run()
Story is probably not new: using a #Librem5 (linux mobile) and everybody insists on using WhatsApp. I didn't care. But all activities the kids want to take part: #WhatsApp.
I could try to evangelize all these football trainers, parents representatives at schools, parents of friends to use something that I'm able to use on my linux phone, but I can't: lack of energy, lack of time, lack of alternatives with the same feature set and stability.
Got out an old Sony Z1 running #CarbonROM. Really old software. Got an so far unused SIM. I used Aurora Store from F-Droid to install WhatsApp from the Google Store on that Android. Registered to WhatsApp and it worked fine sending one test message that never arrived, because the other side didn't have my phone number in their contacts (I guess).
I installed #conduit as a #matrix server on my #yunohost and put mautrix-whatsapp #bridge on its own system using the latest docker image following the documentation to get a minimum configuration running.
Yeah, works. Coupled WhatsApp on the Android Z1 with the bridge and send two test messages resulting in This account can no longer use WhatsApp due to spam shown on the #Android device.
Is that most likely because of my 10+ years device + rooted + Magisk + fake google app store #Aurora or is it something others are experiencing when trying to use the bridge with of the shelf devices, too?
My plan has been to run an independent phone number for WhatsApp on a device that only has contacts for WhatsApp in its phone book and make it available to family members through matrix.
Our participation in society relies in many aspects on the goodwill of a few monopolistic companies that we depend on. They write the rules which device (Android or iOS) and which software (only their own doing whatever they program it to do) we're supposed to use. They train the algorithms that can cut you off our participation.
I wouldn't care the least. I'd even smile when reading this thinking that it's exactly what people supporting companies like facebook/whatsapp deserve. But if the participation of my kids in society is at stake (and not my own which I well can organize without any messenger) it makes me sad.
Just registered an un-official #matrix room for #packetfence.
https://matrix.to/#/!lZIzquHjbvBkogyIhq:matrix.org?via=librem.one&via=matrix.org