11-19-2021, 11:17 AM
Did this ever get addressed? I speculate that you can use gdbus to catch the notification and kill it before it causes the blue light to flash. My solution would follow this vague outline:
A script watches dbus-monitor for a method call of Notify
The script matches whatever power notification I want to auto-dismiss
The script notes the serial of this method
The script watches for a subsequent line with that reply_serial
The script notes the returned quantity, the notification ID
The script calls CloseNotification on that notification ID (see suspend-wake notes for example syntax)
Find out what notification it is:
dbus-monitor --session "interface=org.freedesktop.Notifications" >> ~/Desktop/MyNotificationLog.txt
I'd log the dbus-monitor to a log file:
dbus-monitor --session >> ~/Desktop/MyNotificationLog.txt
When the blue light comes on I'd do a grep on that file and look for where it matches that notification:
grep ~/Desktop/MyNotificationLog.txt -e "interface=org.freedesktop.Notifications; member=Notify" -A4
If the last line says the text of the notification, I'd make note of the serial=N1 number. I'd do a grep
grep ~/Desktop/MyNotificationLog.txt -e "reply_serial=N1 " -A1
I'd make a note of the return quantity, unit32 N2, and do:
gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.CloseNotification N2
A script watches dbus-monitor for a method call of Notify
The script matches whatever power notification I want to auto-dismiss
The script notes the serial of this method
The script watches for a subsequent line with that reply_serial
The script notes the returned quantity, the notification ID
The script calls CloseNotification on that notification ID (see suspend-wake notes for example syntax)
Find out what notification it is:
dbus-monitor --session "interface=org.freedesktop.Notifications" >> ~/Desktop/MyNotificationLog.txt
I'd log the dbus-monitor to a log file:
dbus-monitor --session >> ~/Desktop/MyNotificationLog.txt
When the blue light comes on I'd do a grep on that file and look for where it matches that notification:
grep ~/Desktop/MyNotificationLog.txt -e "interface=org.freedesktop.Notifications; member=Notify" -A4
If the last line says the text of the notification, I'd make note of the serial=N1 number. I'd do a grep
grep ~/Desktop/MyNotificationLog.txt -e "reply_serial=N1 " -A1
I'd make a note of the return quantity, unit32 N2, and do:
gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.CloseNotification N2