diff --git a/debian/changelog b/debian/changelog index 11ddf6e4..bcbd5889 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,9 +7,8 @@ byobu (3.7) unreleased; urgency=low usr/lib/byobu/notify_osd, usr/share/byobu/profiles/common, usr/share/man/man1/byobu.1: - add notify_osd support to byobu, LP: #669189 - * usr/lib/byobu/.notify_osd, usr/lib/byobu/notify_osd, - usr/share/byobu/profiles/common: separate the perl into a script of - its own + - separate the perl into a script of its own + - add per-pid notifier monitors, terminate when screen terminates -- Dustin Kirkland Thu, 21 Oct 2010 12:09:14 -0500 diff --git a/usr/lib/byobu/.notify_osd b/usr/lib/byobu/.notify_osd index 081b1346..3025f1f9 100755 --- a/usr/lib/byobu/.notify_osd +++ b/usr/lib/byobu/.notify_osd @@ -27,5 +27,5 @@ while () { $msg =~ s/\s+/ /g; # collapse multi-whitespace into one $msg =~ s/\s+$//g; # strip trailing whitespace $msg =~ s/^\s+//g; # strip leading whitespace - system("/usr/bin/screen", "-X", "at", "0", "echo", "[$msg]"); + system("/usr/bin/screen", "-X", "-S", "$ARGV[0]", "at", "*", "echo", "[$msg]"); } diff --git a/usr/lib/byobu/notify_osd b/usr/lib/byobu/notify_osd index ceb60df5..e6d35237 100755 --- a/usr/lib/byobu/notify_osd +++ b/usr/lib/byobu/notify_osd @@ -20,15 +20,13 @@ LOG="$HOME"/.cache/notify-osd.log -if [ "$1" = "--detail" ]; then - cat "$LOG" - exit 0 -fi +case "$1" in + --detail) + cat "$LOG" + exit 0 + ;; +esac # This line operates basically as a daemon, watching the notify-osd log file, # processing new messages and sending them to screen -if ! ps -ef | grep -qs "^$USER .*tail -n 0 -F \"$LOG\"$"; then - tail -n 0 -F "$LOG" | /usr/lib/byobu/.notify_osd -else - exit 0 -fi +tail --pid $PPID -n 0 -F $LOG | /usr/lib/byobu/.notify_osd "$PPID"