How to clear system tray notification via command line

Solution 1:

If you wrote the application, you could just put a timeout on the notifications:

notify-send -t 5000 "Title" "Details"

If not, the only way I know of would be to restart the gnome desktop. You can do it by pushing Alt + F2, type "r" then Enter. But if you want to do it via command line:

killall -3 gnome-shell

Unfortunately the kill gnome option will interfere if you want to keep using applications during the flickery restart of gnome-shell.