Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ To reload css after changes
- Delete/BackSpace: Close notification
- Shift+C: Close all notifications
- Shift+D: Toggle Do Not Disturb
- Ctrl+Z: Restore latest closed notification
- Buttons 1-9: Execute alternative actions
- Left click button / actions: Activate notification action
- Middle/Right click notification: Close notification
Expand Down
2 changes: 2 additions & 0 deletions man/swaync.1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c

*Shift+D*: Toggle Do Not Disturb

*Ctrl+Z*: Restore latest closed notification

*Buttons 1-9*: Execute alternative actions

*Left click button / actions*: Activate notification action
Expand Down
12 changes: 12 additions & 0 deletions src/controlCenter/controlCenter.vala
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ namespace SwayNotificationCenter {
HashTable<string, unowned NotificationGroup> noti_groups_name =
new HashTable<string, unowned NotificationGroup> (str_hash, str_equal);

Queue<Notification> notification_history = new Queue<Notification> ();

const string STACK_NOTIFICATIONS_PAGE = "notifications-list";
const string STACK_PLACEHOLDER_PAGE = "notifications-placeholder";

Expand Down Expand Up @@ -253,6 +255,14 @@ namespace SwayNotificationCenter {
case "Caps_Lock":
this.set_visibility (false);
return;
case "z":
if (state == Gdk.ModifierType.CONTROL_MASK) {
if (notification_history.length > 0) {
var first_in_history = notification_history.pop_head ();
add_notification (first_in_history.param);
}
}
return;
}
}

Expand Down Expand Up @@ -648,6 +658,8 @@ namespace SwayNotificationCenter {
foreach (var w in group.get_notifications ()) {
var noti = (Notification) w;
if (noti != null && noti.param.applied_id == id) {
notification_history.push_head (noti);

if (dismiss) {
noti.close_notification (false);
}
Expand Down