captaincurrie / wmii

Automatically exported from code.google.com/p/wmii
Other
0 stars 1 forks source link

Notice events not being displayed #264

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open terminal
2. wmiir xwrite /event Notice Hello

What is the expected result? What do you see instead?

Expect 'Hello' to appear as a right bar item then disappear after 5 seconds.

Instead nothing is displayed.

What version of the product are you using (wmii -v)? On what operating
system (uname -a)?

wmii-hg2813+, ©2010 Kris Maglione

Linux debian-desktop 3.10-2-amd64 #1 SMP Debian 3.10.7-1 (2013-08-17) x86_64 
GNU/Linux

Please provide any additional information below.

Firstly I haven't used 'Notice' before so I could simply be calling it wrong. 
Google didn't find many examples, but the ones it did used the same type of 
call. wmiir xwrite /event Notice 'message'

I'm running the shell (dash) wmiirc file.

I did a little debugging by adding 'wmiir xwrite /event' calls to the script 
and the Notice event is being fired.

The problem seems to be that a bar expects a message to be tagged with 'label' 
but the Notice call only sends the message.

You can test this by sending wmiir xwrite /event Notice label Hello

The Notice bar will display 'Hello' but it will never be removed. The clear 
call doesn't set the 'label' tag so its ignored.

By sending a 'label' in the two xwrite's the Notice call works as expected.

Note: I've also remove the spaces around the '=' sign in 'xpid = $!' as it 
wasn't saving the pid.

This code works for me.

Event Notice
    wmiir xwrite $noticebar label $wi_arg

    kill $xpid 2>/dev/null # Let's hope this isn't reused...
    { sleep $noticetimeout; wmiir xwrite $noticebar label ' '; }&
    xpid=$!

Original issue reported on code.google.com by kevina...@gmail.com on 17 Nov 2013 at 2:20