Perform actions based on notification content

From Lucca's Wiki
Revision as of 00:00, 6 October 2025 by Lucka (talk | contribs) (Created page with " #!/usr/bin/env bash n1='buff luigi' n2='ripped mario' dbus-monitor "interface=org.freedesktop.Notifications" | grep -i -e "$n1" -e "$n2" --line-buffered | while read found_line; do echo "$found_line" mpv "${HOME}/share/audio/dark_souls_2_parry.mp3" # replace with your command done")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
#!/usr/bin/env bash
n1='buff luigi'  
n2='ripped mario'  

dbus-monitor "interface=org.freedesktop.Notifications" |
grep -i -e "$n1" -e "$n2" --line-buffered |
while read found_line; do
  echo "$found_line" 
  mpv "${HOME}/share/audio/dark_souls_2_parry.mp3" # replace with your command
done