Dismiss notification button or gesture?
#4
Hello there,

found myself in a similar situation with a lot of notifications. With some digging, I put the following script together - dirty hack, I know, but it does the trick for at least 50 notifications. Everything after takes a lot of time to loop around.

Code:
#!/bin/bash
for i in {1..50}
  do
    gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.CloseNotification $i
  done
exit 0

But since the notification server is counting up and restarting only with Phosh restarting, the numbers go higher with every notification.

I also tried a detecting approach

Code:
#!/bin/bash
for i in {1..10}
  do
    output=$(dbus-monitor "interface='org.freedesktop.Notifications'") & gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.CloseNotification $i & pkill dbus-monitor
    if ! grep -q NameLost <<< $output; then
      break
    fi
  done
echo 'done'
exit 0

But this fails, since the ouput of dbus-monitor of an existing&closed notification is similar to a non-existing&fake-closed notification. And the script is getting slower...

But feel free to play around with the second script code.

My next steps will be some double if-conditions... Maybe.

Cheers
  Reply


Messages In This Thread
RE: Dismiss notification button or gesture? - by arno_nuehm - 02-15-2021, 01:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  System won't suspend due to suspention notification user641 6 1,424 09-24-2023, 05:47 AM
Last Post: user641
  Pinephone incoming call / SMS notification no ringing / notification volume dcinoz 3 2,859 06-02-2022, 07:16 AM
Last Post: arkadione
  volume button bug vusra 2 1,585 05-18-2022, 04:07 AM
Last Post: vusra
  Notification light when entering low power Barugon 5 3,476 11-22-2021, 06:20 AM
Last Post: beta-user
  Some apps don't have refresh button lsitongia 3 2,531 09-22-2021, 08:21 AM
Last Post: wibble
  A clear all button for notifications is coming! ragreenburg 0 1,315 08-13-2021, 09:09 AM
Last Post: ragreenburg
  Default SMS app send button off screen in vertical orientation motox6 0 1,241 05-22-2021, 02:55 PM
Last Post: motox6
  gnome-contacts not showing call nor sms button cafe 2 2,740 02-11-2021, 01:31 AM
Last Post: cafe
  SMS notification inconsistent and Wifi issue (waking up?) dcinoz 12 9,338 01-21-2021, 04:20 AM
Last Post: dcinoz

Forum Jump:


Users browsing this thread: 2 Guest(s)