summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-26 18:01:07 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-26 18:01:07 +1100
commite2a0c19267418d162781a559422e600ac30b71f3 (patch)
tree02209e898c3fbf6454289d95c1ff72c5f7e1a4f7
parentupdates: sort updates by name (diff)
downloadcaelestia-shell-e2a0c19267418d162781a559422e600ac30b71f3.tar.gz
caelestia-shell-e2a0c19267418d162781a559422e600ac30b71f3.tar.bz2
caelestia-shell-e2a0c19267418d162781a559422e600ac30b71f3.zip
notifpopups: activate action if only one
-rw-r--r--src/modules/notifpopups.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/notifpopups.tsx b/src/modules/notifpopups.tsx
index c3f687a..0332fa7 100644
--- a/src/modules/notifpopups.tsx
+++ b/src/modules/notifpopups.tsx
@@ -31,8 +31,12 @@ export default () => (
self.add(
<eventbox
onClick={(_, event) => {
- // Go to notif center on primary click
- if (event.button === Astal.MouseButton.PRIMARY) App.get_window("notifications")?.show();
+ // Activate notif or go to notif center on primary click
+ if (event.button === Astal.MouseButton.PRIMARY) {
+ if (notification.actions.length === 1)
+ notification.invoke(notification.actions[0].id);
+ else App.get_window("notifications")?.show();
+ }
// Dismiss on middle click
else if (event.button === Astal.MouseButton.MIDDLE) notification.dismiss();
}}