Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm writing a simple osd_cat-based utility to display messages received through libpurple (via Finch or Pidgin, for example).

As of now, this is what I have managed to create:

dbus-monitor "interface=im.pidgin.purple.PurpleInterface, member=ReceivedImMsg" | awk '/string/ && (NR%2==1) {split($0, sender, "\"") }; /string/ && (NR%2==0) {print sender[2] ": " substr($0,11) }' | osd_cat --pos=top --align=right --indent=8 -O 4 -u white

Or split into multiple lines for enhanced reading pleasure:

dbus-monitor "interface=im.pidgin.purple.PurpleInterface, member=ReceivedImMsg"
 | awk '/string/ && (NR%2==1) {split($0, sender, "\"") };
        /string/ && (NR%2==0) {print sender[2] ": " substr($0,11) }'
 | osd_cat --pos=top --align=right --indent=8 -O 4 -u white

I did some experimenting, and found following to work:

yes | osd_cat
echo "text" | osd_cat
dbus-monitor | osd_cat
dbus-monitor | awk '{print $0}' | osd_cat
dbus-monitor "interface=im.pidgin.purple.PurpleInterface, member=ReceivedImMsg" | osd_cat

But following do not work:

dbus-monitor | awk '{print $1 $2}' | osd_cat
dbus-monitor "interface=im.pidgin.purple.PurpleInterface, member=ReceivedImMsg" | awk '{print $0}' |osd_cat

I am completely lost.

share|improve this question
    
What do you mean by “do not work”? Do you get an error message? Or do you just see no output? –  Gilles Dec 2 '11 at 1:03
    
@Gilles I simply do not see any output. –  Asmageddon Dec 2 '11 at 13:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.