mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 04:20:23 +00:00
Reliably dismiss notification based on a summary match
This commit is contained in:
13
bin/omarchy-notification-dismiss
Executable file
13
bin/omarchy-notification-dismiss
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if (($# == 0)); then
|
||||
echo "Usage: omarchy-notification-dismiss <summary>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find the first notification whose 'summary' matches the regex in $1
|
||||
notification_id=$(makoctl list | grep -F "$1" | head -n1 | sed -E 's/^Notification ([0-9]+):.*/\1/')
|
||||
|
||||
if [[ -n $notification_id ]]; then
|
||||
makoctl dismiss -n $notification_id
|
||||
fi
|
||||
@@ -16,7 +16,7 @@ invisible=false
|
||||
default-timeout=0
|
||||
|
||||
[summary~="Setup Wi-Fi"]
|
||||
on-button-left=exec sh -c 'alacritty --class=Impala -e impala & makoctl dismiss -n "$id"'
|
||||
on-button-left=exec sh -c 'omarchy-notification-dismiss "Setup Wi-Fi"; alacritty --class=Impala -e impala'
|
||||
|
||||
[summary~="Update System"]
|
||||
on-button-left=exec sh -c 'omarchy-launch-floating-terminal-with-presentation omarchy-update & makoctl dismiss -n "$id"'
|
||||
on-button-left=exec sh -c 'omarchy-notification-dismiss "Update System"; omarchy-launch-floating-terminal-with-presentation omarchy-update'
|
||||
|
||||
Reference in New Issue
Block a user