View Single Post
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#495
Originally Posted by Win7Mac View Post
Here's what I can't get to work:
{{blue}}{events}{events? ☚} only works as desired if there's 1 event.

If there's 2 or more, only the first is shown blue (the rest is white) and only the last has the ☚ (which is obvious)
This is handled by Billboard, so can't help you there.

Originally Posted by Win7Mac View Post
{script: /home/user/alarm.py} is not showing at all with the last line of script edited to
Code:
sys.stdout.write('\n'.join(sorted(get_queued_alarms())))
instead of
Code:
print '\n'.join(sorted(get_queued_alarms())) or 'No alarms'
This modification is supposed to enable special characters in the BB text, but I get nothing at all.

Any help on this would be great.

Would it be possible to get events and alarms via shell script too?
What does it say in termimal when you run it? The python interpreter usually tells you where the problem is. Did you import the sys module?

You can get special characters with the print function, too. Just encode them to utf-8. For example, in the python interpreter:
Code:
u"☚".encode('utf-8')
Gives you:
Code:
'\xe2\x98\x9a'
Just add this string to the string you're printing and it will show up in Billboard. It's a good idea to declare the encoding at the second line of the script with:
Code:
# -*- coding: utf-8 -*-
It's possible to write shell scripts for those but you should be able to do the same things with python. Basically you need to query the timed daemon for active events/alarms with atttributes, get their cookies, match those cookies to events, sort them and print them.
 

The Following User Says Thank You to slarti For This Useful Post: