You are not logged in.

#1 2010-09-16 09:06:30

Slax
Member
Registered: 2010-08-11
Posts: 39

Cant echo extended ASCII characters to xsetroot -name

Ok, I'll try to explain this without getting confused.

I'm using a font with custom glyphs to display little "icons" in my dwm status using xsetroot.

I got it to work, but I'd like to know what's going on.
The only way that I could get the glyphs into my script was to:
1. Open urxvt and type

echo -e '\xEF' #wifi status glyph

2. Highlight the resulting character
3. "Middle click it" into my editor for .xinitrc

For example, some of the .xinitrc code

wifi(){
        if iwgetid > /dev/null
        then echo -e "\x03ï\x01"
        else echo -e "\x04ï\x01"
        fi
};
... 
xsetroot -name "`wifi`"

That 'i' thing, in most fonts, is ASCII pagecode 0xEF, my wifi status glyph.

What I don't understand is that if I simply make

then echo -e "\x03ï\x01"

read

then echo -e "\x03\xEF\x01"

the glyph will not show up.
A 7bit character such as 'E' will show up, however, if I make the line

then echo -e "\x03\x45\x01"

I tested to see if

echo -e '\xEF'

would show up in uxterm, and it didn't. However, I could "middle click" the character right into uxterm from urxvt.

What is going on and how can I code for the glyph in a non-unicode environment?

TL;DR: if I run the following code in uxterm it shows boxes, if I run it in urvxt it shows glyphs

echo -e `echo \\\x{{0..9},{a..f}}{{0..9},{a..f}}`

Last edited by Slax (2010-09-16 22:42:25)

Offline

#2 2010-09-19 10:11:16

Slax
Member
Registered: 2010-08-11
Posts: 39

Re: Cant echo extended ASCII characters to xsetroot -name

Solved this a few days ago.

I had to set my locacle to ISO-8859-1 rather than Unicode, as Unicode will not print ASCII beyond 128.

Offline

Board footer

Powered by FluxBB