Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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. – Llamageddon Dec 2 '11 at 13:46

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.