Adding notify-log script to local/bin.

This commit is contained in:
Derek Taylor 2023-01-01 12:47:12 -06:00
parent ce12f85eaa
commit b40026471e
1 changed files with 11 additions and 0 deletions

11
.local/bin/notify-log Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
logfile=$1
dbus-monitor "interface='org.freedesktop.Notifications'" |\
grep --line-buffered "string" |\
grep --line-buffered -e method -e ":" -e '""' -e urgency -e notify -v |\
grep --line-buffered '.*(?=string)|(?<=string).*' -oPi |\
grep --line-buffered -v '^\s*$' |\
xargs -I '{}' \
printf "---$( date )---\n"{}"\n" >> $logfile