summaryrefslogtreecommitdiff
path: root/src/caelestia/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/caelestia/utils')
-rw-r--r--src/caelestia/utils/notify.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/caelestia/utils/notify.py b/src/caelestia/utils/notify.py
index ad1ef33..ee86236 100644
--- a/src/caelestia/utils/notify.py
+++ b/src/caelestia/utils/notify.py
@@ -3,3 +3,18 @@ import subprocess
def notify(*args: list[str]) -> str:
return subprocess.check_output(["notify-send", "-a", "caelestia-cli", *args], text=True).strip()
+
+
+def close_notification(id: str) -> None:
+ subprocess.run(
+ [
+ "gdbus",
+ "call",
+ "--session",
+ "--dest=org.freedesktop.Notifications",
+ "--object-path=/org/freedesktop/Notifications",
+ "--method=org.freedesktop.Notifications.CloseNotification",
+ id,
+ ],
+ stdout=subprocess.DEVNULL,
+ )