You are not logged in.

#1 2015-10-22 13:46:45

hungerfish
Member
Registered: 2009-09-13
Posts: 254

[SOLVED]DWM status bar, problem displaying icon glyphs

Hi,
so I recently decided to add those small sexy icons to my statusbar, but I ran into a problem.
I'm using the 'siji-font' btw.
UPDATE:
I've got everything working on the dwm-side of things(tag bar), but my statusbar (xsetroot) constantly switches between displaying the correct icon-glyphs and showing just the raw '\uXXX' codes.
So, I've determined the reason why the switching was occurring. At some point I manually ran my 'bar() script' from my shell and it seem that this instance correctly showed the glyphs, but was fighting with the instance with just the raw codes from startup.
The ~30 second frequency was just the difference in execution time relative to the 60sec sleep I think.

But I still cannot get those glyphs to appear. I moved the 'xset +fp' stuff into the dwm-custom script just before the dwm-bar script gets called. In theory this shouldn't change anything, and it doesn't, I still only get the raw codes.
Now however, when I run the dwm-bar script in my terminal, it replaces the codes with the proper glyphs and keeps updating just fine. Still puzzled...

Below is my bar(), it gets called from another script with "dwm-bar &", that call is not inside any loop. The 'other script' gets called plainly from .xinitrc "exec dwm-custom". I also have

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
xset +fp /usr/share/fonts/misc
xset fp rehash

in there!

function bar() {
    getTime() {
        nt="$(date '+%R')"
        echo -ne "${nt}"
    }
    getDate() {
        nd="$(date '+%a, %d %b %Y')"
        echo -ne "${nd}"
    }
    getDay() {
        d="$(date '+%j')"
        echo -ne "${d}"
    }
    while true; do
        xsetroot -name " $(echo -ne '\uE015') $(getTime) $(echo -ne '\uE266') $(getDate) | $(getDay) "
        sleep 60
    done &
}

This seems to be happening at a frequency of 30 seconds..which could just be a coincidence.. any ideas?

EDIT:
I forgot to post my dwm config.h (the fonts part)

static const char *fonts[] = {
    "Siji:size=12",
    "Terminus:size=12"
};

I'm running dwm 6.1 straight from git(meaning xft support built in), with only a 'uselessgaps'-patch added..

Last edited by hungerfish (2015-10-25 10:55:14)


Beetles and bacteria are vastly more successful than humans in terms of survival.

Offline

#2 2015-10-24 05:40:57

wchouser3
Member
From: Indiana USA
Registered: 2013-08-13
Posts: 160
Website

Re: [SOLVED]DWM status bar, problem displaying icon glyphs

this happens when you don't have the proper font installed you need "Fixed" font set....I don't remember off hand what package has that particular one


If you can't be helpful, don't say anything at all. Fair enough?

Offline

#3 2015-10-24 16:09:11

hungerfish
Member
Registered: 2009-09-13
Posts: 254

Re: [SOLVED]DWM status bar, problem displaying icon glyphs

How can that be if I can see the glyphs when I call the script from my shell, but not when the same script is run during startup?
I'm thinking that something else happens when dwm starts up which allows the script to work when called later, which is missing beforehand, seeing that my bar script runs before I call dwm...

EDIT:

So it turns out 'something else happens' was a little imprecise. I realized that when I manually call my script which causes the glyphs to show, I do so from 'uxterm', doing the same from plain 'xterm' also doesn't work.
So clearly this is all down to a locale-settings problem...this is where it gets weird:
My /etc/locale.conf

# British settings
LANG=en_GB.utf8
LANGUAGE=en_GB:en_US:en
# Default sort order (e.g. files starting with a '.' lead...)
LC_COLLATE=C
# Some German Stuff
LC_MEASUREMENT=de_DE.UTF8
LC_MONETARY=de_DE.UTF8
LC_NUMERIC=de_DE.UTF8

Output from 'locale' in uxterm:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Output from 'locale' in plain xterm:

LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

When invoked from a tty, the output is identical to that of plain xterm, explaining why the script shows the raw codes when run on startup!

Something is messing with my locale settings, logging in as root works fine, so now I need to find the culprit!!
EDIT:
I created a new user to test with, and it seems that while my system-locale is configured correctly, these settings are not being applied to any non-root users. (They default to 'C')
Output from localectl:

System Locale: LANG=en_GB.utf8
                  LANGUAGE=en_GB:en_US:en
                  LC_NUMERIC=de_DE.UTF8
                  LC_COLLATE=C
                  LC_MONETARY=de_DE.UTF8
                  LC_MEASUREMENT=de_DE.UTF8

UPDATE:
So, I've solved this:
Turns out, /etc/locale.conf had the wrong permissions. It was set to 'rw- --- ---' for some reason, making it impossible to read for any other user than root (the file being owned by root). A simple 'chmod +r' fixed it.
I have no idea how that happened...but anyway, now my locale settings get applied to user sessions and as a bonus,  I get nice and fancy sexy icons in my dwm-statusbar! smile

Last edited by hungerfish (2015-10-25 10:55:00)


Beetles and bacteria are vastly more successful than humans in terms of survival.

Offline

Board footer

Powered by FluxBB