You are not logged in.

#1 2010-05-09 18:38:50

geniuz
Member
Registered: 2010-04-10
Posts: 127

[SOLVED] Send message to every open terminal

Hey,

I've been trying to figure this is out for a while but just couldn't find whether something like this was possible. Anyway, I'm using CenterIM as my instant messaging client for msn and Musca as my WM. I usually keep centerim running on one workspace while I do stuff like browsing on another, however every workspace usually has its own terminal open too. What I would like to make (if possible) is a program that can send a message to every open terminal when I get a new message from somebody in CenterIM. I know there is way to tell CenterIM to execute a command upon receiving a message or sending a message. However I don't like a sound being played, I would just like a subtle notification in a terminal.

I also have Conky running, so there might be a way to let conky display a notification instead. Is there anybody who has done something similar already and can point me in the right direction? Thanks !

Last edited by geniuz (2010-05-09 22:22:35)

Offline

#2 2010-05-09 18:41:04

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: [SOLVED] Send message to every open terminal

try write.

Offline

#3 2010-05-09 18:56:58

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [SOLVED] Send message to every open terminal

See 'wall' command. http://linux.die.net/man/1/wall or

man wall

Offline

#4 2010-05-09 19:49:38

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: [SOLVED] Send message to every open terminal

I've tried both of them, but for some reason they just don't return anything. For instance, if I type:

$ wall [some message here]

In a random terminal the command executes but doesn't seem to do anything, at least the message isn't printed to any terminal. From the manpage I've checked whether mesg is set to yes, and it is. So does anybody know what might be the problem?

Offline

#5 2010-05-09 20:08:47

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: [SOLVED] Send message to every open terminal

Maybe it depends on whether you are actually logged on?  So, if you start a terminal which isn't a login shell it doesn't show?  Just a guess.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#6 2010-05-09 20:22:52

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: [SOLVED] Send message to every open terminal

Yea, you're right...if I login in a new tty and issue the command from a random terminal it shows in the new tty. Thus it doesn't show in shells that are no login shells. Is there any way to overcome this or must I try something else?

Offline

#7 2010-05-09 20:46:34

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] Send message to every open terminal

for pts in /dev/pts/*; do
  echo some text > $pts
done

big_smile

Last edited by brisbin33 (2010-05-09 20:53:35)

Offline

#8 2010-05-09 20:57:16

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [SOLVED] Send message to every open terminal

brisbin33 wrote:
for pts in /dev/pts/*; do
  echo some text > $pts
done

big_smile

With the change wink, works for me.

Offline

#9 2010-05-09 21:33:46

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: [SOLVED] Send message to every open terminal

Yep, same here...works perfectly ! Thanks everyone!

Offline

Board footer

Powered by FluxBB