Re: [dev] wmii unicode in the status?

From: loz.accs <loz.accs_AT_gmail.com>
Date: Sun, 23 Jan 2011 02:02:52 +0900

Hi, Eitan.
I am using wmii 3.9.2-r2 and I have no problems with wmii and utf-8
characters. Can you post output of you python script somewere (with
utf-8 support of cource) and paste a link here?
I will try to see this wierd characters in my wmii.

2011/1/23, Eitan Goldshtrom <thesourceofx_AT_gmail.com>:
> Hi. I'm trying to print out a progress bar sort of thing that represents
> my remaining battery life. I finally got the script to work such that
> from a cli I can print out the status as I like it with the correct
> information. However, for the bar itself I use unicode block characters.
> When it prints to the actual status it ends up printing everything
> around the bar fine, but the bar itself is a bunch of wierd characters.
> Am I right that that's an indication that the status isn't encoded in
> UTF-8? Is there a way to fix that? Below are my status() and the python
> script for creating the bar.
> -Eitan
>
>
> Python Script - battbar
> #!/usr/bin/python
> import math
> import sys
> r = float(sys.argv[1]) * 16 / 100
> i = int(r)
> r -= i
> output = unichr(9608) * i
> j = int(7*r) + 1
> if r > 0.0:
> output += unichr(9616-j)
> output += " " * (16-i-int(math.ceil(r)))
> print output.encode('utf-8')
>
>
> status() {
> SIGLEV=$(iwconfig wlan0 | grep 'Signal level')
> if [ "$?" = "0" ]; then
> SIGLEV=$(echo -n "$SIGLEV" | sed -n 's:.*Signal level=\(.*
> dBm\).*:\1:p')
> else
> SIGLEV=' - '
> fi
> BATT=$(acpi --battery | awk -F ', ' '{print $2}' | sed 's:\(.*\)%:\1:')
>
> echo -n '<'"$BATT"'%>['$(battbar $BATT)'] wlan0<'"$SIGLEV"'> |'
> $(uptime | sed 's/.*://; s/,//g') '|' $(date +'%I:%M.%S %a, %d %b %Y')
> }
>
>
Received on Sat Jan 22 2011 - 18:02:52 CET

This archive was generated by hypermail 2.2.0 : Sat Jan 22 2011 - 18:12:02 CET