summary refs log tree commit diff
path: root/bin/clear-notification
diff options
context:
space:
mode:
Diffstat (limited to 'bin/clear-notification')
-rwxr-xr-xbin/clear-notification11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/clear-notification b/bin/clear-notification
new file mode 100755
index 0000000..e58ddb2
--- /dev/null
+++ b/bin/clear-notification
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -eu
+if [ -z "$1" ]; then
+	printf "error: missing notification id\n" >&2
+	exit 1
+fi
+exec gdbus call --session \
+	--dest org.freedesktop.Notifications \
+	--object-path /org/freedesktop/Notifications \
+	--method org.freedesktop.Notifications.CloseNotification \
+	"$1" >/dev/null