You are not logged in.
Pages: 1
att
Lately I ran into dwm, and seeing some very cool screenshot in arch forum, I want to show icons on statusbar to make mine looks better.
Then I found this post, but it didn't work out.
I used dwm-6.0, and only apply xft-patch.
config.h
/* See LICENSE file for copyright and license details. */
/* appearance */
//static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
//static const char font[] = "-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*" "," "ohsnap:size=9:antialias=true:hinting=true";
static const char font[] = "ohsnap:size=9:antialias=true:hinting=true" "," "-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#444444";
static const char normbgcolor[] = "#222222";
static const char normfgcolor[] = "#bbbbbb";
static const char selbordercolor[] = "#005577";
static const char selbgcolor[] = "#005577";
static const char selfgcolor[] = "#eeeeee";
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
.xinitrc
#!/bin/sh
xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 &
feh --bg-scale /home/delta/pictures/bg.jpg
_test() {
# echo -e '\uE015'
echo "$(date)"
}
xset +fp /usr/share/fonts/local
xset +fp /usr/share/fonts/gao
xset +fp /usr/share/fonts/terminus
xset fp rehash
while true; do
xsetroot -name "$(_test)"
sleep 1
done &
exec dwm
Am I missing something or doing something wrong ? Thx.
take it easy
Offline
I think XFT is the culprit. Why do you patch DWM with XFT, if you use bitmap fonts anyway? Try without the XFT patch.
Also, this is the wrong subforum for such a post. Could a moderator move it?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Thx Unia. I tried it without XFT, still without icons.
And I am new to linux and arch forum, really sorry for the inconvenience.
take it easy
Offline
So using xsetroot to set the date string works.
When I suggested (in other thread) to do the echo command from a terminal within dwm I wasn't very clear. You'd still need to pass that to xsetroot:
$ xsetroot -name "$(echo -e '\uE015')"
That will definitely change what is in the status area (for a second), but whether it shows what you want will help determine the next troubleshooting steps.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
Image doesn't really qualify as Artwork and Screenshots: moving to Newbie Corner...
Offline
Are you using xterm or urxvt? In urxvt, it should print a box which you can paste into your .xinitrc and it should show the glyph in dwm. In xterm, it just prints an empty line here, but I can still grab the first character of the empty line and paste it. Maybe give that a try. You'll probably need to use stlarch first in the font string and ohsnap last too.
Offline
Did you run
fc-cache -f -v
?
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
Did you run
fc-cache -f -v
?
yes
take it easy
Offline
Did you try what I said about grabbing the first character of the empty line and the pasting it into your script. There is something there if it's printing an empty line, I don't why it's not showing a box. Maybe check your locale settings? It's all I can think of.
Offline
In my config.h, I have
static const char font[] =
"-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*"",""-*-ohsnap-medium-r-*-*-11-*-*-*-*-*-*-*";
and in my .xinitrc
while true; do
xsetroot -name " $(date +"%I:%M")"
sleep 30
done &
Offline
Hi. Sorry for bumping, don't want to make a new thread either.
I'm also having trouble getting icons on the bar. I assume it has something to do with defining font in config.h.
Whenever I try to use newly installed font, it seems to default on some other font; symbols, size changes etc won't work.
Also, some (well, most actually) fonts I download won't get recognised by fontforge. For instance terminus2 from https://github.com/w0ng/dwm, sm4tik from https://github.com/sunaku/sm4tik-font. So far only stlarch.bdf has been recognised. But neither of those seem to work.
Any recommendation where to start?
Offline
Make sure you have something like this in your .xinitrc :
xrdb -merge ~/.Xresources
xset +fp /usr/share/fonts/local
xset fp rehash
If you're installing the fonts manually, run :
#fc-cache -fs
#mkfontscale /usr/share/fonts/local
#mkfontdir /usr/share/fonts/local
Replace local with the actual location if it is different.
And try using the example I gave above in this thread for defining your fonts in config.h.
Offline
Thanks stlarch. I believe the fonts installed successfully, but the correct icons still cannot be used. If I opened the .pcf file in fontforge, clicked on the symbol, read it's value and typed it in terminal, the icon above it would be printed instead. Your example of clock icon with echo -e '\uE015' would give the smaller clock above the one listed within fontforge.
Edit: added screenshot explaining what I mean by the top row icon getting printed (note the icon is copied from the terminal into chromium address bar)
Last edited by azb (2013-02-20 20:11:08)
Offline
Selfish bump.
Offline
Hey sorry I also did not want to start a new thread. I am able to see the icons in my config.h but when I reload dwm it is just a blank space. Any help would be great. Thanks.
Edit: Fixed locales, everything works now. Sorry for reviving an old thread.
Last edited by kyzys (2013-07-08 20:24:20)
Offline
Pages: 1