You are not logged in.

#1 2012-06-09 13:15:20

hyperreal_logic
Member
Registered: 2011-05-29
Posts: 18

[SOLVED] Is it possible to change font size on dwm status bar?

I'm a dwm newbie, and I am wondering if it is possible to change the font size of the status bar.  I've tried to edit the following:

/* appearance */
static const char font[]             = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*";

I changed '12' with '14, but after compiling and reinstalling dwm, it didn't seem to have any effect.

Any insight on this would be appreciated :-)

Last edited by hyperreal_logic (2012-06-09 23:25:46)

Offline

#2 2012-06-09 13:25:54

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Is it possible to change font size on dwm status bar?

Is terminus properly installed? Did you restart dwm? (Silly questions, sorry, but the declaration you used seems OK.)

Just in case... To look up available options for bitmap fonts, use xfontsel. You can adjust the settings there and copy the string to be used in the config.h.

Last edited by bohoomil (2012-06-09 13:27:44)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2012-06-09 19:53:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED] Is it possible to change font size on dwm status bar?

Looks good here too.  Perhaps the most likely problem is not having terminus in Xorg's font path.

Terminus does not install into the "normal" arch font path, so you need to add /usr/share/fonts/local.

This is covered in the terminus font wiki page.  To verify that this worked, you can try launching a terminal (urxvt/xterm types) with the option "-fn <terminus font string>" to see if it recognizes the font string.

Edit: or check xfontsel to be sure terminus is listed.

Edit2: Another common problem stems from which file is editted.  Which config.h did you add that to?  The ABS method of recompiling (recommended) creates several copies of config.h.  The PKGBUILD only uses the top level config.h.  If you edit one of the others, it will be ignored or overwritten.  For more info on this see this thread

Last edited by Trilby (2012-06-09 20:07:31)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#4 2012-06-09 22:27:36

hyperreal_logic
Member
Registered: 2011-05-29
Posts: 18

Re: [SOLVED] Is it possible to change font size on dwm status bar?

Trilby wrote:

Looks good here too.  Perhaps the most likely problem is not having terminus in Xorg's font path.

Terminus does not install into the "normal" arch font path, so you need to add /usr/share/fonts/local.

This is covered in the terminus font wiki page.  To verify that this worked, you can try launching a terminal (urxvt/xterm types) with the option "-fn <terminus font string>" to see if it recognizes the font string.

Edit: or check xfontsel to be sure terminus is listed.

Edit2: Another common problem stems from which file is editted.  Which config.h did you add that to?  The ABS method of recompiling (recommended) creates several copies of config.h.  The PKGBUILD only uses the top level config.h.  If you edit one of the others, it will be ignored or overwritten.  For more info on this see this thread

I have made sure that terminus was installed correctly, and I also installed several other bitmap fonts.  I had to create an xorg.conf file, containing only the entries for each font type (100dpi, TTF, local, etc).  I entered the command you mentioned above, and it said 'unable to load base fontset'.  I also cannot see any of the bitmap fonts I installed in xfontsel.  I did edit the config.h in the topmost level of directories.  From ABS, I downloaded and thus created a directory called 'dwm' which contains the PKGBUILD, config.h and some other files in the top immediate directory.  This directory is also where I built dwm and installed it with makepkg.

Offline

#5 2012-06-09 22:48:48

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] Is it possible to change font size on dwm status bar?

Here is the string I'm currently using:

static const char font[]            = "-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*";

2012_06_09_154946_1280x1024_scrot.jpg

I changed the "12" to "14" and it works:

2012_06_09_155045_1280x1024_scrot.jpg

Have you tried using any of the fonts you can see in xfontsel?

Last edited by 2ManyDogs (2012-06-09 23:00:29)

Offline

#6 2012-06-09 22:57:37

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [SOLVED] Is it possible to change font size on dwm status bar?

Try this in your ~/.xinitrc:

xset +fp /usr/share/fonts/local/ 

EDIT: Before starting DWM, of course.

Last edited by Unia (2012-06-09 22:57:55)


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

#7 2012-06-09 22:59:42

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] Is it possible to change font size on dwm status bar?

^ what unia (and trilby) said. the wiki says

Some fonts like terminus are installed in /usr/share/fonts/local, which is not added to the font path by default. By adding the following lines to ~/.xinitrc

xset +fp /usr/share/fonts/local
xset fp rehash

Offline

#8 2012-06-09 23:25:21

hyperreal_logic
Member
Registered: 2011-05-29
Posts: 18

Re: [SOLVED] Is it possible to change font size on dwm status bar?

Unia wrote:

Try this in your ~/.xinitrc:

xset +fp /usr/share/fonts/local/ 

EDIT: Before starting DWM, of course.

This worked!

I edited .xinitrc with

xset +fp /usr/share/fonts/local

but found that if declared globally, it causes some problems with session entries in my .xinitrc.  So I had to make sure to put that command in my dwm section of .xinitrc.

Then I edited config.h, changed font to size 14, compiled/reinstalled, and now I have size 14 Terminus font in my status bar. :-D

Special thanks to all who helped!

Offline

#9 2016-08-08 13:14:28

sleepy_cat
Member
From: CHN
Registered: 2015-12-07
Posts: 43

Re: [SOLVED] Is it possible to change font size on dwm status bar?

2ManyDogs wrote:

^ what unia (and trilby) said. the wiki says

Some fonts like terminus are installed in /usr/share/fonts/local, which is not added to the font path by default. By adding the following lines to ~/.xinitrc

xset +fp /usr/share/fonts/local
xset fp rehash

Hi, 2ManyDogs, smile how is your PS1 working?

Last edited by sleepy_cat (2016-08-08 13:15:25)


Things being equal, the simplest explanation tends to be the right.

Offline

#10 2016-08-08 14:12:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED] Is it possible to change font size on dwm status bar?

Please do not Necrobump old threads, especially solved ones.  Also do not Hijack support threads.

Closed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB